Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use libc::abort, not intrinsics::abort, in rtabort! #31457

Merged
merged 1 commit into from
May 23, 2016

Commits on May 23, 2016

  1. Use libc::abort, not intrinsics::abort, in rtabort!

    intrinsics::abort compiles down to an illegal instruction, which on
    Unix-like platforms causes the process to be killed with SIGILL.  A more
    appropriate way to kill the process would be SIGABRT; this indicates
    better that the runtime has explicitly aborted, rather than some kind of
    compiler bug or architecture mismatch that SIGILL might indicate.
    
    For rtassert!, replace this with libc::abort.  libc::abort raises
    SIGABRT, but is defined to do so in such a way that it will terminate
    the process even if SIGABRT is currently masked or caught by a signal
    handler that returns.
    
    On non-Unix platforms, retain the existing behavior.  On Windows we
    prefer to avoid depending on the C runtime, and we need a fallback for
    any other platforms that may be defined.  An alternative on Windows
    would be to call TerminateProcess, but this seems less essential than
    switching to using SIGABRT on Unix-like platforms, where it is common
    for the process-killing signal to be printed out or logged.
    
    This is a [breaking-change] for any code that depends on the exact
    signal raised to abort a process via rtabort!
    
    cc rust-lang#31273
    cc rust-lang#31333
    lambda committed May 23, 2016
    Configuration menu
    Copy the full SHA
    cfc3865 View commit details
    Browse the repository at this point in the history