diff options
author | Sverker Eriksson <[email protected]> | 2018-06-11 19:41:55 +0200 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2018-06-11 19:41:55 +0200 |
commit | 438218baad361fdd2666d29f8ed3a0bcc9eeae60 (patch) | |
tree | 4bf5c0da41fefeb7011c0d06e01338d71fffb1bb /erts/emulator/beam | |
parent | bdd3971902c993a0ca04ecf3c0b153e07289474c (diff) | |
parent | c5a6b03c9ee71bb13723f6ca6ff0e8f6cd16fe24 (diff) | |
download | otp-438218baad361fdd2666d29f8ed3a0bcc9eeae60.tar.gz otp-438218baad361fdd2666d29f8ed3a0bcc9eeae60.tar.bz2 otp-438218baad361fdd2666d29f8ed3a0bcc9eeae60.zip |
Merge branch 'sverker/process-info-exiting'
* sverker/process-info-exiting:
erts: Fix incoming signal handling for exiting process
Diffstat (limited to 'erts/emulator/beam')
-rw-r--r-- | erts/emulator/beam/erl_proc_sig_queue.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/erts/emulator/beam/erl_proc_sig_queue.c b/erts/emulator/beam/erl_proc_sig_queue.c index 1aa390d94d..d6d22677e7 100644 --- a/erts/emulator/beam/erl_proc_sig_queue.c +++ b/erts/emulator/beam/erl_proc_sig_queue.c @@ -2723,6 +2723,9 @@ handle_process_info(Process *c_p, ErtsSigRecvTracing *tracing, Uint reds = 0; Process *rp; + ASSERT(!!is_alive == !(erts_atomic32_read_nob(&c_p->state) + & ERTS_PSFLG_EXITING)); + if (pisig->msgq_len_offset != ERTS_PROC_SIG_PI_MSGQ_LEN_IGNORE) { /* * Request requires message queue data to be updated @@ -3007,10 +3010,8 @@ erts_proc_sig_handle_incoming(Process *c_p, erts_aint32_t *statep, ERTS_HDBG_CHECK_SIGNAL_PRIV_QUEUE(c_p, 0); ERTS_LC_ASSERT(ERTS_PROC_LOCK_MAIN == erts_proc_lc_my_proc_locks(c_p)); - if (local_only) - state = -1; /* can never be a valid state... */ - else { - state = erts_atomic32_read_nob(&c_p->state); + state = erts_atomic32_read_nob(&c_p->state); + if (!local_only) { if (ERTS_PSFLG_SIG_IN_Q & state) { erts_proc_lock(c_p, ERTS_PROC_LOCK_MSGQ); erts_proc_sig_fetch(c_p); @@ -3023,13 +3024,15 @@ erts_proc_sig_handle_incoming(Process *c_p, erts_aint32_t *statep, yield = 0; if (!c_p->sig_qs.cont) { - if (state == -1) - *statep = erts_atomic32_read_nob(&c_p->state); - else - *statep = state; + *statep = state; return !0; } + if (state & ERTS_PSFLG_EXITING) { + *statep = state; + return 0; + } + next_nm_sig = &c_p->sig_qs.nmsigs.next; setup_tracing_state(c_p, &tracing); |