-
Notifications
You must be signed in to change notification settings - Fork 16
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
[ocaml5-issue] dummy found!
in Lin Dynarray stress test with Domain
on musl trunk
#528
Comments
It shouldn’t be, and yet it seems that it is. I guess my next move, if I wanted to track this, would be to modify the test to return a Cc-ing @gasche who might be interested to know. |
It looks like you found a bug in the implementation indeed. What is the set of operations that are used in this test? Slightly more information: there is a dynamic check in the Dynarray implementation that should ensures that we fail with an exception instead of ever returning a dummy value. Here this check does not suffice to guarantee this property. Different dynarrays may have different dummy values (but only marshalling creates distinct dummies, and I suppose you don't exercise it?), and it may be the case that an implementation bug causes two different dummies to be mixed up in the same backing array, which would result in the dynamic check being incomplete. For example, the implementation of |
I suppose that the operations being exercised are the ones listed in multicoretests/src/dynarray/lin_tests.ml Lines 17 to 32 in 05a5ac9
I see in particular that |
Thanks for the feedback both! 🙏
The test just exercises the operations you list above. Indeed neither I'll see if I can create a reproducer. A few quick local experiments however indicate that this is a rare, hard-to reproduce one, which also explain why it hasn't shown up before. Further note, that it showed up on a |
dummy found!
in Lin Dynarray stress test with Domain
on musl trunkdummy found!
in Lin Dynarray stress test with Domain
on musl trunk
I am also trying at the moment; working with a modified version of |
We can leave out the "multiple-t"-accepting functions from the Dynarray API, as only the ones tested by Lin were enough to trigger the bug. Perhaps also double check that the distributions (say for int, etc.) on the Lin and STM tests agree, to avoid one generating, e.g., 0-100 and the other ints uniformly. |
I am now trying to reproduce by running https://github.com/OlivierNicole/multicoretests/blob/8bd670363da181d8c81bed0a0dff93e3622f9d95/src/dynarray/stm_tests.ml, but no luck so far. |
Update: I have been running it in a loop for about 3 days now during the day, without being able to reproduce. The trunk commit being exercised is ocaml/ocaml@b5420186c7. Either the bug is extremely unlikely to happen, or there is an error in my test, or the problem is specific to an earlier version of the compiler or to the CI machine. |
Thanks for the update! Some thoughts:
Finally, we can't rule out that this is not due to a Dynarray error but to something else. |
Oh wow - it triggered 5/100 on 5.3 and 6/100 on |
On #521 the musl trunk workflow triggered a
dummy found!
error exiting theLin Dynarray
stress test:https://github.com/ocaml-multicore/multicoretests/actions/runs/12846368030/job/35821476446?pr=521
This is caused by these lines implementing a
get
instrumented with a tag check:multicoretests/src/dynarray/lin_tests.ml
Lines 11 to 13 in a166b24
IIUC, this means the test is observing a non-int dummy value from the unboxed implementation from ocaml/ocaml#12885.
A code comment in stdlib/dynarray.ml reads:
At the same time, the module is documented to be unsafe for parallel usage:
Can we conclude that parallel usage may be type unsafe? Ping @OlivierNicole: WDYT? 🤔
The text was updated successfully, but these errors were encountered: