-
Notifications
You must be signed in to change notification settings - Fork 15
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
Busy loop on profiling external Cmd's #16
Comments
Sorry for the delay, I had no laptop or internet for several days. I can indeed replicate this, although it's intermittent: once I got it to run through fine. A simple workaround is to increase the delay, e.g., It's hanging at the A gist to facilitate debugging is here: https://gist.github.com/timholy/5782437. I can trigger with
If there's no other way, this can presumably be fixed by disabling the profiling timer upon entry into the C function |
As a very minor update, it's not dependent upon console output: When one of these works, you get a successful profile out of it (lots of samples inside |
Thanks for the workaround, sadly I know even less of Julia internals so I'm not of much help here. |
Jameson, thanks very much for looking into this! I see that your fix is in the |
The julia0.3 branch is the current head for julia. We just need to update the sha1 in the julia repository. Note that it seems to me that you in fact found a linux kernel bug -- it appears that the linux scheduler refuses to run any more code after returning from the clone syscall as part of the libc call to fork. (The exact mechanism of this failure is not apparent to me -- whether it is the SIGUSR1 interruption, or the timer & alarm reset and disable that is supposed to occur.) |
Wow. Should I report this somewhere? I'd need a simple testcase (may have to bug you for pointers). Or if it's just too complicated we can work around it... |
The trick would be in building a simple testcase -- might be enough to just setup a timer as you do here, call fork() then exit(). The patch to libuv also just works around it by disabling all signals upon entry to and re-enabling them upon exit from uv_spawn(), this is probably a good idea anyways for making spawn robust against signals. |
Alright, let's just use the workaround, and if I'm feeling ambitious I'll make a weekend project out of the kernel bug report. (I'm sure they'll want me to test on the current kernel, etc.) |
@vtjnash, your fix has now been merged and works great for me. Thanks again! |
(cherry picked from commit 6c86f09)
(cherry picked from commit 6c86f09)
(cherry picked from commit 6c86f09)
(cherry picked from commit 6c86f09)
(cherry picked from commit 6c86f09)
(cherry picked from commit 6c86f09)
(cherry picked from commit dd01730)
(cherry picked from commit dd01730)
(cherry picked from commit dd01730)
(cherry picked from commit dd01730)
Where the last line hangs at 100% CPU for (at least) several minutes on my Ubuntu 13.04 system running a recent version of Julia 0.2-.
Thanks!
The text was updated successfully, but these errors were encountered: