#1000887 xorg: X server segfaults when using xpdf

Package:
xorg
Source:
xorg
Description:
X.Org X Window System
Submitter:
David Haworth
Date:
2022-01-02 14:03:02 UTC
Severity:
normal
#1000887#5
Date:
2021-11-30 18:41:21 UTC
From:
To:
Dear Maintainer,

I'm running devuan (latest unstable). I reported this problem to the devuan
bug list, but they tell me that the xorg packages in devuan come from debian
without recompilation.

The X server crashes when I view one particular PDF file in xpdf. The file
is https://datasheets.raspberrypi.com/rp2040/rp2040-datasheet.pdf

There may be other PDF files that trigger the crash too, but there are many
that don't.

The crash is 100% repeatable by scrolling the table of contents in the
left-hand pane, either with the mouse scroll-wheel or with the thumb slider.

I've changed the generated content from reportbug to show the Xorg log file
after the crash. There's a backtrace at the end.

All the best,
Dave

#1000887#10
Date:
2021-12-11 07:45:03 UTC
From:
To:
Hi,

I used a remote ssh session to attach the Xorg process in gdb.

Judging by entry #1 of the stack trace, it might be a stack corruption.

Here's the session log:

GNU gdb (Debian 10.1-2) 10.1.90.20210103-git
Copyright (C) 2021 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-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /usr/lib/xorg/Xorg...
(No debugging symbols found in /usr/lib/xorg/Xorg)
[?2004h(gdb) attach 3158
[?2004l
Attaching to program: /usr/lib/xorg/Xorg, process 3158
[New LWP 3160]
[New LWP 3161]
[New LWP 3164]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
0x00007f1adb4cdc96 in epoll_wait (epfd=4, events=0x7ffc2ba7bdd0, maxevents=256, timeout=275496) at ../sysdeps/unix/sysv/linux/epoll_wait.c:30
30	../sysdeps/unix/sysv/linux/epoll_wait.c: No such file or directory.
[?2004h[?2004l
[?2004h(gdb) c
[?2004l
Continuing.

Thread 1 "Xorg" received signal SIGSEGV, Segmentation fault.
0x00007f1accd8a03a in ?? ()
[?2004h[?2004l
[?2004h(gdb) info stack
[?2004l
#0  0x00007f1accd8a03a in ?? ()
#1  0x0000000000000001 in ?? ()
#2  0x0000559ee4a86ab0 in ?? ()
#3  0x00007f1ad9752ec8 in ?? () from /usr/lib/x86_64-linux-gnu/dri/r600_dri.so
#4  0x00007f1ad9754754 in ?? () from /usr/lib/x86_64-linux-gnu/dri/r600_dri.so
#5  0x00007f1ad96f857f in ?? () from /usr/lib/x86_64-linux-gnu/dri/r600_dri.so
#6  0x00007f1ad9318f8a in ?? () from /usr/lib/x86_64-linux-gnu/dri/r600_dri.so
#7  0x00007f1ace8f5af0 in ?? () from /usr/lib/xorg/modules/libglamoregl.so
#8  0x00007f1ace8f6370 in ?? () from /usr/lib/xorg/modules/libglamoregl.so
#9  0x00007f1ace8f8f30 in ?? () from /usr/lib/xorg/modules/libglamoregl.so
#10 0x0000559ee3522ed7 in ?? ()
#11 0x0000559ee343958f in ?? ()
#12 0x0000559ee343d41e in ?? ()
#13 0x0000559ee3441395 in ?? ()
#14 0x00007f1adb3f7e4a in __libc_start_main (main=0x559ee342aba0, argc=6, argv=0x7ffc2ba7cc08, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7ffc2ba7cbf8)
    at ../csu/libc-start.c:314
#15 0x0000559ee342abda in _start ()
[?2004h(gdb) quit
[?2004l
[?2004hA debugging session is active.

	Inferior 1 [process 3158] will be detached.

Quit anyway? (y or n) y
[?2004l
Detaching from program: /usr/lib/xorg/Xorg, process 3158
[Inferior 1 (process 3158) detached]

All the best,
Dave

#1000887#15
Date:
2022-01-02 14:00:35 UTC
From:
To:
Some more information:

* A colleague who owns a more modern Radeon GPU than mine (using
 the radeonsi drivers) doesn't have the same problem.

* If I start the X server with color depth 16 the problem goes away,
  but occurs with both 24 and 32 color depths.

From these observations, I conclude that the problem lies in the full-color
handling of the standard radeon driver.