Bug 806413 - Please make Xorg server to exit with correct exitcode on SEGV (patch included)
Please make Xorg server to exit with correct exitcode on SEGV (patch included)
Product: Fedora
Classification: Fedora
Component: xorg-x11-server (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: X/OpenGL Maintenance List
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2012-03-23 12:37 EDT by Denys Vlasenko
Modified: 2012-10-08 01:07 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2012-10-08 01:07:29 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Proposed patch (1.60 KB, patch)
2012-03-23 12:37 EDT, Denys Vlasenko
no flags Details | Diff

  None (edit)
Description Denys Vlasenko 2012-03-23 12:37:24 EDT
Created attachment 572331 [details]
Proposed patch

Currently when Xorg server receives fatal signal, it generates some diagnostics, performs some cleanup, and exits with exit code 1.

Thus, it will not exit with correct exit code. If parent process will check for it, it will see WIFEXITED = true, not WIFSIGNALED = true.

This seems to be not too difficult to rectify: instead of exiting, we cal reset signal handler to SIG_DFL, and resend the signals to ourself again.

Please see attached patch.

While at it, I also corrected a typo in error message: s/Recieved/Received/
Comment 1 Peter Hutterer 2012-10-08 01:07:29 EDT
Denys, this is a good idea. Unfortunately, your patch does not compile (undefined reference FatalSignal) and it doesn't have any effect.
The call to raise() is after OsAbort() which calls abort(3), so your code is never hit. Also, in the case of abort, the exit code is always 134 (128 + SIGABRT). Finally, the exit code listed in the log has an actual meaning:

    EXIT_NO_ERROR = 0,

I'll close this bug here, this is stuff that we need to get upstream first. Please submit the patch to the xorg-devel list (against 1.13 or git master to make it easier for maintainers).

fwiw, I'll get the typo patch as standalone into the upstream server, so consider that one done.

Note You need to log in before you can comment on or make changes to this bug.