From 17c838402c6d71aef041548ad36ee66db6f24a56 Mon Sep 17 00:00:00 2001 From: Rickard Green Date: Thu, 11 Aug 2016 15:45:05 +0200 Subject: Fix race causing lost wakeup on receive-after timeout --- erts/emulator/beam/beam_emu.c | 5 ++++- erts/emulator/beam/erl_hl_timer.c | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'erts') diff --git a/erts/emulator/beam/beam_emu.c b/erts/emulator/beam/beam_emu.c index 8b409e139b..17df14acfe 100644 --- a/erts/emulator/beam/beam_emu.c +++ b/erts/emulator/beam/beam_emu.c @@ -2166,7 +2166,10 @@ void process_main(void) c_p->i = (BeamInstr *) Arg(0); /* L1 */ SWAPOUT; c_p->arity = 0; - erts_smp_atomic32_read_band_relb(&c_p->state, ~ERTS_PSFLG_ACTIVE); + + if (!ERTS_PTMR_IS_TIMED_OUT(c_p)) + erts_smp_atomic32_read_band_relb(&c_p->state, + ~ERTS_PSFLG_ACTIVE); ASSERT(!ERTS_PROC_IS_EXITING(c_p)); erts_smp_proc_unlock(c_p, ERTS_PROC_LOCKS_MSG_RECEIVE); c_p->current = NULL; diff --git a/erts/emulator/beam/erl_hl_timer.c b/erts/emulator/beam/erl_hl_timer.c index 51a0d68247..96bb5ac9fa 100644 --- a/erts/emulator/beam/erl_hl_timer.c +++ b/erts/emulator/beam/erl_hl_timer.c @@ -735,7 +735,10 @@ proc_timeout_common(Process *proc, void *tmr) if (tmr == (void *) erts_smp_atomic_cmpxchg_mb(&proc->common.timer, ERTS_PTMR_TIMEDOUT, (erts_aint_t) tmr)) { - erts_aint32_t state = erts_smp_atomic32_read_acqb(&proc->state); + erts_aint32_t state; + erts_smp_proc_lock(proc, ERTS_PROC_LOCKS_MSG_RECEIVE); + state = erts_smp_atomic32_read_acqb(&proc->state); + erts_smp_proc_unlock(proc, ERTS_PROC_LOCKS_MSG_RECEIVE); if (!(state & (ERTS_PSFLG_ACTIVE|ERTS_PSFLG_EXITING))) erts_schedule_process(proc, state, 0); return 1; -- cgit v1.2.3 From ee32dcfea7d93c81c3d03489d9888e4baf523f2e Mon Sep 17 00:00:00 2001 From: Rickard Green Date: Thu, 11 Aug 2016 15:52:31 +0200 Subject: Avoid segfault when printing slogan after crashdumping --- erts/emulator/beam/erl_init.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'erts') diff --git a/erts/emulator/beam/erl_init.c b/erts/emulator/beam/erl_init.c index d9c3b0dcf4..51b72033ca 100644 --- a/erts/emulator/beam/erl_init.c +++ b/erts/emulator/beam/erl_init.c @@ -2262,14 +2262,15 @@ erl_exit_vv(int n, int flush_async, char *fmt, va_list args1, va_list args2) if (erts_mtrace_enabled) erts_mtrace_exit((Uint32) an); + if (fmt != NULL && *fmt != '\0') + erl_error(fmt, args2); /* Print error message. */ + /* Produce an Erlang core dump if error */ if (((n > 0 && erts_no_crash_dump == 0) || n == ERTS_DUMP_EXIT) && erts_initialized) { erl_crash_dump_v((char*) NULL, 0, fmt, args1); } - if (fmt != NULL && *fmt != '\0') - erl_error(fmt, args2); /* Print error message. */ sys_tty_reset(n); if (n == ERTS_INTR_EXIT) -- cgit v1.2.3 From c804924d4dae114b7322e0f9dfc1ca012fc82200 Mon Sep 17 00:00:00 2001 From: Erlang/OTP Date: Thu, 11 Aug 2016 16:23:52 +0200 Subject: Prepare release --- erts/doc/src/notes.xml | 23 +++++++++++++++++++++++ erts/vsn.mk | 2 +- 2 files changed, 24 insertions(+), 1 deletion(-) (limited to 'erts') diff --git a/erts/doc/src/notes.xml b/erts/doc/src/notes.xml index 4337d9d370..c348f56bc7 100644 --- a/erts/doc/src/notes.xml +++ b/erts/doc/src/notes.xml @@ -32,6 +32,29 @@

This document describes the changes made to the ERTS application.

+
Erts 8.0.3 + +
Fixed Bugs and Malfunctions + + +

+ Fixed a race that could cause a lost wakeup of a process + that timed out in a receive ... after. This bug + was introduced in ERTS version 7.0.

+

+ Own Id: OTP-13798 Aux Id: OTP-11997

+
+ +

+ Fixed segfault after writing an erl crash dump.

+

+ Own Id: OTP-13799

+
+
+
+ +
+
Erts 8.0.2
Fixed Bugs and Malfunctions diff --git a/erts/vsn.mk b/erts/vsn.mk index dff6b615fc..acd4509304 100644 --- a/erts/vsn.mk +++ b/erts/vsn.mk @@ -18,7 +18,7 @@ # %CopyrightEnd% # -VSN = 8.0.2 +VSN = 8.0.3 # Port number 4365 in 4.2 # Port number 4366 in 4.3 -- cgit v1.2.3