Bug#761445: xserver-xorg-core: X.Org segfaults when starting KDE on an Intel+Radeon laptop

2014-09-13 Thread Vitaliy Filippov
Package: xserver-xorg-core
Version: 2:1.16.0-2+b1
Severity: important

Dear Maintainer,

On my laptop with 2 graphics cards (integrated Intel + discrete Radeon 8770M) 
X.Org
crashes in the very beginning of KDE startup. I.e I enter my login and password 
in KDM
or in lightdm, the KDE splashscreen shows up, and X crashes right after showing 
the
first icon on KDE splashscreen.

This is caused by a null-pointer dereference in libpciaccess0, but I'm not sure
if it's libpciaccess or X.org bug... pci_sys is NULL, does that mean 
libpciaccess
failed to do something or X.org failed to correctly initialise libpciaccess?

Stack trace:

Program received signal SIGSEGV, Segmentation fault.
0x7fbc716b197c in pci_device_vgaarb_set_target (dev=0x0) at 
../../src/common_vgaarb.c:230
230 dev = pci_sys-vga_default_dev;
(gdb) bt
#0  0x7fbc716b197c in pci_device_vgaarb_set_target (dev=0x0) at 
../../src/common_vgaarb.c:230
#1  0x7fbc724ad700 in xf86VGAarbiterLock (pScrn=pScrn@entry=0x7fbc72b09af0) 
at ../../../../hw/xfree86/common/xf86VGAarbiter.c:92
#2  0x7fbc7248ac30 in DPMSSetScreen (pScrn=0x7fbc72b09af0, level=0) at 
../../../../hw/xfree86/common/xf86DPMS.c:141
#3  0x7fbc7248af26 in DPMSSet (client=optimized out, level=level@entry=0) 
at ../../../../hw/xfree86/common/xf86DPMS.c:176
#4  0x7fbc72505a6b in ProcDPMSDisable (client=optimized out) at 
../../Xext/dpms.c:159
#5  ProcDPMSDispatch (client=optimized out) at ../../Xext/dpms.c:227
#6  0x7fbc7244cf07 in Dispatch () at ../../dix/dispatch.c:432
#7  0x7fbc72451096 in dix_main (argc=10, argv=0x7fff6e319c88, 
envp=optimized out) at ../../dix/main.c:296
#8  0x7fbc7010ab45 in __libc_start_main (main=0x7fbc7243b4e0 main, 
argc=10, argv=0x7fff6e319c88, init=optimized out, 
fini=optimized out, rtld_fini=optimized out, stack_end=0x7fff6e319c78) 
at libc-start.c:287
#9  0x7fbc7243b50e in _start ()

-- Package-specific info:
X server symlink status:

lrwxrwxrwx 1 root root 13 Jun 28 03:05 /etc/X11/X - /usr/bin/Xorg
-rwxr-xr-x 1 root root 2397280 Sep  9 05:37 /usr/bin/Xorg

VGA-compatible devices on PCI bus:
--
00:02.0 VGA compatible controller [0300]: Intel Corporation 3rd Gen Core 
processor Graphics Controller [8086:0166] (rev 09)

/etc/X11/xorg.conf does not exist.

/etc/X11/xorg.conf.d does not exist.

/etc/modprobe.d contains no KMS configuration files.

Kernel version (/proc/version):
---
Linux version 3.16-1-amd64 (debian-ker...@lists.debian.org) (gcc version 4.8.3 
(Debian 4.8.3-10) ) #1 SMP Debian 3.16.2-3 (2014-09-13)

Xorg X server log files on system:
--
-rw-r--r-- 1 root root 40311 Sep 13 23:34 /var/log/Xorg.1.log
-rw-r--r-- 1 root root 48260 Sep 14 01:30 /var/log/Xorg.0.log

Contents of most recent Xorg X server log file (/var/log/Xorg.0.log):
-
[  5147.212] 
X.Org X Server 1.16.0
Release Date: 2014-07-16
[  5147.212] X Protocol Version 11, Revision 0
[  5147.212] Build Operating System: Linux 3.2.0-4-amd64 x86_64 Debian
[  5147.212] Current Operating System: Linux gnusmas 3.16-1-amd64 #1 SMP Debian 
3.16.2-3 (2014-09-13) x86_64
[  5147.212] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-3.16-1-amd64 
root=UUID=05ec9def-2023-4ba6-ba0e-44c396a986c4 ro
[  5147.212] Build Date: 09 September 2014  01:34:43AM
[  5147.212] xorg-server 2:1.16.0-2+b1 (http://www.debian.org/support) 
[  5147.212] Current version of pixman: 0.32.6
[  5147.212]Before reporting problems, check http://wiki.x.org
to make sure that you have the latest version.
[  5147.212] Markers: (--) probed, (**) from config file, (==) default setting,
(++) from command line, (!!) notice, (II) informational,
(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[  5147.212] (==) Log file: /var/log/Xorg.0.log, Time: Sun Sep 14 01:29:07 
2014
[  5147.212] (==) Using system config directory /usr/share/X11/xorg.conf.d
[  5147.212] (==) No Layout section.  Using the first Screen section.
[  5147.212] (==) No screen section available. Using defaults.
[  5147.212] (**) |--Screen Default Screen Section (0)
[  5147.212] (**) |   |--Monitor default monitor
[  5147.212] (==) No monitor specified for screen Default Screen Section.
Using a default monitor configuration.
[  5147.212] (==) Automatically adding devices
[  5147.212] (==) Automatically enabling devices
[  5147.212] (==) Automatically adding GPU devices
[  5147.212] (WW) The directory /usr/share/fonts/X11/cyrillic does not exist.
[  5147.212]Entry deleted from font path.
[  5147.212] (==) FontPath set to:
/usr/share/fonts/X11/misc,
/usr/share/fonts/X11/100dpi/:unscaled,
/usr/share/fonts/X11/75dpi/:unscaled,
/usr/share/fonts/X11/Type1,
/usr/share/fonts/X11/100dpi,
/usr/share/fonts/X11/75dpi,
built-ins
[  5147.212] (==) 

Bug#761445: Acknowledgement (xserver-xorg-core: X.Org segfaults when starting KDE on an Intel+Radeon laptop)

2014-09-13 Thread Vitaliy Filippov
The same error occurs when starting XFCE... Probably it's not related to a  
specific DE...


--
With best regards,
  Vitaliy Filippov


--
To UNSUBSCRIBE, email to debian-x-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: https://lists.debian.org/op.xl5atvf20ncgu9@vitalif.vhome



Bug#761445: Not X.Org bug, probably libpciaccess0 one; fix attached

2014-09-13 Thread Vitaliy Filippov
With the help of gdb memory breakpoints, I've found the bug and made a  
sort of fix for it...


The real problem is not in X.Org, but more in either libdrm-intel1 or  
libpciaccess0...


The problem is that libdrm-intel1 calls pci_system_init() and then  
pci_system_cleanup() in function drm_intel_probe_agp_aperture_size from  
intel_bufmgr.c, and it doesn't take into account that someone else may  
need it, while libpciaccess0 just blindly accepts all these calls and does  
init/deinit.


The solution that first came to my mind is to reference count  
init/deinit calls so real init doesn't happen twice, and real deinit  
doesn't happen until the last user calls cleanup. The patch is attached;  
X.Org crash goes away after rebuilding libpciaccess0 with it...


Maybe it also would be good to fix libdrm-intel1 in some way, but it seems  
a slightly harder task :-)


The bug probably should be retargeted to libpciaccess0 package...

--
With best regards,
  Vitaliy Filippov

patch-libpciaccess-pci_sys-refcnt.diff
Description: Binary data