|Anonymous | Login | Signup for a new account||2019-02-22 22:18 CET|
|Main | My View | View Issues | Change Log | Roadmap|
|View Issue Details|
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0006771||OCaml||platform support (windows, cross-compilation, etc)||public||2015-02-04 17:48||2017-02-16 15:18|
|Target Version||4.03.0+dev / +beta1||Fixed in Version||4.03.0+dev / +beta1|
|Summary||0006771: Thread lock up|
|Description||Especially on windows (but also on Linux) it seems that:|
- at least 2 threads blocked on a read (at least 3 on linux)
- some data is finally available on one of their fd, but no thread is woken up
|Steps To Reproduce||Test case in attachment. It is a stripped down Coq, sorry for the not exactly clean and readable code.|
"server" spawns "client mitm" that in turn spawns "client".
The MITM runs two threads talking with server and client respectively.
The two threads communicate via a queue protected with a mutex and a condition.
On Linux things mostly work here, and rarely hang (and only if I add to the picture more threads). On my Windows 7 virtual machine the test case hangs systematically.
|Additional Information||This bug affects Coq 8.5beta1 (where a huge hack works around it).|
|Tags||No tags attached.|
|Attached Files|| bug.zip [^] (13,294 bytes) 2015-02-04 17:48|
bug-workaround.diff [^] (1,302 bytes) 2015-05-14 02:42 [Show Content]
|Could you please provide a test case that hangs on Linux?|
|I'm pretty sure I've seen that hang on linux too, but I can't reproduce it now by adding more "bouncers" to the code I've attached.|
edited on: 2015-02-05 11:46
If it only hangs on windows, could this be related to 0005325?
Could be, on Windows we use sockets (the code I've attached can do with pipes too but on Windows we go for sockets). From the bug report you link it is
a bit unclear to me which OCaml version I could test in order to see it it solves the bug (on Win).
But I'm sure I've seen it hang on Linux too, even if today I cannot reproduce
it by playing with the small example I've attached.
|Damien is going to see if he can reproduce this on Windows.|
|Can't reproduce with the Cygwin version of OCaml. Will try with MSVC and Mingw.|
|Reproduced with MSVC.|
|Sorry for not being clear from the very beginning, I've been using the ocaml installer for windows available here: http://protz.github.io/ocaml-installer/ [^]|
I'm pretty sure this is a duplicate of 0005325: you have one thread blocked on read on a socket, and another thread tries to write, and blocks.
In your case, there is an easy workaround: use two sockets instead of one (see attached diff, which fixes the problem on your test case).
This bug won't be fixed before 4.02.2.
|See proposed fix https://github.com/ocaml/ocaml/pull/331 [^] Re-test most welcome.|
|Fix committed to trunk, will be in 4.03. Re-test most welcome.|
|I confirm that the attached example does not hang with trunk (tested with the MSVC 32 port).|
|Thanks a million for the re-test. We're making progress!|
|2015-02-04 17:48||enrico||New Issue|
|2015-02-04 17:48||enrico||File Added: bug.zip|
|2015-02-05 08:23||shinwell||Note Added: 0013226|
|2015-02-05 10:18||enrico||Note Added: 0013228|
|2015-02-05 11:46||dim||Note Added: 0013231|
|2015-02-05 11:46||dim||Note Edited: 0013231||View Revisions|
|2015-02-05 13:04||enrico||Note Added: 0013235|
|2015-02-09 17:59||doligez||Priority||normal => high|
|2015-02-09 17:59||doligez||Status||new => acknowledged|
|2015-02-09 17:59||doligez||Target Version||=> 4.02.2+dev / +rc1|
|2015-05-06 21:47||shinwell||Note Added: 0013850|
|2015-05-06 21:47||shinwell||Assigned To||=> doligez|
|2015-05-06 21:47||shinwell||Status||acknowledged => assigned|
|2015-05-12 17:35||doligez||Note Added: 0013908|
|2015-05-13 16:54||doligez||Note Added: 0013920|
|2015-05-13 18:11||enrico||Note Added: 0013921|
|2015-05-14 02:42||doligez||File Added: bug-workaround.diff|
|2015-05-14 02:43||doligez||Note Added: 0013926|
|2015-05-14 02:43||doligez||Category||OCaml runtime system => OCaml windows|
|2015-05-14 02:43||doligez||Target Version||4.02.2+dev / +rc1 => 4.02.3+dev|
|2015-05-14 02:43||doligez||Relationship added||duplicate of 0005325|
|2015-07-10 17:35||doligez||Target Version||4.02.3+dev => 4.03.0+dev / +beta1|
|2015-11-29 15:05||xleroy||Relationship added||related to 0004466|
|2015-12-04 15:01||xleroy||Note Added: 0015033|
|2015-12-09 15:47||xleroy||Note Added: 0015083|
|2015-12-09 16:15||frisch||Note Added: 0015090|
|2015-12-09 16:15||frisch||Status||assigned => resolved|
|2015-12-09 16:15||frisch||Fixed in Version||=> 4.03.0+dev / +beta1|
|2015-12-09 16:15||frisch||Resolution||open => fixed|
|2015-12-09 16:15||frisch||Assigned To||doligez => xleroy|
|2015-12-09 18:15||xleroy||Note Added: 0015097|
|2017-02-16 15:18||xleroy||Status||resolved => closed|
|2017-02-23 16:46||doligez||Category||OCaml windows => platform support (windows, etc)|
|2017-02-23 17:16||doligez||Category||platform support (windows, etc) => platform support (windows, cross-compilation, etc)|
|Copyright © 2000 - 2011 MantisBT Group|