Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upMultithreaded fork appears flaky on OSX #14232
Comments
alexcrichton
added
A-runtime
labels
May 15, 2014
This comment has been minimized.
This comment has been minimized.
|
It should really just use |
thestinger
referenced this issue
Sep 28, 2014
Closed
Implement inheriting more than 3 file descriptors for UNIX Commands #17605
This comment has been minimized.
This comment has been minimized.
|
@alexcrichton with the runtime changes, is this still relevant? |
This comment has been minimized.
This comment has been minimized.
|
Unfortunately, yes. |
This comment has been minimized.
This comment has been minimized.
|
I... don't think there's anything we can do about this, so I think it's just something we're going to have to live with unfortunately. |
alexcrichton
closed this
Mar 5, 2015
This comment has been minimized.
This comment has been minimized.
|
Intentionally providing broken functionality rather than using |
This comment has been minimized.
This comment has been minimized.
|
I'm uncomfortable just closing this outright without some further discussion; I'm going to re-open as needs-decision. |
aturon
reopened this
Mar 5, 2015
This comment has been minimized.
This comment has been minimized.
|
triage: P-backcompat-libs (1.0 beta) |
rust-highfive
added
the
P-backcompat-libs
label
Mar 5, 2015
rust-highfive
added this to the 1.0 beta milestone
Mar 5, 2015
This comment has been minimized.
This comment has been minimized.
|
triage: P-backcompat-libs (1.0) |
rust-highfive
added
P-backcompat-libs
and removed
P-backcompat-libs
labels
Mar 24, 2015
rust-highfive
modified the milestones:
1.0,
1.0 beta
Mar 24, 2015
This comment has been minimized.
This comment has been minimized.
|
nominating for discussion at next week's triage. |
pnkfelix
assigned
alexcrichton
Apr 2, 2015
pnkfelix
added
the
I-nominated
label
Apr 2, 2015
alexcrichton
removed this from the 1.0 milestone
Apr 2, 2015
alexcrichton
removed
the
A-runtime
label
Apr 9, 2015
This comment has been minimized.
This comment has been minimized.
|
There are many open questions here, and many ways that we might try to resolve or at least work around this in future versions of the stdlib. One fundamental issue is that there are some usage patterns supported by separated We should however:
The former bullet need not happen for 1.0, but the latter bullet definitely should happen for 1.0. |
This comment has been minimized.
This comment has been minimized.
|
(In particular, |
This comment has been minimized.
This comment has been minimized.
|
assigning to @aturon to follow through on the 1.0 parts. |
pnkfelix
assigned
aturon
and unassigned
alexcrichton
Apr 9, 2015
pnkfelix
added this to the 1.0 milestone
Apr 9, 2015
pnkfelix
removed
the
I-nominated
label
Apr 9, 2015
This comment has been minimized.
This comment has been minimized.
|
FWIW: I modified the test program to call |
This comment has been minimized.
This comment has been minimized.
|
@rprichard fascinating! I have also been able to reproduce that, but I haven't gotten the assertion to trigger yet, it just deadlocks when the child doesn't receive the signal. I'm getting more and more suspicious of this over time... |
brson
removed this from the 1.0 milestone
Apr 24, 2015
brson
added
P-medium
and removed
P-backcompat-libs
labels
Apr 24, 2015
This comment has been minimized.
This comment has been minimized.
|
Hopefully this is a bug that can be fixed in the fullness of time, because the API is not changing now. |
This comment has been minimized.
This comment has been minimized.
|
In the notes from triage, I noted that this should happen for 1.0:
Has this documentation actually happened? Should we open a separate issue? |
This comment has been minimized.
This comment has been minimized.
|
The documentation has not changed yet, but it's not something I'd want to block the release on, so I'm not sure a new bug is worth it (it would still be nice to do though) |
This comment has been minimized.
This comment has been minimized.
|
I can reproduce the gist of @rprichard's results on an iMac13,2 ("27-inch, Late 2012") running 10.10.3: if I replace main with Also, if I replace the Looking at the xnu kernel source for If I add a 1-millisecond sleep in the parent, the original version of the program (threads and Can we rename this issue to be something more like "signals immediately after process creation are racy on OS X", since it's not strictly related to multiple threads? I think the problem only appears worse there because more cores are used, which exercises races in the kernel more.... |
This comment has been minimized.
This comment has been minimized.
|
Wow, thanks for the thorough investigation @geofft! I think at this point it's pretty clear that there's not a whole lot we can do about this (if it's a kernel bug of some form), beyond your sleeping suggestion, but unfortunately even that wouldn't be rock-solid. I'm going to nominate this bug for closure at this point, however, as the prospects for solving it seem to be getting bleaker every day. |
alexcrichton
added
the
I-nominated
label
May 15, 2015
This comment has been minimized.
This comment has been minimized.
|
This concern of mine (from an earlier comment) has not yet been addressed, AFAICT:
I would argue against closing this until that's addressed. |
This comment has been minimized.
This comment has been minimized.
|
The thinking earlier in the thread was that this could be resolved by switching to a more reliable OS X API, but as far as I can tell, no such API exists: this is a fundamental bug in how OS X signal delivery works, regardless of whether you're using We should probably report this to Apple, though. I could do that. |
This comment has been minimized.
This comment has been minimized.
|
I'm curious why a bug that supposedly only occurs when a new process is killed near-instantly after starting up is showing up as an issue in practice (e.g. on the bots) - why are you starting a process if you don't want it to do anything? Anyway, if it's a child process, a |
alexcrichton
added
T-libs
A-docs
and removed
I-nominated
labels
Jun 9, 2015
alexcrichton
added a commit
to alexcrichton/rust
that referenced
this issue
Aug 4, 2015
alexcrichton
added a commit
to alexcrichton/rust
that referenced
this issue
Aug 4, 2015
This comment has been minimized.
This comment has been minimized.
|
Can someone help me out with what exactly needs to be documented here, and what our plans are? It's been a long time since the discussion happened, and I don't want something incorrect. |
This comment has been minimized.
This comment has been minimized.
|
OK, I'm going to close this in favor of #27537. With @geofft's investigation it's becoming clearer that there's basically not much we can do here, so the "documentation bug" should just be documenting what we're doing. I don't really want to add a clause to As a result, this is basically not-a-bug and documentation is covered by #27537 |
alexcrichton commentedMay 15, 2014
In the following program, a number of threads are made, and then each thread forks of a child that sleeps forever and then immediately kills it. I would expect this program to succeed continuously, but it wedges on OSX occasionally, reporting a successful signal delivery, but failing to actually deliver the signal apparently.
This is essentially how we fork() in libnative, and it's how we're using fork from libgreen. Trying to investigate a solution to this, but I'm starting to think that multithreaded fork is just fundamentally broken on basically all platforms except linux.
This issue has appeared as various forms of flakiness on the bots, which is why I started investigating.