-
Notifications
You must be signed in to change notification settings - Fork 65
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
juliacall 0.9.22 can result in hanging precompilation #537
Comments
Is there a way I can manually trigger the PythonCall GC to run? I wonder if I can debug it (or work around the issue) by manually triggering the GC at different stages? |
Hmm not sure what's going on here. I wonder if it's due to the presence of the immortal
Yep you can do |
That would mean there would be no garbage collection during precompilation, right? Is that desired? I wonder if there’s some infinite loop possible somewhere, where Julia GC calls the finalizer on the GC hook, but the finalizer is called immediately, and this process repeats indefinitely. |
Do any other packages use a similar pattern with a self-regenerating self-terminating GC object? If not, are we sure it’s safe? I’m also curious what happens if one were to call Base.GC.gc(#=full=#true) Would this trigger any sort of infinite loop of finalizers? cc @ericphanson |
One other thing to note is that the infinite precompilation only seems to happen if the program is already running.
This is where the infinite precompilation seems to occur (and only on this specific system and environment). Maybe something about running precompilation a second time triggers it? |
It was just a suggestion to narrow down what's causing the problem. My suggestion shouldn't prevent GC - the GCHook is just there to free any Python objects that were finalized while the GIL was released (e.g. on a different thread). Anyway, it will all be collected when the precompile process ends, so unless you are allocating a lot during precompilation I wouldn't worry.
I don't know and I don't know. I had thought someone commented at some point that this behaviour is documented to work, but I can't find that now so maybe I dreamt it.
I don't think so - I called that function a lot when testing the new GC and didn't observe any hangs.
Maybe, I don't know enough about the mechanics of precompilation to say. |
version 0.9.22 is creating endless loop with linux and macos triggered by:
|
Affects: JuliaCall
Describe the bug
Upgrading to 0.9.22 causes PySR's CI to hang upon precompilation of Zygote.jl on macOS. I haven't been able to reproduce it locally but can confirm that downgrading to 0.9.21 is enough to fix the issue for PySR. So perhaps the new GC is causing some infinite loop somewhere, for some kind of PythonCall object? The error is randomly encountered so it has been hard for me to track down.
Your system
Please provide detailed information about your system:
Here's an example of the test failing, with 0.9.22:
And succeeding, on 0.9.21:
It is random but it has so far this CI seems to always work on 0.9.21 while it fails 75% of the time on 0.9.22. It's also only on macOS for whatever reason.
The text was updated successfully, but these errors were encountered: