-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
erts: Fix fragmented send to finish before exiting #5892
erts: Fix fragmented send to finish before exiting #5892
Conversation
CT Test Results 3 files 125 suites 38m 20s ⏱️ Results for commit 6f974a8. ♻️ This comment has been updated with latest results. To speed up review, make sure that you have read Contributing to Erlang/OTP and that all checks pass. See the TESTING and DEVELOPMENT HowTo guides for details about how to run test locally. Artifacts// Erlang/OTP Github Action Bot |
Confirming that this PR fixed the binary leak we had in production: #5876 (comment) |
erts/emulator/beam/erl_process.c
Outdated
@@ -13897,6 +13900,9 @@ erts_continue_exit_process(Process *p) | |||
/* notify free */ | |||
erts_atomic32_read_bor_relb(&p->state, ERTS_PSFLG_FREE); | |||
|
|||
/* clear suspend count */ | |||
p->rcount = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Turns out that doing this is not always safe, so need to implement another way to deal with the suspend count.
The test case needs more work, but I think I'm happy with this solution. |
9e0873b
to
afcbdf7
Compare
Fixed the test case to test what it should test. |
If a process is suspended doing a fragmented send and then receives an exit signal it was terminated before it could finish sending the message leading to a memory leak on the receiving side. This change fixes that so that the message is allowed to finish being sent before the process exits. Closes erlang#5876
97a9c2f
to
dc7cf3b
Compare
The total block size can be > 2 GB, so the ASSERT would trigger on working code. So we only check the blocks size on 64-bit systems.
…to lukas/23/erts/fix-dist-fragment-exit-leak/OTP-18077
…to lukas/24/erts/fix-dist-fragment-exit-leak/OTP-18077
…to lukas/25/erts/fix-dist-fragment-exit-leak/OTP-18077
c4525a9
to
6f974a8
Compare
Fix merged to master. It will also be part of the next patches to all currently supported releases. |
If a process is suspended while doing a fragmented send and then receives an exit signal it was terminated before it could
finish sending the message leading to a memory leak on the receiving side.
This change fixes so that the message is allowed to finish being sent before the process exits.
Closes #5876