From e98fb1920ad053d2db4594c5d33cdfcfcdc6d771 Mon Sep 17 00:00:00 2001 From: Rickard Green Date: Mon, 6 Jul 2015 20:25:28 +0200 Subject: Teach non-smp VM how to deal with trace port crash --- erts/emulator/beam/erl_process.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'erts/emulator/beam/erl_process.c') diff --git a/erts/emulator/beam/erl_process.c b/erts/emulator/beam/erl_process.c index ea63d20dfa..b6ad8575cf 100644 --- a/erts/emulator/beam/erl_process.c +++ b/erts/emulator/beam/erl_process.c @@ -11082,6 +11082,22 @@ set_proc_exiting(Process *p, cancel_timer(p); p->i = (BeamInstr *) beam_exit; +#ifndef ERTS_SMP + if (state & (ERTS_PSFLG_RUNNING|ERTS_PSFLG_RUNNING_SYS)) { + /* + * I non smp case: + * + * Currently executing process might be sent an exit + * signal if it is traced by a port that it also is + * linked to, and the port terminates during the + * trace. In this case we want schedule out the + * process as quickly as possible in order to detect + * the event as fast as possible. + */ + ERTS_VBUMP_ALL_REDS(p); + } +#endif + if (enqueue) add2runq(enqueue > 0 ? p : make_proxy_proc(NULL, p, enq_prio), state, -- cgit v1.2.3