Skip to content
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

Fix unsafe optimization of receives #2434

Merged
merged 1 commit into from Oct 31, 2019

Conversation

bjorng
Copy link
Contributor

@bjorng bjorng commented Oct 28, 2019

Fix a problem where a receive marker would be set even if it
was not guaranteed that execution would reach a receive statement.

This optimization bug caused the problem for the socket module
reported here:

http://erlang.org/pipermail/erlang-questions/2019-October/098591.html

https://bugs.erlang.org/browse/ERL-1076

@bjorng bjorng requested a review from jhogberg October 28, 2019 14:16
@bjorng bjorng self-assigned this Oct 28, 2019
@bjorng bjorng added fix team:VM Assigned to OTP team VM labels Oct 28, 2019
@garazdawi
Copy link
Contributor

Should the beam_validator be modified to catch these types of faults?

@bjorng bjorng force-pushed the bjorn/compiler/fix-recv-opt/OTP-16219 branch 2 times, most recently from 2ed53eb to 61bd1d3 Compare October 29, 2019 10:56
Fix a problem where a receive marker would be set even if it
was not guaranteed that execution would reach a receive statement.

See the new test case `receive_SUITE:return_before_receive/1` for
an example where this would cause problems.

https://bugs.erlang.org/browse/ERL-1076
@bjorng bjorng force-pushed the bjorn/compiler/fix-recv-opt/OTP-16219 branch from 61bd1d3 to 784b339 Compare October 29, 2019 15:36
@garazdawi garazdawi mentioned this pull request Oct 29, 2019
@jhogberg jhogberg merged commit 784b339 into erlang:maint Oct 31, 2019
@bjorng bjorng deleted the bjorn/compiler/fix-recv-opt/OTP-16219 branch November 3, 2019 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix team:VM Assigned to OTP team VM
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants