-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
sleep(n) sometimes segfaults in a threaded loop #32152
Comments
Only output is permitted on threads or threaded regions, no other I/O operation should be attempted. |
Once the release is final, it would be good to document what is allowed in threaded sections. |
To many programmers, For the sake of completeness here, in Julia, While it's clear that the Two questions:
|
We just need to fix it. |
It would be nice if we can allow I/O to be called from threads, even if that I/O is actually executed by the main thread or libuv. |
@kmsquire Yes, libc The |
There is going to be a long tail of operations that are not threadsafe. The plan is to fix them all, not document that they are broken, so in general, there will be no rule to remember which things are safe or not safe, instead people should just file issues when they find anything that isn't threadsafe. |
I'm poking around at this problem to see if I can fix it. I have a question about the following stacktrace:
It seems like the segfault occurs strictly within libuv itself (although this is invoked from |
No I don't think this implies that libuv itself needs to be modified. My guess is that its internal data structures are corrupted here due to access from multiple threads. That is what |
When the following code is run with JULIA_NUM_THREADS=4, occasionally (about every 3 runs) I get a segfault on the second threaded loop invocation. I can't reproduce this with JULIA_NUM_THREADS=1.
MWE:
Occasional segfault message:
EDIT: Corrected versioninfo():
@JeffBezanson
The text was updated successfully, but these errors were encountered: