Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make unix signal-handler signal-safe
Other changes: - Re-enable the signal handler in release-builds. - Disable backtrace printing by default since it's not signal-safe. - Add `MULLVAD_BACKTRACE_ON_FAULT` env variable to enable backtracing. - Remove the alternate signal stack. The reasons for this are: - Setting up an alt-stack in a safe way is not trivial, our previous attempt was unsound in the presence of stack overflows. It can be done safely with mmap, but would require careful review. - The alt-stack is thread-local, meaning it would need to be initialized on a per-thread basis. We would need to hook into tokio and std::thread::spawn to be able to get good coverage, and even then there would no good way to ensure that *all* threads have an alternate stack, except that... - Rust (by default) allocates an alternate stack for every thread. Unfortunately, the prescence of Go code in our linked binary disables this feature. IMO, we should strive towards not having any Go code linked into the daemon for this reason.
- Loading branch information