Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MB-35748: Backport a fix for race condition around trap_exit.
erts: Fix race for process_flag(trap_exit,true) and a concurrent exit signal. We now actually guarantee that the process will not die from exit signal *after* the call to process_flag(trap_exit,true) has returned. The race is narrow and probably quite hard to observe even if you manage to provoke it. Has only been confirmed with the help of return trace and a sleep in send_exit_signal(). Solution: Seize status lock to prevent send_exit_signal() from reading an old status (without TRAP_EXIT) and then writing PENDING_EXIT after TRAP_EXIT has been set by process_flag_2().
- Loading branch information