aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/test/inline_SUITE.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2018-04-04 06:46:10 +0200
committerBjörn Gustavsson <[email protected]>2018-04-06 13:06:52 +0200
commit90853d8e7b50be13a3b71f4a1ed6b0407e1f7c2f (patch)
treeccd63569a72f6e16c9cbf678cbea72d084d5917d /lib/compiler/test/inline_SUITE.erl
parent1328163db6d64d4a8309306cd4caeb43ffd5ecbb (diff)
downloadotp-90853d8e7b50be13a3b71f4a1ed6b0407e1f7c2f.tar.gz
otp-90853d8e7b50be13a3b71f4a1ed6b0407e1f7c2f.tar.bz2
otp-90853d8e7b50be13a3b71f4a1ed6b0407e1f7c2f.zip
Check that messages outside of the heap are not corrupted
Waiting messages for a process may be stored in a queue outside of any heap or heap fragment belonging to the process. This is an optimization added in a recent major release to avoid garbage collection messages again and again if there is a long message queue. Until such message has been matched and accepted by the remove_message/0 instruction, the message must not be included in the root set for a garbage collection, as that would corrupt the message. The loop_rec/2 instruction explicitly turns off garbage collection of the process as long messages are being matched. However, if the compiler were to put references to a message outside of the heap in an Y register (on the stack) and there happened to be a GC when the process had been scheduled out, the message would be corrupted and the runtime system would crash sooner or later. To ensure that doesn't happen, teach beam_validator to check for references on the stack to messages outside of the heap.
Diffstat (limited to 'lib/compiler/test/inline_SUITE.erl')
0 files changed, 0 insertions, 0 deletions