Bug#1114853: xserver-xorg-core: xset -dpms cause Xorg segfault
Thanks Bernhard for the information.
I found a fix (originally dating back to 2014 afaict) that I could
backport to the package in Debian trixie:
```
git clone https://gitlab.freedesktop.org/rherilier/libpciaccess.git
cd libpciaccess
git show 2aed459b0b8bd5f81bd793fff70396728eed75af >
../libpciaccess-fix-pci-sys-null-deref.patch
cd ..
sudo apt-get build-dep libpciaccess0
sudo apt-get build-dep --host-architecture i386 libpciaccess0
apt source libpciaccess0
cd libpciaccess-0.17
patch -p1 < ../libpciaccess-fix-pci-sys-null-deref.patch
debuild -i -us -uc -b
debuild -a i386 -i -us -uc -b
cd ..
sudo dpkg -i libpciaccess*.deb
# reboot
xset -dpms # no longer crashes Xorg
```
the commit adds reference counting so that
```
open
open
close
use
close
```
doesn't explode at "use".
I also tried a testing (forky) live build with xfce (2025-11-10) and
couldn't reproduce the bug (xset -dpms didn't crash Xorg), so maybe it's
fixed in that version already (or maybe it's some other environmental
difference in live boot).
Thanks again,
Claude
On 26/09/2025 13:57, Bernhard Übelacker wrote:
On Wed, 10 Sep 2025 20:18:17 +0200 Claude Heiland-Allen
<claude@mathr.co.uk> wrote:
Package: xserver-xorg-core
Version: 2:21.1.16-1.3
Xorg keeps crashing when I leave my session idle.
To try to turn off the screen saver, I ran from a fresh XFCE4 session:
Hello,
with the help of the dbgsym packages the backtrace would look like in
[1].
The backtrace leads to upstream reports in [2].
There is also a patch to leave the crashing function
in case pci_sys is a NULL pointer.
Kind regards,
Bernhard
[1]
0x0000556c30a41c68 in OsSigHandler at ../../../../os/osinit.c:135
0x00007fe3180b1df0 <__restore_rt>
0x00007fe3185b19b3 in pci_device_vgaarb_set_target at
../../src/common_vgaarb.c:235
0x0000556c30921a7b in xf86VGAarbiterLock at
../../../../../../hw/xfree86/common/xf86VGAarbiter.c:92
0x0000556c30904bd3 in xf86DPMS at
../../../../../../hw/xfree86/common/xf86DPMS.c:56
0x0000556c3097a614 in DPMSSet at ../../../../Xext/dpms.c:106
0x0000556c3097a76d in ProcDPMSDisable at ../../../../Xext/dpms.c:228
0x0000556c308c4c08 in Dispatch at ../../../../dix/dispatch.c:551
0x0000556c308c8ccf in dix_main at ../../../../dix/main.c:274
[2]
https://sources.debian.org/src/libpciaccess/0.17-3/src/common_vgaarb.c#L235
https://gitlab.freedesktop.org/xorg/lib/libpciaccess/-/blob/master/src/common_vgaarb.c?ref_type=heads#L235
235 dev = pci_sys->vga_default_dev;
https://sources.debian.org/src/xorg-server/2%3A21.1.16-1.3/hw/xfree86/common/xf86VGAarbiter.c#L92
https://gitlab.freedesktop.org/xorg/xserver/-/blob/master/hw/xfree86/common/xf86VGAarbiter.c?ref_type=heads#L92
92 pci_device_vgaarb_set_target(pScrn->vgaDev);
[3]
https://gitlab.freedesktop.org/xorg/xserver/-/issues/1831
https://gitlab.freedesktop.org/xorg/lib/libpciaccess/-/issues/25
Reply to: