diff options
author | Sverker Eriksson <[email protected]> | 2017-09-29 19:32:18 +0200 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2017-10-02 17:59:45 +0200 |
commit | 0ee0af9d6114054cb38fce2377678682181b6788 (patch) | |
tree | 0b5f68eb7536bec0a5206143b1294f2ff0240fef | |
parent | 01e5510805ebd8b8cff18ecafadf13dc3af07f47 (diff) | |
download | otp-0ee0af9d6114054cb38fce2377678682181b6788.tar.gz otp-0ee0af9d6114054cb38fce2377678682181b6788.tar.bz2 otp-0ee0af9d6114054cb38fce2377678682181b6788.zip |
erts: Fix bug when detecting bad dist message
We can't just leave it in queue with dist_ext=NULL.
Two symptoms seen:
1. 'receive' trying to deref dist_ext as NULL.
2. GC think it's a term and put THE_NON_VALUE in root set.
-rw-r--r-- | erts/emulator/beam/erl_message.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/erts/emulator/beam/erl_message.c b/erts/emulator/beam/erl_message.c index cdd771ef7d..de9f16d088 100644 --- a/erts/emulator/beam/erl_message.c +++ b/erts/emulator/beam/erl_message.c @@ -564,14 +564,11 @@ erts_msg_attached_data_size_aux(ErtsMessage *msg) sz = erts_decode_dist_ext_size(msg->data.dist_ext); if (sz < 0) { - /* Bad external; remove it */ - if (is_not_nil(ERL_MESSAGE_TOKEN(msg))) { - ErlHeapFragment *heap_frag; - heap_frag = erts_dist_ext_trailer(msg->data.dist_ext); - erts_cleanup_offheap(&heap_frag->off_heap); - } - erts_free_dist_ext_copy(msg->data.dist_ext); - msg->data.dist_ext = NULL; + /* Bad external + * We leave the message intact in this case as it's not worth the trouble + * to make all callers remove it from queue. It will be detected again + * and removed from message queue later anyway. + */ return 0; } |