-
-
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
Regression affecting IJulia #47196
Comments
Can you share the error message that was shown . That you got when launching notebook |
The full error message when creating a new notebook with kernel "Julia 1.9.0-DEV" reads:
When launching jupyter directly via
|
You are likely confusing a regular signal set to start GC collection with a failure. I only see the former, and don't see any failures. I tracked the timeout back to https://github.com/JuliaLang/IJulia.jl/blob/cc2a9bf61a2515596b177339f9a3514de8c38573/src/heartbeat.jl, which now acquires the gc-lock, but then exits Julia code, and thus never gets an opportunity to release it. |
Indeed, with the latest nightly (Version 1.10.0-DEV.41 (2022-11-23), Commit 3200219) the behavior seems to have changed compared to my previous tests: Instead of crashing, Julia now runs at 100% CPU. |
Confirmed!
After regression, commit c63c1e4 2022-10-14:
|
Yes, this is an IJulia bug, where it enters a spin loop because of the foreign heartbeat_thread |
Cross-reference: I have reported this in the IJulia issue tracker in JuliaLang/IJulia.jl#1062. |
Could you elaborate? IJulia's heartbeat code calls Oh, I see your comment above about not releasing the gc lock. How do we release this in order to call a C function that never returns? |
Never returning from c code is disallowed, since the GC will wait forever to be able to access it or spawn work there |
@maleadt was talking about adding that feature a couple months ago, but it is not implemented now. You can try enabling a GC safe region before the ccall though, and it probably won't crash. |
I agree that this is a bit of an odd case, but the GC doesn't need to be involved in the heartbeat thread at all here. How do I enable a GC safe region? |
IIUC: state = ccall(:jl_gc_safe_enter, Int8, ())
# work
ccall(:jl_gc_safe_leave, Cvoid, (Int8,), state) |
Thanks, that seems to work. Closed by JuliaLang/IJulia.jl@30ff84b |
Summary: b7201d6 introduces a regression in IJulia. When trying to start a Julia kernel in a Jupyter notebook, Julia segfaults.
versioninfo()
Both via compiling from source and via downloading a nightly build.
Install IJulia, run
notebook()
and create a new notebook with kernel "Julia 1.9.0-DEV". After a timeout of about 1 minute, an error message "Connection failed" appears. Running everything withstrace
shows that the child Julia process launched by IJulia has segfaulted.The text was updated successfully, but these errors were encountered: