aboutsummaryrefslogtreecommitdiffstats
path: root/erts
diff options
context:
space:
mode:
authorRickard Green <[email protected]>2016-09-14 09:59:08 +0200
committerRickard Green <[email protected]>2016-09-14 09:59:08 +0200
commit4ad2eb90dbaab253cdac83030655b9bf6e4bc53d (patch)
treedb0dbb0d12d2c39e867cc343ce35a84c99bb51af /erts
parent590561c0d40d9874d11d8d714beb0c390d93d42d (diff)
parent83bf7bd198921895b0ca29f7cd1cdb935a68f6e9 (diff)
downloadotp-4ad2eb90dbaab253cdac83030655b9bf6e4bc53d.tar.gz
otp-4ad2eb90dbaab253cdac83030655b9bf6e4bc53d.tar.bz2
otp-4ad2eb90dbaab253cdac83030655b9bf6e4bc53d.zip
Merge branch 'maint'
* maint: Updated OTP version Prepare release Fix crash due to heap fragments left after GC Conflicts: OTP_VERSION erts/emulator/beam/erl_gc.c
Diffstat (limited to 'erts')
-rw-r--r--erts/doc/src/notes.xml17
-rw-r--r--erts/emulator/beam/erl_gc.c51
-rw-r--r--erts/vsn.mk2
3 files changed, 39 insertions, 31 deletions
diff --git a/erts/doc/src/notes.xml b/erts/doc/src/notes.xml
index 2a36e5568c..323df38ed3 100644
--- a/erts/doc/src/notes.xml
+++ b/erts/doc/src/notes.xml
@@ -32,6 +32,23 @@
<p>This document describes the changes made to the ERTS application.</p>
+<section><title>Erts 8.0.4</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p>
+ Fixed a VM crash that occured in garbage collection of a
+ process when it had received maps over the distribution.
+ This bug was introduced in ERTS version 8.0 (OTP 19.0).</p>
+ <p>
+ Own Id: OTP-13889</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
<section><title>Erts 8.0.3</title>
<section><title>Fixed Bugs and Malfunctions</title>
diff --git a/erts/emulator/beam/erl_gc.c b/erts/emulator/beam/erl_gc.c
index 830a06fb20..904bbda759 100644
--- a/erts/emulator/beam/erl_gc.c
+++ b/erts/emulator/beam/erl_gc.c
@@ -535,9 +535,19 @@ young_gen_usage(Process *p)
if (p->flags & F_ON_HEAP_MSGQ) {
ErtsMessage *mp;
- for (mp = p->msg.first; mp; mp = mp->next)
+ for (mp = p->msg.first; mp; mp = mp->next) {
+ /*
+ * We leave not yet decoded distribution messages
+ * as they are in the queue since it is not
+ * possible to determine a maximum size until
+ * actual decoding. However, we use their estimated
+ * size when calculating need, and by this making
+ * it more likely that they will fit on the heap
+ * when actually decoded.
+ */
if (mp->data.attached)
hsz += erts_msg_attached_data_size(mp);
+ }
}
aheap = p->abandoned_heap;
@@ -2250,39 +2260,22 @@ move_msgq_to_heap(Process *p)
if (mp->data.attached) {
ErlHeapFragment *bp;
- ErtsHeapFactory factory;
-
- erts_factory_proc_prealloc_init(&factory, p,
- erts_msg_attached_data_size(mp));
-
- if (is_non_value(ERL_MESSAGE_TERM(mp))) {
- if (mp->data.dist_ext) {
- ASSERT(mp->data.dist_ext->heap_size >= 0);
- if (is_not_nil(ERL_MESSAGE_TOKEN(mp))) {
- bp = erts_dist_ext_trailer(mp->data.dist_ext);
- /* Tokens does not use literal optimization */
- ERL_MESSAGE_TOKEN(mp) = copy_struct(ERL_MESSAGE_TOKEN(mp),
- bp->used_size,
- &factory.hp,
- factory.off_heap);
-
- erts_cleanup_offheap(&bp->off_heap);
- }
- ERL_MESSAGE_TERM(mp) = erts_decode_dist_ext(&factory,
- mp->data.dist_ext);
- erts_free_dist_ext_copy(mp->data.dist_ext);
- mp->data.dist_ext = NULL;
- }
- }
- else {
+
+ /*
+ * We leave not yet decoded distribution messages
+ * as they are in the queue since it is not
+ * possible to determine a maximum size until
+ * actual decoding...
+ */
+ if (is_value(ERL_MESSAGE_TERM(mp))) {
bp = erts_message_to_heap_frag(mp);
if (bp->next)
- erts_move_multi_frags(&factory.hp, factory.off_heap, bp,
+ erts_move_multi_frags(&p->htop, &p->off_heap, bp,
mp->m, ERL_MESSAGE_REF_ARRAY_SZ, 0);
else
- copy_one_frag(&factory.hp, factory.off_heap, bp,
+ copy_one_frag(&p->htop, &p->off_heap, bp,
mp->m, ERL_MESSAGE_REF_ARRAY_SZ);
if (mp->data.attached != ERTS_MSG_COMBINED_HFRAG) {
@@ -2299,8 +2292,6 @@ move_msgq_to_heap(Process *p)
mp = new_mp;
}
}
-
- erts_factory_close(&factory);
}
mpp = &(*mpp)->next;
diff --git a/erts/vsn.mk b/erts/vsn.mk
index acd4509304..d9c441e887 100644
--- a/erts/vsn.mk
+++ b/erts/vsn.mk
@@ -18,7 +18,7 @@
# %CopyrightEnd%
#
-VSN = 8.0.3
+VSN = 8.0.4
# Port number 4365 in 4.2
# Port number 4366 in 4.3