Comments (4)
Actually, I can reproduce this particular error pretty well if I interrupt the same function in the same way. Let me know if you need/want a more specific test case, and I'll see what I can come up with.
from pycall.jl.
I think the problem is that the ccall
to Python is not atomic (with respect to interrupts). If you interrupt in the middle of a Python C API call, Python itself could be left in an inconsistent state, leading to a crash on subsequent call.
Unfortunately, there doesn't seem to be any way to do an atomic ccall
right now in Julia. (It seems like a new sigatomic_ccall
would need to be added, which performs a ccall
within the JL_SIGATOMIC_BEGIN
and JL_SIGATOMIC_END
macros in julia.h
.) Or am I missing something in Julia API?
@JeffBezanson, can you comment?
from pycall.jl.
Yes, that would probably fix it. We should probably also expose @sigatomic begin ... end
in the language.
from pycall.jl.
There are additional subtleties in really doing this right. Python would prefer to have its own SIGINT
handler that raises a KeyboardInterrupt
exception in the Python code. And then if Python calls a Julia callback routine, the callback should catch SIGINT
in the Julia way. So, one would really like to push and pop different signal handlers at every Julia/Python boundary. Urgh.
from pycall.jl.
Related Issues (20)
- pytype_mapping confusion
- Building PyCall Offline with Mamba HOT 4
- Convert memory address to Python pointer HOT 3
- notable startup latency HOT 3
- How to detect if Python object is class/function/property
- Incompatible with PythonCall.jl HOT 1
- Pkg.build("PyCall"), json.decoder.JSONDecodeError: Extra data
- ERROR: LoadError: syntax: invalid interpolation syntax: "$\"
- the ENV["PYTHON"]="path/to/python.exe" not work for python3.12.0 HOT 4
- LoadError: Couldn't find libpython while building PyCall HOT 5
- PyCall 1.96.2 breaks tests at Imbalance.jl HOT 5
- Error on building 'PyCall' argument not expected: --satisfied-skip-solve HOT 1
- buildutils.jl broken on Python 3.12 HOT 1
- Remove support for Python <=3.7
- Reproducible garbage collection-related segfaults on Python 3.12 HOT 3
- How can I use rospy through PyCall directly? HOT 1
- julia-1.10.0 _Py_DECREF segmentation faults (not present in 1.9.3)
- `Segmentation fault(core dumped)` when using multiple threads
- REPL crashes when importing pyvista objects
- Howto - Python yield statement HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pycall.jl.