Bug 33999

Summary: 2.6.37 - NV11 crashes X if glxgears started
Product: xorg Reporter: Alex Buell <alex.buell>
Component: Driver/nouveauAssignee: Nouveau Project <nouveau>
Status: RESOLVED FIXED QA Contact: Xorg Project Team <xorg-team>
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: x86 (IA32)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
dmesg output
none
2.6.37 Xorg.0.log
none
dmesg with drm.debug=6
none
2.6.37 dmesg none

Description Alex Buell 2011-02-07 12:08:56 UTC
With Gnome, start glxgears, then click on maximise, X will crash. With LIBGL_ALWAYS_SOFTWARE=1, crashes do not occur. 

Starting KDE 4.6.x always result in a X crash. 

Logs attached. I am always happy to assist if necessary to fix this problem.
Comment 1 Alex Buell 2011-02-07 12:13:49 UTC
Created attachment 43038 [details]
dmesg output
Comment 2 Alex Buell 2011-02-07 12:14:19 UTC
Created attachment 43040 [details]
2.6.37 Xorg.0.log
Comment 3 Alex Buell 2011-02-07 12:18:17 UTC
I'd consider this a regression since 2.6.36 worked perfectly with the same program and same libraries.
Comment 4 Alex Buell 2011-02-07 14:34:38 UTC
Created attachment 43052 [details]
dmesg with drm.debug=6
Comment 5 Alex Buell 2011-02-07 16:22:51 UTC
Created attachment 43058 [details]
2.6.37 dmesg
Comment 6 Alex Buell 2011-02-07 18:12:08 UTC
I managed to get a backtrace:

Program received signal SIGSEGV, Segmentation fault.
0xb72d7821 in nouveau_dri2_create_buffer (pDraw=0x845e918, attachment=1, format=0) at nouveau_dri2.c:72
72	nouveau_dri2.c: No such file or directory.
	in nouveau_dri2.c
(gdb) bt
#0  0xb72d7821 in nouveau_dri2_create_buffer (pDraw=0x845e918, attachment=1, format=0) at nouveau_dri2.c:72
#1  0xb7327935 in ?? () from /usr/lib/xorg/modules/extensions/libdri2.so
#2  0xb7329ca0 in ?? () from /usr/lib/xorg/modules/extensions/libdri2.so
#3  0x08071e7f in Dispatch () at dispatch.c:432
#4  0x0806577a in main (argc=6, argv=0xbfbd3824, envp=0xbfbd3840) at main.c:291

The offending line of code that caused the crash is:

    nouveau_bo_handle_get(nouveau_pixmap(ppix)->bo, &nvbuf->base.name);

I'm not sure why it's crashing at this point but my guess is that it's probably the ->bo that might be the cause. I'd be glad to help track the cause down. I just need some input on how to proceed.
Comment 7 Alex Buell 2011-02-28 18:36:13 UTC
Just a quick word to say I've traced it to memory allocation problems. The card is a 32MB adapter living in a 64MB GART, with 16MB allocated to a scratch buffer. Attempts to reduce the amount of memory allocated to the scratch buffer ended in failure. The biggest allocation was 17MB, not sure what this was allocated for. See http://ompldr.org/vN2x1eQ for some debugging in the nouveau ddx driver. 

Ideas welcome on how to get this to work.
Comment 8 Alex Buell 2011-03-01 03:01:51 UTC
http://cgit.freedesktop.org/nouveau/xf86-video-nouveau/commit/?id=ace98a492353e6de712f4f717e6d3f562e3591f0 fixes the crash in the X server. 
(thanks to pq)

There are still problems, but trying 2.6.38-rc6 at the moment.
Comment 9 Marcin Slusarz 2011-12-05 13:35:36 UTC
There were some patches to nouveau-git kernel and xf86-video-nouveau which probably fix this bug. Please test it.
Comment 10 maximlevitsky 2011-12-05 14:43:20 UTC
Funny though, I just tested an NV11, in old box I played with today.

System itself has 256MB or ram, thus totally unusable even in xubuntu, but nouveau does work and glxgears does work as well (glxinfo reports that nouveau, nv11 driver is used).
Kudos, guys!

That card was Nvidia Geforce2 MX 200, with 32 MB of ram.
I just installed ubuntu 11.10 there.
Comment 11 Alex Buell 2011-12-05 15:32:47 UTC
(In reply to comment #10)
> Funny though, I just tested an NV11, in old box I played with today.
> 
> System itself has 256MB or ram, thus totally unusable even in xubuntu, but
> nouveau does work and glxgears does work as well (glxinfo reports that nouveau,
> nv11 driver is used).
> Kudos, guys!
> 
> That card was Nvidia Geforce2 MX 200, with 32 MB of ram.
> I just installed ubuntu 11.10 there.

How much graphic memory did you have on your box, and which versions of the OpenGL stack did you use with which kernel, please?

I will be testing on my old laptop as well.
Comment 12 Alex Buell 2011-12-06 17:06:05 UTC
(In reply to comment #11)

> I will be testing on my old laptop as well.

Just tested, glxinfo still crashes with a segfault. 

OpenGL stack used:

xf86-video-nouveau 0.0.16_pre20111109
mesa 7.11.2
xorg-server 1.10.4

Kernel:
3.1.0
Comment 13 Marcin Slusarz 2011-12-07 08:09:50 UTC
Alex: you need kernel from nouveau git tree (see http://nouveau.freedesktop.org/wiki/InstallDRM ).
Comment 14 Alex Buell 2012-04-13 17:33:32 UTC
(In reply to comment #13)
> Alex: you need kernel from nouveau git tree (see
> http://nouveau.freedesktop.org/wiki/InstallDRM ).

With 3.3.0, X no longer crashes. Tested on Gnome 3 in fallback mode. One small problem is that if I try to start Gnome 3, it will die with an error. Using fallback mode avoids the problem yet OpenGL programs seem to work just as well. 

Yay :)
Comment 15 Ilia Mirkin 2013-08-19 14:20:32 UTC
All the comments seem to indicate that the issue is fixed, updating status to reflect that.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.