-
Notifications
You must be signed in to change notification settings - Fork 37
Fatal error when stopping python session #70
Comments
I've observed the same thing and looked into it a bit. Not sure if it's an issue or not...quite possibly is...but Py_Finalize is pretty finicky with Python native extensions according to the Python docs: Py_Finalize. Looking at some other StackOverflow questions about seg faults from calling it, I'm not sure there's an easy solution other than to not call it. Plus, it could have different behavior on *nix vs. Windows based on using the Python shared library as well. Sorry if this doesn't help answer the question, but I think it might help people understand the reason it seg faults (and possibly why it appears commented out in the current tests). |
Thanks for this. I hope to find some time soon for debugging into it. Does it happen on Windows too? |
It seems to be platform independent. The good news is I think I've found a very simple resolution for the segfault: call I have Test classes will run and pass individually, but grouping certain tests together in the same run causes some specific tests to fail. An example from running:
...
Any ideas? I'll continue to poke around and if I get things working I'll submit a PR. |
Thanks so much. Looking forward for your PR. What exactly have you changed? We'll try to reproduce the (new) problem here! |
I looked at it some more yesterday and my guess is that by adding I've tried changing the test setup logic around, too, with no effect. Same errors when doing |
Now, I remember having the same issue at that time. I should have documented it. There is an issue with restarting the Python interpreter and then stopping it. The suggestion is then, not to restart the Python interpreter in your Java programs that use jpy. I'll mention this in the jpy Java API docs. |
Just submitted a PR containing what I believe to be a fix. This should let us start and stop the interpreter from Java without segfaults killing the JVM. |
Hi,
using latest (0.9) jpy version, I experienced an issue when stopping a python session from java.
With such trivial main file:
I get a fatal error when I call stopPython():
Is it a know issue?
The text was updated successfully, but these errors were encountered: