aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_trace.c
diff options
context:
space:
mode:
authorErlang/OTP <[email protected]>2010-06-03 09:05:26 +0000
committerErlang/OTP <[email protected]>2010-06-03 09:05:26 +0000
commitfe22c51ffb9d71ca11d4bac71e1fcc82b6b6d977 (patch)
tree8bf9eef5ede7ff63acbda2882445b445c13f29f3 /erts/emulator/beam/erl_trace.c
parentb770a19422f886d92a41eecee0a130d93bf42f80 (diff)
parentd6ed3417f87612b7a7c08e979d180e1d865482ba (diff)
downloadotp-fe22c51ffb9d71ca11d4bac71e1fcc82b6b6d977.tar.gz
otp-fe22c51ffb9d71ca11d4bac71e1fcc82b6b6d977.tar.bz2
otp-fe22c51ffb9d71ca11d4bac71e1fcc82b6b6d977.zip
Merge branch 'pan/unregister_error' into dev
* pan/unregister_error: Add possibly missing process lock before unregistering oneself Keep process lock over trace of unregister OTP-8663 Unregister may crash VM Extreme combinations of register/unregister in a highly parallell SMP application could crash the VM. The error is corrected.
Diffstat (limited to 'erts/emulator/beam/erl_trace.c')
-rw-r--r--erts/emulator/beam/erl_trace.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/erts/emulator/beam/erl_trace.c b/erts/emulator/beam/erl_trace.c
index 8addfcf5ad..381a182e39 100644
--- a/erts/emulator/beam/erl_trace.c
+++ b/erts/emulator/beam/erl_trace.c
@@ -1941,11 +1941,13 @@ trace_proc(Process *c_p, Process *t_p, Eterm what, Eterm data)
Eterm* hp;
int need;
+ ERTS_SMP_LC_ASSERT((erts_proc_lc_my_proc_locks(t_p) != 0) || erts_is_system_blocked(0));
if (is_internal_port(t_p->tracer_proc)) {
#define LOCAL_HEAP_SIZE (5+5)
DeclareTmpHeapNoproc(local_heap,LOCAL_HEAP_SIZE);
UseTmpHeapNoproc(LOCAL_HEAP_SIZE);
+
hp = local_heap;
mess = TUPLE4(hp, am_trace, t_p->id, what, data);
hp += 5;
@@ -2727,6 +2729,8 @@ trace_port(Port *t_p, Eterm what, Eterm data) {
Eterm mess;
Eterm* hp;
+ ERTS_SMP_LC_ASSERT(erts_lc_is_port_locked(t_p) || erts_is_system_blocked(0));
+
if (is_internal_port(t_p->tracer_proc)) {
#define LOCAL_HEAP_SIZE (5+5)
DeclareTmpHeapNoproc(local_heap,LOCAL_HEAP_SIZE);