diff options
author | Lukas Larsson <[email protected]> | 2018-06-20 10:42:20 +0200 |
---|---|---|
committer | Lukas Larsson <[email protected]> | 2018-08-03 09:47:51 +0200 |
commit | d383549b6e9d9b5e06f23226a61564264204db51 (patch) | |
tree | 938462b708ac6442bb0dda7b99815505503a4d2a /erts/emulator/beam/beam_bif_load.c | |
parent | c33d4c7539a1681cfbc024d8637e204c0a05fd1a (diff) | |
download | otp-d383549b6e9d9b5e06f23226a61564264204db51.tar.gz otp-d383549b6e9d9b5e06f23226a61564264204db51.tar.bz2 otp-d383549b6e9d9b5e06f23226a61564264204db51.zip |
erts: Fix seq_trace to not clear token for system messages
A lot of erts internal messages used behind APIs to create
non-blocking calls, e.g. port_command, would cause the seq_trace
token to be cleared from the caller when it should not.
This commit fixes that and adds asserts that makes sure
that all messages sent have to correct token set.
Fixes: ERL-602
Diffstat (limited to 'erts/emulator/beam/beam_bif_load.c')
-rw-r--r-- | erts/emulator/beam/beam_bif_load.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/erts/emulator/beam/beam_bif_load.c b/erts/emulator/beam/beam_bif_load.c index a0dbd9ec7b..d221e6aea6 100644 --- a/erts/emulator/beam/beam_bif_load.c +++ b/erts/emulator/beam/beam_bif_load.c @@ -1753,6 +1753,7 @@ BIF_RETTYPE erts_internal_purge_module_2(BIF_ALIST_2) if (literals) { ErtsLiteralAreaRef *ref; + ErtsMessage *mp; ref = erts_alloc(ERTS_ALC_T_LITERAL_REF, sizeof(ErtsLiteralAreaRef)); ref->literal_area = literals; @@ -1767,10 +1768,12 @@ BIF_RETTYPE erts_internal_purge_module_2(BIF_ALIST_2) release_literal_areas.last = ref; } erts_mtx_unlock(&release_literal_areas.mtx); + mp = erts_alloc_message(0, NULL); + ERL_MESSAGE_TOKEN(mp) = am_undefined; erts_queue_proc_message(BIF_P, erts_literal_area_collector, 0, - erts_alloc_message(0, NULL), + mp, am_copy_literals); } |