FS#68340 - [xorg-server] segfault on backtracer initialisation

Attached to Project: Arch Linux
Opened by Corubba (corubba) - Monday, 19 October 2020, 22:10 GMT
Last edited by Laurent Carlier (lordheavy) - Friday, 16 April 2021, 06:14 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To No-one
Architecture x86_64
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
Xorg writes a stacktrace to the console (or log file) in case something goes horribly wrong, using glibc's backtrace() function [0]. While it may only be used in error situations, it still needs to be initilised which is done on (almost) every Xorg execution. As the docs mention, certain compiler optimisations can break this function by violating assumptions backtrace() has about the stack. In my case (or: on my hardware), it results in Xorg segfaulting with no usefull console output or log file.

I am sure we aggree that the stacktrace printing is a desired feature for the arch package, so I would like to propose to compile the package using the compiler flags `-fno-omit-frame-pointer -fno-tree-tail-merge`. According to the docs, this should disable the breaking optimisations and improve the reliability; it also fixes the segfault in my case. I found no evidence of upstream recommending (or mentioning) this, or other distribution explicitly setting these flags. They may have a negative impact on performance.

As an alternative, one could disable the backtrace feature. It is guarded by a macro, but unfortunately gets activated by the mere presence of the backtrace() function at compile time; there is no configure flag. You would have to patch the meson config.

The full investigative story leading to this report is documented in the forums [1].

[0] https://www.gnu.org/software/libc/manual/html_node/Backtraces.html
[1] https://bbs.archlinux.org/viewtopic.php?id=259795

Additional info:
* package version(s)
- lightdm 1:1.30.0-4
- xorg-server 1.20.9-2
- glibc 2.32-4
- gcc-libs 10.2.0-3
* config and/or log files etc.
- content of /proc/cpuinfo
- the original service log/coredump (I ran into this the first time using lightdm)
- gdb log of the error after recompiling with debug symbols
* link to upstream bug report, if any
- none that I found.

Steps to reproduce:
* Install arch on a "Lenovo Thinkpad X1 Tablet 2nd Gen" (cpu: Intel i5-7Y57, gpu: Intel HD615)
* Start Xorg, e.g. `Xorg :0 -configure`
This task depends upon

Closed by  Laurent Carlier (lordheavy)
Friday, 16 April 2021, 06:14 GMT
Reason for closing:  Fixed
Additional comments about closing:  xorg-server-1.20.11-1
Comment by Corubba (corubba) - Wednesday, 25 November 2020, 23:26 GMT
Issue still exists with the new stable-branch package version (xorg-server 1.20.9.r21.g5c400cae1-2).
Comment by Corubba (corubba) - Wednesday, 02 December 2020, 14:28 GMT
Issue still present with xorg-server-1.20.10-1.

Comment by Corubba (corubba) - Thursday, 15 April 2021, 18:28 GMT
Today I installed the prebuild xorg-server-1.20.11-1 package and it runs fine, no segfault. Not really sure what did it, the changelog does not mention anything that sounds related.

Loading...