Skip to contentSkip to conversation

New: [Ubuntu userspace upgrade 13.04 -> 13.10][regression] NV34 card fails to properly resume.

Bug 71116 [email protected] 1 participant 31 messages Nov 1, 2013 – Nov 8, 2013 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

https://bugs.freedesktop.org/show_bug.cgi?id=71116

          Priority: medium
            Bug ID: 71116
          Assignee: [email protected]
           Summary: [Ubuntu userspace upgrade 13.04 -> 13.10][regression]
                    NV34 card fails to properly resume.
        QA Contact: [email protected]
          Severity: normal
    Classification: Unclassified
                OS: Linux (All)
          Reporter: [email protected]
          Hardware: x86 (IA32)
            Status: NEW
           Version: 7.7 (2011)
         Component: Driver/nouveau
           Product: xorg

Created attachment 88462
--> https://bugs.freedesktop.org/attachment.cgi?id=88462&action=edit
Attempt to resume

[    0.197865] nouveau  [  DEVICE][0000:01:00.0] Chipset: NV34 (NV34)
[    0.197869] nouveau  [  DEVICE][0000:01:00.0] Family : NV30

After *only upgrading userspace* from Ubuntu 13.04 to Ubuntu 13.10 the card fails to properly resume from s2disk.

Important upgraded packages:

xserver-xorg-core:i386 2:1.13.3-0ubuntu6.2 -> 2:1.14.3-3ubuntu2 xserver-xorg-video-nouveau:i386 1:1.0.7-0ubuntu1 -> 1:1.0.9-2ubuntu1 libdrm2:i386 2.4.43-0ubuntu1.1 -> 2.4.46-1 libpciaccess0:i386 0.13.1-2 -> 0.13.2-1

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
Nouveau mailing list [email protected]
http://lists.freedesktop.org/mailman/listinfo/nouveau

A message that is not in the archive (sent off-list or not yet received): bug-71116-8800-V0hAGp6uBxMKqLRl/[email protected]/

#2 lore raw

[Bug 71116] [Ubuntu userspace upgrade 13.04 -> 13.10][regression] NV34 card fails to properly resume.

https://bugs.freedesktop.org/show_bug.cgi?id=71116

--- Comment #1 from Ronald <[email protected]> --- Created attachment 88463
--> https://bugs.freedesktop.org/attachment.cgi?id=88463&action=edit
Attempt to resume (nouveau.agpmode=4)

Suggested by imirkin. No dice.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
Nouveau mailing list [email protected]
http://lists.freedesktop.org/mailman/listinfo/nouveau

#3 lore raw

[Bug 71116] [Ubuntu userspace upgrade 13.04 -> 13.10][regression] NV34 card fails to properly resume.

In reply to a message not in the archive

https://bugs.freedesktop.org/show_bug.cgi?id=71116

--- Comment #2 from Ronald <[email protected]> --- Created attachment 88464
--> https://bugs.freedesktop.org/attachment.cgi?id=88464&action=edit
Full list of all upgraded packages

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
Nouveau mailing list [email protected]
http://lists.freedesktop.org/mailman/listinfo/nouveau

#4 lore raw

[Bug 71116] [Ubuntu userspace upgrade 13.04 -> 13.10][regression] NV34 card fails to properly resume.

In reply to a message not in the archive

https://bugs.freedesktop.org/show_bug.cgi?id=71116

--- Comment #3 from Ronald <[email protected]> --- Woa, tried nvidia-173 on

- 3.11
- 3.10
- 3.4

All failed to resume with a black screen. I guess nouveau used to have an edge on this one!

So, no mmiotraces =( ...

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
Nouveau mailing list [email protected]
http://lists.freedesktop.org/mailman/listinfo/nouveau

#5 lore raw

[Bug 71116] [Ubuntu userspace upgrade 13.04 -> 13.10][regression] NV34 card fails to properly resume.

In reply to a message not in the archive

https://bugs.freedesktop.org/show_bug.cgi?id=71116

--- Comment #4 from Ronald <[email protected]> --- Using agp=off for the Linux 3.11 kernel and NvAGP=1 in xorg.conf it works with the blob again.

Let me know if you would like to have a trace and all.

https://bugs.launchpad.net/suse/+bug/255601

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
Nouveau mailing list [email protected]
http://lists.freedesktop.org/mailman/listinfo/nouveau

#6 lore raw

[Bug 71116] [Ubuntu userspace upgrade 13.04 -> 13.10][regression] NV34 card fails to properly resume.

In reply to a message not in the archive

https://bugs.freedesktop.org/show_bug.cgi?id=71116

--- Comment #5 from Emil Velikov <[email protected]> --- Hi Ronald

AFAICS there are two routes you/we can take this
* Find out which package update caused the breakage
* Disable AGP with nouveau (similar to what you did with the blob)

If you're going for the first one, here is a list of packages that you'll need to check (other may not me related):
* xserver-xorg-core
* xserver-xorg-video-nouveau
* All *mesa*

The above can be rather messy and hard, as you'll need to track that the dependencies are met and/or rebuild packages.

The latter route is much easier
* Append nouveau.agpmode=0 to your kernel command line (i.e. grub/lilo)

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
Nouveau mailing list [email protected]
http://lists.freedesktop.org/mailman/listinfo/nouveau

#7 lore raw

[Bug 71116] [Ubuntu userspace upgrade 13.04 -> 13.10][regression] NV34 card fails to properly resume.

In reply to a message not in the archive

https://bugs.freedesktop.org/show_bug.cgi?id=71116

--- Comment #6 from Ronald <[email protected]> --- Created attachment 88546
--> https://bugs.freedesktop.org/attachment.cgi?id=88546&action=edit
2_Attempt to resume (nouveau.agpmode=0)

Survives one cycle since I did this from SSH with pm-hibernate. Apparently Xorg only locksup on resume because of xscreensaver if I press the button in XFCE.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
Nouveau mailing list [email protected]
http://lists.freedesktop.org/mailman/listinfo/nouveau

#8 lore raw

[Bug 71116] [Ubuntu userspace upgrade 13.04 -> 13.10][regression] NV34 card fails to properly resume.

In reply to a message not in the archive

https://bugs.freedesktop.org/show_bug.cgi?id=71116

--- Comment #7 from Ronald <[email protected]> --- Created attachment 88547
--> https://bugs.freedesktop.org/attachment.cgi?id=88547&action=edit
2_Attempt to resume (agp=off)

Also tried agp=off

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
Nouveau mailing list [email protected]
http://lists.freedesktop.org/mailman/listinfo/nouveau

#9 lore raw

[Bug 71116] [Ubuntu userspace upgrade 13.04 -> 13.10][regression] NV34 card fails to properly resume.

In reply to a message not in the archive

https://bugs.freedesktop.org/show_bug.cgi?id=71116

--- Comment #8 from Ronald <[email protected]> --- Created attachment 88548
--> https://bugs.freedesktop.org/attachment.cgi?id=88548&action=edit
2_Attempt to resume

To confirm my hypotheses that disabling AGP has no effect I tried it without kernel parameters that alter the driver's behaviour. Same effect.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
Nouveau mailing list [email protected]
http://lists.freedesktop.org/mailman/listinfo/nouveau

#10 lore raw

[Bug 71116] [Ubuntu userspace upgrade 13.04 -> 13.10][regression] NV34 card fails to properly resume.

In reply to a message not in the archive

https://bugs.freedesktop.org/show_bug.cgi?id=71116

--- Comment #9 from Ronald <[email protected]> --- (see above three logfiles)

I tried your second suggestion, did not work(!).

- nouveau.agpmode=0 -> crash
- agp=off -> crash
- no kernel parameters -> typing pm-hibernate from SSH -> success(!) . Clicking somewhere on desktop -> crash (Only moving cursor did not make it crash).

I'm not totally against bisecting these source packages, but that will then be a longterm thing. Furthermore, is all of mesa required? (i.e. I'm not using a compositing desktop for that matter (just XFCE)).

Conclusion, it appears that disabling agp has no effect. Machine only crashes after resume if the screen is repainted with the exception of mouse movements.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
Nouveau mailing list [email protected]
http://lists.freedesktop.org/mailman/listinfo/nouveau

#11 lore raw

[Bug 71116] [Ubuntu userspace upgrade 13.04 -> 13.10][regression] NV34 card fails to properly resume.

In reply to a message not in the archive

https://bugs.freedesktop.org/show_bug.cgi?id=71116

--- Comment #10 from Emil Velikov <[email protected]> --- (In reply to comment #6)

Quoted 6 lines

Created attachment 88546 [details]
2_Attempt to resume (nouveau.agpmode=0)

Survives one cycle since I did this from SSH with pm-hibernate. Apparently Xorg only locksup on resume because of xscreensaver if I press the button in XFCE.

I had a strange feeling that mesa is involved :\

If you're up for it you can {re,}move nouveau_dri.so (the 3g/gl "driver") and confirm it that fixes your s2ram problems.
Note your CPU usage may sky-rocket (the system will fall back to software GL rendering).

(In reply to comment #9)
[...]

Quoted 4 lines

I'm not totally against bisecting these source packages, but that will then be a longterm thing. Furthermore, is all of mesa required? (i.e. I'm not using a compositing desktop for that matter (just XFCE)).

Before bisecting anything I would suggest that you absolutely make sure that you know which package broke things - mesa, xserver-xorg-core, xserver-xorg-video-nouveau and/or other.

When going through mesa, make sure that you keep all the packages at the same version.

Here is a crash course of what the different mesa packages provide Essential parts
* libgl1-mesa-glx -> libGL provider
* libgl1-mesa-dri -> provides the "hardware accelerated drivers"
* libglapi-mesa -> dispatch library

Extra (your system may require one or both depending on what software you have)
* libgbm1
* libegl1-mesa -> libEGL provider

Other
* libopenvg1-mesa -> libOpenVG, afaik noone uses this
* mesa-common-dev -> headers

Not part of mesa (but have mesa in the package name :P)
* libglu1-mesa -> minor suspect
* mesa-utils -> highly unlikely to be related

Have fun :)

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
Nouveau mailing list [email protected]
http://lists.freedesktop.org/mailman/listinfo/nouveau

#12 lore raw

[Bug 71116] [Ubuntu userspace upgrade 13.04 -> 13.10][regression] NV34 card fails to properly resume.

In reply to a message not in the archive

https://bugs.freedesktop.org/show_bug.cgi?id=71116

--- Comment #11 from Ronald <[email protected]> --- I relocated /usr/lib/i386-linux-gnu/dri/nouveau_dri.so to nouveau_dri_off.so and restarted the computer with AGP. I confirmed the AIGLX error in that it switches to swrast.

Did not fix the s2disk issue (dmesg attached).

So, it's not mesa nor the kernel. All that remains is (just...) the X server, xf86-video-nouveau and libdrm. Right?

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
Nouveau mailing list [email protected]
http://lists.freedesktop.org/mailman/listinfo/nouveau

#13 lore raw

[Bug 71116] [Ubuntu userspace upgrade 13.04 -> 13.10][regression] NV34 card fails to properly resume.

In reply to a message not in the archive

https://bugs.freedesktop.org/show_bug.cgi?id=71116

--- Comment #12 from Ronald <[email protected]> --- Created attachment 88558
--> https://bugs.freedesktop.org/attachment.cgi?id=88558&action=edit
3_Attempt to resume (nouveau_dri.so disabled)

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
Nouveau mailing list [email protected]
http://lists.freedesktop.org/mailman/listinfo/nouveau

#14 lore raw

[Bug 71116] [Ubuntu userspace upgrade 13.04 -> 13.10][regression] NV34 card fails to properly resume.

In reply to a message not in the archive

https://bugs.freedesktop.org/show_bug.cgi?id=71116

--- Comment #13 from Emil Velikov <[email protected]> --- (In reply to comment #11)

Quoted 8 lines

I relocated /usr/lib/i386-linux-gnu/dri/nouveau_dri.so to nouveau_dri_off.so and restarted the computer with AGP. I confirmed the AIGLX error in that it switches to swrast.

Did not fix the s2disk issue (dmesg attached).

So, it's not mesa nor the kernel. All that remains is (just...) the X server, xf86-video-nouveau and libdrm. Right?

Sounds like it.
Do you know which gcc version is/was used to compile the new libdrm ? Might it be related to this http://gcc.gnu.org/ml/gcc-help/2013-07/msg00103.html?

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
Nouveau mailing list [email protected]
http://lists.freedesktop.org/mailman/listinfo/nouveau

#15 lore raw

[Bug 71116] [Ubuntu userspace upgrade 13.04 -> 13.10][regression] NV34 card fails to properly resume.

In reply to a message not in the archive

https://bugs.freedesktop.org/show_bug.cgi?id=71116

--- Comment #14 from Ronald <[email protected]> --- 13.10 (saucy) is using 4.8. 4.7 seems available, rebuilding libdrm with the source package should be easy. Just need to modify CC var I think...

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
Nouveau mailing list [email protected]
http://lists.freedesktop.org/mailman/listinfo/nouveau

#16 lore raw

[Bug 71116] [Ubuntu userspace upgrade 13.04 -> 13.10][regression] NV34 card fails to properly resume.

In reply to a message not in the archive

https://bugs.freedesktop.org/show_bug.cgi?id=71116

--- Comment #15 from Ronald <[email protected]> --- Recompiled libdrm with gcc-4.7 and BOOM the issue did p00f... =)

I'll be reporting this to Ubuntu upstream. Thanks a ton!

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
Nouveau mailing list [email protected]
http://lists.freedesktop.org/mailman/listinfo/nouveau

#17 lore raw

[Bug 71116] [Ubuntu userspace upgrade 13.04 -> 13.10][regression] NV34 card fails to properly resume.

In reply to a message not in the archive

https://bugs.freedesktop.org/show_bug.cgi?id=71116

--- Comment #16 from Ronald <[email protected]> --- Filed a bugreport here:
https://bugs.launchpad.net/ubuntu/+source/libdrm/+bug/1247607

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
Nouveau mailing list [email protected]
http://lists.freedesktop.org/mailman/listinfo/nouveau

#18 lore raw

[Bug 71116] [NV34] libdrm built with gcc4.8 causes crashes/lockups

In reply to a message not in the archive

https://bugs.freedesktop.org/show_bug.cgi?id=71116

Emil Velikov <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------

            Summary|[Ubuntu userspace upgrade   |[NV34] libdrm built with
                   |13.04 -> 13.10][regression] |gcc4.8 causes
                   |NV34 card fails to properly |crashes/lockups
                   |resume.                     |

--- Comment #17 from Emil Velikov <[email protected]> --- Ronald all the thanks goes to the Andreas Radke (Arch developer) for finding and bisecting the issue. FWIW Arch has been using clang for ~3 months to build libdrm and it seems to work great.

Ideally one of the Ubuntu/GCC devs can take a look and provide more bit more clarity than
"This hints at something depending on undefined evaluation order between sequence points" [1]

Would that be an issue with nouveau code, gcc and/or both will hopefully be determined soon.

Cheers
Emil
[1] http://gcc.gnu.org/ml/gcc-help/2013-07/msg00151.html

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
Nouveau mailing list [email protected]
http://lists.freedesktop.org/mailman/listinfo/nouveau

#19 lore raw

[Bug 71116] [NV34] libdrm built with gcc4.8 causes crashes/lockups

In reply to a message not in the archive

https://bugs.freedesktop.org/show_bug.cgi?id=71116

--- Comment #18 from Maarten Lankhorst <[email protected]> --- Wow this is definitely a weird interesting bug.

It affects suspend-to-mem on my pci-e nv43 too.

<after resume from suspend to memory>

[   40.107810] nouveau E[  PGRAPH][0000:01:00.0]  ERROR nsource: DATA_ERROR
nstatus: BAD_ARGUMENT
[   40.108059] nouveau E[  PGRAPH][0000:01:00.0] ch 3 [0x000f7000 compiz[1713]]

subc 2 class 0x0039 mthd 0x0314 data 0x0051f000
(error repeats)

I can confirm that rebuilding only libdrm-nouveau2 with the raring toolchain fixes it.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
Nouveau mailing list [email protected]
http://lists.freedesktop.org/mailman/listinfo/nouveau

#20 lore raw

[Bug 71116] [any/all(?) cards below nv50(?)] libdrm built with gcc4.8 causes crashes/lockups

In reply to a message not in the archive

https://bugs.freedesktop.org/show_bug.cgi?id=71116

Ronald <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------

            Summary|[NV34] libdrm built with    |[any/all(?) cards below
                   |gcc4.8 causes               |nv50(?)] libdrm built with
                   |crashes/lockups             |gcc4.8 causes
                   |                            |crashes/lockups
Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
Nouveau mailing list [email protected]
http://lists.freedesktop.org/mailman/listinfo/nouveau

#21 lore raw

[Bug 71116] [any/all(?) cards below nv50(?)] libdrm built with gcc4.8 causes crashes/lockups

In reply to a message not in the archive

https://bugs.freedesktop.org/show_bug.cgi?id=71116

--- Comment #19 from Ronald <[email protected]> --- So, we have nv34, nv43 and nv44 affected by this. I updated the bugreport title so hopefully more people will stumble on it earlier (hope that is okay).

- nv44: GCC thread: During normal operation.
- nv43: Resuming from suspend-to-mem
- nv34: Resuming from suspend-to-disk

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
Nouveau mailing list [email protected]
http://lists.freedesktop.org/mailman/listinfo/nouveau

#22 lore raw

[Bug 71116] [any/all(?) cards below nv50(?)] libdrm built with gcc4.8 causes crashes/lockups normal operation, and resume from disk/memory

In reply to a message not in the archive

https://bugs.freedesktop.org/show_bug.cgi?id=71116

Ronald <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------

            Summary|[any/all(?) cards below     |[any/all(?) cards below
                   |nv50(?)] libdrm built with  |nv50(?)] libdrm built with
                   |gcc4.8 causes               |gcc4.8 causes
                   |crashes/lockups             |crashes/lockups normal
                   |                            |operation, and resume from
                   |                            |disk/memory
Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
Nouveau mailing list [email protected]
http://lists.freedesktop.org/mailman/listinfo/nouveau

#23 lore raw

[Bug 71116] [any/all(?) cards below nv50(?)] libdrm built with gcc4.8 causes crashes/lockups during normal operation, and resume from disk/memory

In reply to a message not in the archive

https://bugs.freedesktop.org/show_bug.cgi?id=71116

Ronald <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------

            Summary|[any/all(?) cards below     |[any/all(?) cards below
                   |nv50(?)] libdrm built with  |nv50(?)] libdrm built with
                   |gcc4.8 causes               |gcc4.8 causes
                   |crashes/lockups normal      |crashes/lockups during
                   |operation, and resume from  |normal operation, and
                   |disk/memory                 |resume from disk/memory
Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
Nouveau mailing list [email protected]
http://lists.freedesktop.org/mailman/listinfo/nouveau

#24 lore raw

[Bug 71116] [any/all(?) cards below nv50(?)] libdrm built with gcc4.8 causes crashes/lockups during normal operation, and resume from disk/memory

In reply to a message not in the archive

https://bugs.freedesktop.org/show_bug.cgi?id=71116

--- Comment #20 from Maarten Lankhorst <[email protected]> --- Created attachment 88817
--> https://bugs.freedesktop.org/attachment.cgi?id=88817&action=edit
hack to force defined behavior

As I feared, recompiling only pushbuf.c with gcc-4.7 fixes this bug. So something in pushbuf.c is miscompiled. Unfortunately it's also the biggest abuser of post increment ops.

A simple workaround seems to be this patch.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
Nouveau mailing list [email protected]
http://lists.freedesktop.org/mailman/listinfo/nouveau

#25 lore raw

[Bug 71116] [any/all(?) cards below nv50(?)] libdrm built with gcc4.8 causes crashes/lockups during normal operation, and resume from disk/memory

In reply to a message not in the archive

https://bugs.freedesktop.org/show_bug.cgi?id=71116

--- Comment #21 from Maarten Lankhorst <[email protected]> --- Compiled code with this patch:

00000000000015b0 <nouveau_pushbuf_reloc>:

    15b0:       55                      push   %rbp
    15b1:       48 8b 6f 30             mov    0x30(%rdi),%rbp
    15b5:       53                      push   %rbx
    15b6:       48 89 fb                mov    %rdi,%rbx
    15b9:       e8 42 ea ff ff          callq  0 <pushbuf_krel>
    15be:       89 45 00                mov    %eax,0x0(%rbp)
    15c1:       48 83 43 30 04          addq   $0x4,0x30(%rbx)
    15c6:       5b                      pop    %rbx
    15c7:       5d                      pop    %rbp
    15c8:       c3                      retq   

Without:
0000000000001650 <nouveau_pushbuf_reloc>:

    1650:       48 89 5c 24 f0          mov    %rbx,-0x10(%rsp)
    1655:       48 89 6c 24 f8          mov    %rbp,-0x8(%rsp)
    165a:       48 83 ec 10             sub    $0x10,%rsp
    165e:       48 8b 6f 30             mov    0x30(%rdi),%rbp
    1662:       48 89 fb                mov    %rdi,%rbx
    1665:       e8 96 e9 ff ff          callq  0 <pushbuf_krel>
    166a:       89 45 00                mov    %eax,0x0(%rbp)
    166d:       48 83 c5 04             add    $0x4,%rbp
    1671:       48 89 6b 30             mov    %rbp,0x30(%rbx)
    1675:       48 8b 1c 24             mov    (%rsp),%rbx
    1679:       48 8b 6c 24 08          mov    0x8(%rsp),%rbp
    167e:       48 83 c4 10             add    $0x10,%rsp
    1682:       c3                      retq   

It seems that the nouveau_pushbuf_reloc difference is harmless. Code is equivalent, except that without the patch applied it uses another temp variable causing less optimal code generation.

Remaining candidates: pushbuf_validate, nouveau_pushbuf_data, nouveau_pushbuf_del.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
Nouveau mailing list [email protected]
http://lists.freedesktop.org/mailman/listinfo/nouveau

#26 lore raw

[Bug 71116] [any/all(?) cards below nv50(?)] libdrm built with gcc4.8 causes crashes/lockups during normal operation, and resume from disk/memory

In reply to a message not in the archive

https://bugs.freedesktop.org/show_bug.cgi?id=71116

--- Comment #22 from Maarten Lankhorst <[email protected]> --- Oops, so gcc is broken here after all, look at this..

0000000000003860 <nouveau_pushbuf_reloc>:

    3860:       53                      push   %rbx
    3861:       48 8b 5f 30             mov    0x30(%rdi),%rbx
    3865:       48 8d 43 04             lea    0x4(%rbx),%rax
    3869:       48 89 47 30             mov    %rax,0x30(%rdi)
    386d:       e8 3e ea ff ff          callq  22b0 <pushbuf_krel>
    3872:       89 03                   mov    %eax,(%rbx)
    3874:       5b                      pop    %rbx
    3875:       c3                      retq   

Source:

void
nouveau_pushbuf_reloc(struct nouveau_pushbuf *push, struct nouveau_bo *bo,

              uint32_t data, uint32_t flags, uint32_t vor, uint32_t tor)
{
    *push->cur++ = pushbuf_krel(push, bo, data, flags, vor, tor);
}

gcc-4.8 evaluates it as:

void
nouveau_pushbuf_reloc(struct nouveau_pushbuf *push, struct nouveau_bo *bo,

              uint32_t data, uint32_t flags, uint32_t vor, uint32_t tor)
{
    push->cur++;
    *push->cur[-1] = pushbuf_krel(push, bo, data, flags, vor, tor);
}
Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
Nouveau mailing list [email protected]
http://lists.freedesktop.org/mailman/listinfo/nouveau

#27 lore raw

[Bug 71116] [any/all(?) cards below nv50(?)] libdrm built with gcc4.8 causes crashes/lockups during normal operation, and resume from disk/memory

In reply to a message not in the archive

https://bugs.freedesktop.org/show_bug.cgi?id=71116

--- Comment #23 from Maarten Lankhorst <[email protected]> --- while gcc-4.7 evaluates it as:

void
nouveau_pushbuf_reloc(struct nouveau_pushbuf *push, struct nouveau_bo *bo,

              uint32_t data, uint32_t flags, uint32_t vor, uint32_t tor)
{
    *push->cur = pushbuf_krel(push, bo, data, flags, vor, tor);
    push->cur++;
}
Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
Nouveau mailing list [email protected]
http://lists.freedesktop.org/mailman/listinfo/nouveau

#28 lore raw

[Bug 71116] [any/all(?) cards below nv50(?)] libdrm built with gcc4.8 causes crashes/lockups during normal operation, and resume from disk/memory

In reply to a message not in the archive

https://bugs.freedesktop.org/show_bug.cgi?id=71116

--- Comment #24 from Maarten Lankhorst <[email protected]> --- Because the function also increments the push->cur pointer, it's a subtle but real difference:

gcc-4.7:

u32 ret = func(); // May change push->cur ptr
*push->cur = ret;
push->cur++;

gcc-4.8:
u32 *ptr = push->cur;
push->cur++;

*ptr = func(); // Already sees the push->cur ptr

I'm not a language expert, so no idea if I'm right, but it seems the updated gcc-4.8 behavior is wrong here.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
Nouveau mailing list [email protected]
http://lists.freedesktop.org/mailman/listinfo/nouveau

#29 lore raw

[Bug 71116] [any/all(?) cards below nv50(?)] libdrm built with gcc4.8 causes crashes/lockups during normal operation, and resume from disk/memory

In reply to a message not in the archive

https://bugs.freedesktop.org/show_bug.cgi?id=71116

--- Comment #25 from Maarten Lankhorst <[email protected]> --- Well, pedantically gcc-4.7 behavior is this:

u32 *ptr = push->cur;
*ptr = func();
push->cur++;

But since func only reads push->cur it's the same.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
Nouveau mailing list [email protected]
http://lists.freedesktop.org/mailman/listinfo/nouveau

#30 lore raw

[Bug 71116] [any/all(?) cards below nv50(?)] libdrm built with gcc4.8 causes crashes/lockups during normal operation, and resume from disk/memory

In reply to a message not in the archive

https://bugs.freedesktop.org/show_bug.cgi?id=71116

--- Comment #26 from Kelly Doran <[email protected]> --- I am pretty sure the order of execution is considered undefined behavior here in C, thus the nouveau code is wrong (it is a side effect). Check out chapter 2.12 in "The C Programming Language" if you have it.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
Nouveau mailing list [email protected]
http://lists.freedesktop.org/mailman/listinfo/nouveau

#31 lore raw

[Bug 71116] [any/all(?) cards below nv50(?)] libdrm built with gcc4.8 causes crashes/lockups during normal operation, and resume from disk/memory

In reply to a message not in the archive

https://bugs.freedesktop.org/show_bug.cgi?id=71116

Maarten Lankhorst <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------

             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #27 from Maarten Lankhorst <[email protected]> ---
http://cgit.freedesktop.org/mesa/drm/commit/?id=482abbfafb56cbceaf5355c026434e638cddd0f1

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
Nouveau mailing list [email protected]
http://lists.freedesktop.org/mailman/listinfo/nouveau