From 57513239dc265373521bc4f04c154f17d5f0bae9 Mon Sep 17 00:00:00 2001 From: Rickard Green Date: Wed, 14 Sep 2016 12:58:27 +0200 Subject: Update vheap size when moving msgq to heap after GC --- erts/emulator/beam/erl_gc.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'erts') diff --git a/erts/emulator/beam/erl_gc.c b/erts/emulator/beam/erl_gc.c index 9e0919cc9c..e2875cedb3 100644 --- a/erts/emulator/beam/erl_gc.c +++ b/erts/emulator/beam/erl_gc.c @@ -150,6 +150,7 @@ static void move_msgq_to_heap(Process *p); static int reached_max_heap_size(Process *p, Uint total_heap_size, Uint extra_heap_size, Uint extra_old_heap_size); static void init_gc_info(ErtsGCInfo *gcip); +static Uint64 next_vheap_size(Process* p, Uint64 vheap, Uint64 vheap_sz); #ifdef HARDDEBUG static void disallow_heap_frag_ref_in_heap(Process* p); @@ -748,6 +749,9 @@ do_major_collection: p->last_old_htop = p->old_htop; #endif + ASSERT(!p->mbuf); + ASSERT(!ERTS_IS_GC_DESIRED(p)); + return reds; } @@ -2250,7 +2254,9 @@ copy_one_frag(Eterm** hpp, ErlOffHeap* off_heap, static void move_msgq_to_heap(Process *p) { + ErtsMessage **mpp = &p->msg.first; + Uint64 pre_oh = MSO(p).overhead; while (*mpp) { ErtsMessage *mp = *mpp; @@ -2293,6 +2299,11 @@ move_msgq_to_heap(Process *p) mpp = &(*mpp)->next; } + + if (pre_oh != MSO(p).overhead) { + /* Got new binaries; update vheap size... */ + BIN_VHEAP_SZ(p) = next_vheap_size(p, MSO(p).overhead, BIN_VHEAP_SZ(p)); + } } static Uint -- cgit v1.2.3 From 25ea6279b55db5af53040ec4ce9bf73b4aeeaa16 Mon Sep 17 00:00:00 2001 From: Rickard Green Date: Wed, 14 Sep 2016 13:20:53 +0200 Subject: Ensure we dont use an invalid live heap fragment pointer --- erts/emulator/beam/erl_gc.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'erts') diff --git a/erts/emulator/beam/erl_gc.c b/erts/emulator/beam/erl_gc.c index e2875cedb3..027ade45e5 100644 --- a/erts/emulator/beam/erl_gc.c +++ b/erts/emulator/beam/erl_gc.c @@ -388,6 +388,11 @@ erts_gc_after_bif_call_lhf(Process* p, ErlHeapFragment *live_hf_end, return result; } + if (!p->mbuf) { + /* Must have GC:d in BIF call... invalidate live_hf_end */ + live_hf_end = ERTS_INVALID_HFRAG_PTR; + } + if (is_non_value(result)) { if (p->freason == TRAP) { #if HIPE -- cgit v1.2.3 From 03dbdd45080139ee5ea083dd5153ec6056db1d1d Mon Sep 17 00:00:00 2001 From: Erlang/OTP Date: Wed, 14 Sep 2016 13:33:10 +0200 Subject: Prepare release --- erts/doc/src/notes.xml | 17 +++++++++++++++++ erts/vsn.mk | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) (limited to 'erts') diff --git a/erts/doc/src/notes.xml b/erts/doc/src/notes.xml index 517ea3b11f..72d2837949 100644 --- a/erts/doc/src/notes.xml +++ b/erts/doc/src/notes.xml @@ -32,6 +32,23 @@

This document describes the changes made to the ERTS application.

+
Erts 8.0.5 + +
Fixed Bugs and Malfunctions + + +

+ Fixed a VM crash that occured in a garbage collection of + a process when it had received binaries. This bug was + introduced in ERTS version 8.0 (OTP 19.0).

+

+ Own Id: OTP-13890

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