-
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] Deadlock in Dynlink test on Cygwin+MinGW+MSVC #307
Comments
Ah - actually, we do still use flexdll on Cygwin, so I expect this is related. |
Another point of interest, related but maybe involving something else: the Dynlink test on Cygwin can end up abruptly (like a segfault) but reporting no error ( |
We are seeing several Cygwin timeouts during Dynlink, which may well be this bug being triggered
|
Seen again on Cygwin
|
This triggered again on the 0.3 branch for Cygwin trunk part1
|
I've spent some time creating a reproducer for this: libB.ml: let value = 34 repro.ml: let loadfile f =
try Dynlink.loadfile (Dynlink.adapt_filename f)
with Dynlink.Error (Dynlink.Module_already_loaded _) -> ()
let dont_crash () =
let wait = Atomic.make true in
let dom1 = Domain.spawn (fun () ->
while Atomic.get wait do Domain.cpu_relax() done;
loadfile "libB.cmxs") in
let dom2 = Domain.spawn (fun () ->
Atomic.set wait false;
loadfile "libB.cmxs") in
let _ = Domain.join dom1 in
let _ = Domain.join dom2 in
()
let _ =
for i=1 to 1000 do
Printf.printf "%i %!" i;
dont_crash ()
done Makefile:
On MinGW (5.1.0, 5.1.1, 5.2.0~alpha1, trunk) this causes a range of different errors
On MinGW 5.0.0 the errors trigger more rarely (but can still occur). I've found this: ocaml/flexdll#120 which ticks the right boxes, as I believe flexdll is involved on both MinGW and Cygwin (according to David's remark above). |
The weekly 5.1.1 run triggered a
|
FTR, while dusting off #399 for merging, I discovered that the parallel Dynlink issue also affects MSVC - because it also uses FlexDLL under the surface. Here's an example MSVC trunk run (which I got running before bytecode):
|
Deadlock observed in a run on trunk Cygwin:
https://github.com/shym/multicoretests/actions/runs/4367430739/jobs/7638729550#step:21:764
As the code paths are completely different between Cygwin (which provides a
dlopen()
) and Windows (which uses flexdll), this is probably not related to #290.The text was updated successfully, but these errors were encountered: