diff options
author | Björn-Egil Dahlberg <[email protected]> | 2016-04-19 13:29:56 +0200 |
---|---|---|
committer | Björn-Egil Dahlberg <[email protected]> | 2016-04-19 13:29:56 +0200 |
commit | 58c0f8de7a27a659fe2b534a86752f67da1af998 (patch) | |
tree | 57b492e6f8dfdf044e7dc6b087dd89c82ef09c02 /erts/emulator | |
parent | 77c3110b00d7f5e80ca1da77df79650e2fa66efe (diff) | |
parent | 1afc15d988ee9fc57eaf9728dc52d8df75b5b12d (diff) | |
download | otp-58c0f8de7a27a659fe2b534a86752f67da1af998.tar.gz otp-58c0f8de7a27a659fe2b534a86752f67da1af998.tar.bz2 otp-58c0f8de7a27a659fe2b534a86752f67da1af998.zip |
Merge branch 'lukas/erts/tracing/fix-spawned-lc-error/OTP-10267'
* lukas/erts/tracing/fix-spawned-lc-error/OTP-10267:
erts: Fix lock order bug when only child is procs traced
Diffstat (limited to 'erts/emulator')
-rw-r--r-- | erts/emulator/beam/erl_process.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/erts/emulator/beam/erl_process.c b/erts/emulator/beam/erl_process.c index a520005c35..1a66044627 100644 --- a/erts/emulator/beam/erl_process.c +++ b/erts/emulator/beam/erl_process.c @@ -11183,10 +11183,12 @@ erl_create_process(Process* parent, /* Parent of process (default group leader). } if (IS_TRACED_FL(p, F_TRACE_PROCS)) { - if (locks & (ERTS_PROC_LOCK_STATUS|ERTS_PROC_LOCK_TRACE)) { + if ((locks & (ERTS_PROC_LOCK_STATUS|ERTS_PROC_LOCK_TRACE)) + == (ERTS_PROC_LOCK_STATUS|ERTS_PROC_LOCK_TRACE)) { + /* This happens when parent was not traced, but child is */ locks &= ~(ERTS_PROC_LOCK_STATUS|ERTS_PROC_LOCK_TRACE); - erts_smp_proc_unlock(p, locks & (ERTS_PROC_LOCK_STATUS|ERTS_PROC_LOCK_TRACE)); - erts_smp_proc_unlock(parent, locks & (ERTS_PROC_LOCK_STATUS|ERTS_PROC_LOCK_TRACE)); + erts_smp_proc_unlock(p, ERTS_PROC_LOCK_STATUS|ERTS_PROC_LOCK_TRACE); + erts_smp_proc_unlock(parent, ERTS_PROC_LOCK_STATUS|ERTS_PROC_LOCK_TRACE); } trace_proc_spawn(p, am_spawned, parent->common.id, mod, func, args); if (so->flags & SPO_LINK) |