Bug 806413 - Please make Xorg server to exit with correct exitcode on SEGV (patch included)
Summary: Please make Xorg server to exit with correct exitcode on SEGV (patch included)
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: xorg-x11-server
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: X/OpenGL Maintenance List
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-03-23 16:37 UTC by Denys Vlasenko
Modified: 2012-10-08 05:07 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-10-08 05:07:29 UTC
Type: ---
Embargoed:


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

Description Denys Vlasenko 2012-03-23 16:37:24 UTC
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 05:07:29 UTC
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,
    EXIT_ERR_ABORT = 1,
    EXIT_ERR_CONFIGURE = 2,
    EXIT_ERR_DRIVERS = 3


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.