-
Notifications
You must be signed in to change notification settings - Fork 81
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
Check_foo functions are not mpsafe due to concurrent Format access #375
Comments
As far as I know:
So I'm not sure what kind of "fix" |
I might be off, leme isolate this better before bothering you again.
…On Wed, Mar 8, 2023, 10:19 Daniel Bünzli ***@***.***> wrote:
As far as I know:
1. no Queue is being used by Fmt
2. Formatters are not thread safe anyways.
So I'm not sure what kind of "fix" Fmt should implement.
—
Reply to this email directly, view it on GitHub
<#375 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABR2EA5O2ZBPECENMEYH5TW3BFKVANCNFSM6AAAAAAVTQAPZI>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
|
Indeed, I now had time to get a proper stack trace, apologies for hinting at Fmt, here it is:
reproduces with: let alcotest_multicore () =
let rec loop c () =
check_int c 0 0;
Domain.cpu_relax ();
loop c ()
in
let b = Domain.spawn (loop "b") in
loop "a" () |> ignore;
Domain.join b |
I'll see who to fix this in alcotest, I imagine we could have a DLS for it and should be good enough. |
Problem appears to be this: |
Fixed by #399, It is possible now to specify at the beginning a new allocated formatter that tests don't use - and by this way, fix a race between default formatters (like |
If you run check tests in multiple domains things will crash. Alcotest uses Fmt, which in turn uses a Queue somewhere that is manipulated at each
check_foo
call, since this Queue is not protected, it ends up getting corrupted and we get a Queue.Empty exception.Just running two Domains in parallel and a
check_int "foo" 0 0
in a loop is enough to reproduce.I'll investigate better in the afternoon and maybe come up with a fix, I'm ccing @dbuenzli as he might be interested in making Fmt mpsafe, if not we'll fix it here only.
tldr: We can't really use alcotest for multicore tests reliably until we sort this.
The text was updated successfully, but these errors were encountered: