-
Notifications
You must be signed in to change notification settings - Fork 172
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
Race in worker_loop #994
Comments
After some more checks, I can confirm this bug is the cause of the crash I saw. Here's a gdb session with a coredump from a real crash:
So it was just about to start |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
worker_loop
starts by masking signals, since if a signal occurs in this thread it will crash the process:lwt/src/unix/lwt_unix_stubs.c
Lines 968 to 977 in 90e0d6e
However, there is a slight chance that a signal will occur before this. Here's a test case:
If I add a small delay then it reliably segfaults:
I spotted this while trying to track down some segfaults in my program. I'm not sure if this is the cause of those, as the race looks hard to hit without the delay.
Using
pthread_attr_setsigmask_np
to set an initial mask might fix it.The text was updated successfully, but these errors were encountered: