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

Package:
xserver-xorg-core
Source:
xorg-server
Description:
Xorg X server - core server
Submitter:
Vitaliy Filippov
Date:
2026-03-02 17:41:12 UTC
Severity:
important
Tags:
#761445#5
Date:
2014-09-13 21:38:37 UTC
From:
To:
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.
0x00007fbc716b197c in pci_device_vgaarb_set_target (dev=0x0) at ../../src/common_vgaarb.c:230
230             dev = pci_sys->vga_default_dev;
(gdb) bt
#0  0x00007fbc716b197c in pci_device_vgaarb_set_target (dev=0x0) at ../../src/common_vgaarb.c:230
#1  0x00007fbc724ad700 in xf86VGAarbiterLock (pScrn=pScrn@entry=0x7fbc72b09af0) at ../../../../hw/xfree86/common/xf86VGAarbiter.c:92
#2  0x00007fbc7248ac30 in DPMSSetScreen (pScrn=0x7fbc72b09af0, level=0) at ../../../../hw/xfree86/common/xf86DPMS.c:141
#3  0x00007fbc7248af26 in DPMSSet (client=<optimized out>, level=level@entry=0) at ../../../../hw/xfree86/common/xf86DPMS.c:176
#4  0x00007fbc72505a6b in ProcDPMSDisable (client=<optimized out>) at ../../Xext/dpms.c:159
#5  ProcDPMSDispatch (client=<optimized out>) at ../../Xext/dpms.c:227
#6  0x00007fbc7244cf07 in Dispatch () at ../../dix/dispatch.c:432
#7  0x00007fbc72451096 in dix_main (argc=10, argv=0x7fff6e319c88, envp=<optimized out>) at ../../dix/main.c:296
#8  0x00007fbc7010ab45 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  0x00007fbc7243b50e in _start ()

#761445#10
Date:
2014-09-13 21:47:45 UTC
From:
To:
The same error occurs when starting XFCE... Probably it's not related to a
specific DE...

#761445#15
Date:
2014-09-13 23:39:10 UTC
From:
To:
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...

#761445#20
Date:
2014-09-14 13:25:43 UTC
From:
To:
Please report this on xorg-devel@lists.x.org and intel-gfx@lists.x.org.

Thanks,
Julien

#761445#25
Date:
2014-09-25 11:20:41 UTC
From:
To:
OK, reported it as https://bugs.freedesktop.org/show_bug.cgi?id=84325
#761445#38
Date:
2026-03-01 11:05:14 UTC
From:
To:
Hello,

Just to tell the patch has finally been integrated upstream as commit 0b8b5f2c4632e5e0204acfd2ea892220bd8db606

best regards

Rémi