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 Segfault in OwnedEnv::send_and_clear #291

Merged
merged 1 commit into from
Jan 6, 2020
Merged

Conversation

scrogson
Copy link
Member

This change fixes a segfault we found today. This was the diff that @evnu posted which does indeed fix the segfault.

I built OTP-22.2 with valgrind and ran it before and after, which can be seen here.

@scrogson scrogson requested a review from a team December 11, 2019 05:44
@evnu
Copy link
Member

evnu commented Dec 12, 2019

This looks good to me. We were missing a call to enif_clear_env before here, which is now done. From the documentation:

The message environment msg_env with all its terms (including msg) is invalidated by a successful call to enif_send. The environment is to either be freed with enif_free_env or cleared for reuse with enif_clear_env. An unsuccessful call will leave msg and msg_env still valid.

@hansihe hansihe merged commit 27c2160 into master Jan 6, 2020
@filmor filmor deleted the fix_send_and_clear branch June 6, 2020 22:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants