# std.os.abort: ported signal handling from musl · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/d1e8b73939ae9f139d90157a4623c5fe68b0ae64)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: d1e8b73939ae9f139d90157a4623c5fe68b0ae64

Requested commit: d1e8b73939ae9f139d90157a4623c5fe68b0ae64

Commit: d1e8b73939ae9f139d90157a4623c5fe68b0ae64

Tree: 2029c88d5d1fea6bb309b0f79f272cfefe3f272a

Author: Jan Philipp Hafer

Committer: Andrew Kelley

## Message

```
std.os.abort: ported signal handling from musl

* Document deviation from Linux man page, which is identical to musl.
  Man page wants always enabled user-provided abort handlers.
  Worst case logic bug, which this can introduce:
    + user disables SIGABRT handler to prevent tear down to last safe
      state
    + abort() gets called and enables user-provided SIGABRT handler
    + SIGABRT tears down to supposed last safe state instead of crash
    + Application, instead of crashing, continues
* Pid 1 within containers needs special handling.
  - fatal signals are not transmitted without privileges,
    so use exit as fallback
* Fix some signaling bits
* Add checks in Debug and ReleaseSafe for wrong sigprocmask

```

## Parents

- [367e2b2fe43a2de09767ad8d5657866088b44678](https://git.cafe/gitcafe/zig/commit/367e2b2fe43a2de09767ad8d5657866088b44678?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/d1e8b73939ae9f139d90157a4623c5fe68b0ae64?format=markdown)
