-
Notifications
You must be signed in to change notification settings - Fork 66
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
Segfault in _jl_call_nogil
with jupyter extension or passing pytypes
#542
Comments
is it https://juliapy.github.io/PythonCall.jl/dev/juliacall/#py-multi-threading-signal-handling? Can you include the full segfault text (if it includes a stacktrace etc)? |
No, this happens when Julia is handling its signals. It seems likely it is manipulation of Python while the GIL is released. In the first case, this is probably the IPython extension's handling of stdio. That extension should probably reacquire the GIL for the work it does. In the second case, this is because some python objects are passed wrapped by default, e.g. |
The two issues are sort of the same. As you realised, the second issue is because python I'm quite reluctant to make PythonCall functions/types automatically lock the GIL because there's a runtime cost, but also it would require adding That said, I agree that it is surprising that And certainly the documentation for |
That seems reasonable to me! I took a look at the IPython extension but I couldn't see quite where to put the locking. PS: It's great to see support for threading! Appreciate the work that went into this. |
Affects: JuliaCall
Describe the bug
If I run this in a jupyter notebook
I get a segfault.
It goes away if I disable the extension:
Also I get segfaults if I pass a python type that I would expect to be converted, e.g.
This goes away if I manually convert
Your system
versioninfo()
Pkg.status()
CondaPkg.status()
I don't seem to have condapkgThe text was updated successfully, but these errors were encountered: