From 27ff974bfa155ad31dcdc338d7fecf36b08a0516 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Thu, 13 Dec 2018 16:34:38 +0100 Subject: erts: Fix seq_trace:reset_trace dirty gc bug When seq_trace:reset_trace could be called while a process was doing a dirty GC. This triggered a race where all signals was moved to the internal signal queue during the GC which in turn caused the a heap overrun problem. This fix makes it so that the main and msgq lock are taken before the clear. This will make sure that we are allowed to do the clear. --- lib/kernel/src/seq_trace.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/kernel') diff --git a/lib/kernel/src/seq_trace.erl b/lib/kernel/src/seq_trace.erl index 14fe21e9de..4f9d7b3e5c 100644 --- a/lib/kernel/src/seq_trace.erl +++ b/lib/kernel/src/seq_trace.erl @@ -98,7 +98,7 @@ print(Label, Term) -> -spec reset_trace() -> 'true'. reset_trace() -> - erlang:system_flag(1, 0). + erlang:system_flag(reset_seq_trace, true). %% reset_trace(Pid) -> % this might be a useful function too -- cgit v1.2.3