Bug 770560

Summary: nv driver segfaults in libpthread when starting X
Product: [openSUSE] openSUSE 12.2 Reporter: Larry Finger <Larry.Finger>
Component: X.OrgAssignee: E-mail List <xorg-maintainer-bugs>
Status: RESOLVED FIXED QA Contact: E-mail List <xorg-maintainer-bugs>
Severity: Major    
Priority: P2 - High CC: Larry.Finger, msrb
Version: Beta 2   
Target Milestone: ---   
Hardware: x86-64   
OS: openSUSE 12.2   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Larry Finger 2012-07-09 22:11:00 UTC
User-Agent:       Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20100101 Firefox/13.0.1

Nouveau does not work on the Nvidia adapter on my HP dv2815 laptop. This is not a problem as I value the untainted kernel; however, the frame buffer driver cannot handle resolutions over 1024x768. As my computer has 1280x800 pixels, the max resolution is a bit fuzzy. On previous versions, this fuzziness was fixed by selecting the nv driver in /etc/X11/xorg.conf.d/50-device.conf, and the 1280x800 modeline in 50-screen.conf. With 12.2, selecting that driver leads to a seg fault in libpthread, and X fails to start. The traceback is

[   185.811] Backtrace:
[   185.811] 0: X (xorg_backtrace+0x36) [0x564306]
[   185.811] 1: X (0x400000+0x168039) [0x568039]
[   185.811] 2: /lib64/libpthread.so.0 (0x7f56c2bc4000+0xf140) [0x7f56c2bd3140]
[   185.811] 
[   185.812] Segmentation fault at address (nil)
[   185.812] 
Fatal server error:
[   185.812] Caught signal 11 (Segmentation fault). Server aborting

The full contents of the failing Xorg.0.log are at

http://paste.opensuse.org/2561696

The "good" one is at http://paste.opensuse.org/76395651.

Reproducible: Always

Steps to Reproduce:
1.
2.
3.
Comment 1 Larry Finger 2012-07-11 23:32:23 UTC
I figured out how to start debugging this problem by booting the box in question to run level 3, and then logging in from another machine using ssh. The gdb output is as follows:

larrylap:~ # gdb /usr/bin/X
GNU gdb (GDB) SUSE (7.4.50.20120603-2.1.1)
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-suse-linux".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /usr/bin/X...Reading symbols from /usr/lib/debug/usr/bin/Xorg.debug...done.
done.
(gdb) run
Starting program: /usr/bin/X 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".

X.Org X Server 1.12.3
Release Date: 2012-07-09
X Protocol Version 11, Revision 0
Build Operating System: openSUSE SUSE LINUX
Current Operating System: Linux larrylap.site 3.5.0-rc6-wl+ #5 SMP Wed Jul 11 14:01:30 CDT 2012 x86_64
Kernel command line: root=/dev/disk/by-id/ata-ST9250315AS_5VC2GXQZ-part5 nomodeset resume=/dev/disk/by-id/ata-ST9250315AS_5VC2GXQZ-part3 splash=silent quiet vga=0x317 3
Build Date: 10 July 2012  12:49:34PM
 
Current version of pixman: 0.24.4
        Before reporting problems, check http://wiki.x.org
        to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
        (++) from command line, (!!) notice, (II) informational,
        (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/Xorg.0.log", Time: Wed Jul 11 18:19:56 2012
(==) Using config directory: "/etc/X11/xorg.conf.d"
(==) Using system config directory "/usr/share/X11/xorg.conf.d"
[tcsetpgrp failed in terminal_inferior: Operation not permitted]

Program received signal SIGSEGV, Segmentation fault.
0x0000000000000000 in ?? ()
Missing separate debuginfos, use: zypper install glibc-debuginfo-2.15-24.1.x86_64 libudev0-debuginfo-182-4.5.1.x86_64
(gdb) bt
#0  0x0000000000000000 in ?? ()
#1  0x00007fd136156303 in vgaHWSaveColormap (scrninfp=0x80fde0, save=0x811c58) at vgaHW.c:1124
#2  0x00007fd136157b6d in vgaHWSave (scrninfp=scrninfp@entry=0x80fde0, save=0x811c58, flags=7) at vgaHW.c:1155
#3  0x00007fd136587f20 in NVDACSave (pScrn=pScrn@entry=0x80fde0, vgaReg=<optimized out>, nvReg=0x810420, saveFonts=<optimized out>)
    at nv_dac.c:311
#4  0x00007fd1365891ec in NVSave (pScrn=pScrn@entry=0x80fde0) at nv_driver.c:2661
#5  0x00007fd13658b5f0 in NVScreenInit (scrnIndex=scrnIndex@entry=0, pScreen=pScreen@entry=0x813e30, argc=argc@entry=1, 
    argv=argv@entry=0x7fff69f5e948) at nv_driver.c:2429
#6  0x0000000000438c39 in AddScreen (pfnInit=0x7fd13658b410 <NVScreenInit>, argc=argc@entry=1, argv=argv@entry=0x7fff69f5e948)
    at dispatch.c:3797
#7  0x0000000000476e2e in InitOutput (pScreenInfo=pScreenInfo@entry=0x7e4da0 <screenInfo>, argc=argc@entry=1, argv=argv@entry=0x7fff69f5e948)
    at xf86Init.c:834
#8  0x00000000004277c6 in main (argc=1, argv=0x7fff69f5e948, envp=<optimized out>) at main.c:203
(gdb)
Comment 2 Larry Finger 2012-07-12 16:38:05 UTC
The problem is still present in 12.2-RC1. I am increasing the priority, etc.
Comment 3 Larry Finger 2012-08-09 16:59:37 UTC
Still present in 12.2-RC2. This bug must be fixed soon!
Comment 6 Michal Srb 2012-08-10 13:43:37 UTC
The problem is that readST01 member of vgaHWPtr is not initialized. It should be either initialized to standard method in vgaHWSetStdFuncs or set specifically for the driver. The nv driver in 12.2 doesn't do any of it.

It is fixed in upstream by this commit:
http://cgit.freedesktop.org/xorg/driver/xf86-video-nv/commit/?id=b3d61828837661c9b383378a7d6006752659108b

The fix is already present in the Factory version of nv driver (2.1.20).
Comment 7 Larry Finger 2012-08-10 17:31:55 UTC
I installed the Factory version, and I now have 1280x800 resolution, the way it was in 12.1.

Once this fix makes it to 12.2, the bug can be closed as code fixed.
Comment 8 Stefan Dirsch 2012-08-13 10:37:09 UTC
SR #130711
Comment 9 Stefan Dirsch 2012-08-13 12:14:39 UTC
SR has been accepted.