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 #11482: random crash in large closure allocation #11542

Merged
merged 1 commit into from
Sep 20, 2022

Conversation

damiendoligez
Copy link
Member

@damiendoligez damiendoligez commented Sep 12, 2022

Note: this is still a draft, I still want to check that it does make the bug disappear.

Fixes #11482

@damiendoligez damiendoligez marked this pull request as ready for review September 15, 2022 09:46
@damiendoligez
Copy link
Member Author

Checked on 5.0.0~alpha0, it does fix the segfault. Now ready for review.

@damiendoligez damiendoligez added this to the 5.0 milestone Sep 15, 2022
@damiendoligez
Copy link
Member Author

Note: will have to move the Changes entry and cherry-pick to 5.0.

Copy link
Contributor

@xavierleroy xavierleroy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a good fix for #11482. Two minor remarks:

  • I'm not super happy about the function name caml_alloc_shr_with_safepoint. Is check_urgent_gc equivalent to the safe points that ocamlopt implements? caml_alloc_shr_check_urgent might be more descriptive. caml_alloc_shr_check would be shorter :-)
  • I wondered about performance. We can probably assume that ocamlopt-generated code rarely allocates directly in the major heap, in which case performance should be OK.

@damiendoligez
Copy link
Member Author

I've renamed the function to caml_alloc_shr_check_gc. About performance, we are not doing more checks that before, but we're removing the double initialization, so this is a strict improvement.

Copy link
Contributor

@xavierleroy xavierleroy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thanks. Could you please move the Changes entry to 5.0, merge in trunk, and cherry-pick -x in 5.0 ? Thanks.

@damiendoligez damiendoligez merged commit 147be67 into ocaml:trunk Sep 20, 2022
damiendoligez added a commit that referenced this pull request Sep 20, 2022
@damiendoligez
Copy link
Member Author

damiendoligez commented Sep 20, 2022

Cherry-picked to 5.0 (as 43754a5). Thanks for the review.

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.

Segmentation fault linked to a big closure allocation with OCaml 5.0
2 participants