-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Fix assertion failure from #12712 #12742
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
Conversation
…== dom_st->young_trigger
|
(cc @gadmm if you have the time) |
|
Yes I think this is the right thing to do. The intent might have been that if |
gasche
left a comment
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.
Approved on @gadmm's behalf. Thanks both!
|
(I assumed the lack of a Changes entry was intentional, but please do feel free to write one.) |
|
Thanks for the prompt review! I've added a Changes entry. |
kayceesrk
left a comment
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.
The change looks good to me. The reasoning
With the above in mind, AFAICS, the above condition may happen when
- a previous young_ptr allocation just fit perfectly
- young_trigger is set to young_start by caml_poll_gc_work
also makes sense to me.
|
@Octachron - @jmid is continuously testing the released compiler, so there is use in this being back-ported to 5.1.1. May I do that? |
|
Since this is a small assertion fix, ok for backporting to 5.1.1 . |
Fix assertion failure from ocaml#12712 (cherry picked from commit ed3329f)
This little PR fixes the systhreads assertion failure from #12712.
By good old printf-debugging:tm: I found out that the failure happens
on a boundary condition when 4/5 minor heap pointers align:
Multiple reruns confirmed that the condition is the same (the
addresses naturally vary) every time the assertion fails.
Here's my current understanding:
young_ptrbump allocator startingfrom
young_endand working towardsyoung_start.young_triggertypically marks the mid-point between the two,and hitting it triggers a major gc slice.
young_limittoUINTNAT_MAXto notifya domain (irrelevant in the present systhread test with only 1 domain)
With the above in mind, AFAICS, the above condition may happen when
young_ptrallocation just fit perfectlyyoung_triggeris set toyoung_startbycaml_poll_gc_workThis also explains why running with a reduced minor heap
OCAMLRUNPARAM="s=1024"helps to reproduce the failure.The PR simply proposes to adjust the assertion to account for the
boundary condition.
With the fix, the systhread test from #12712 runs fine across 20 iterations.
To confirm it further, I've also locally run