Skip to content
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

Rare crashes on interpreter exit #1144

Open
henzef opened this issue Aug 11, 2023 · 1 comment
Open

Rare crashes on interpreter exit #1144

henzef opened this issue Aug 11, 2023 · 1 comment

Comments

@henzef
Copy link

henzef commented Aug 11, 2023

Hi,
I am using JPype in a pytest context to execute SQL commands on an oracle database via JayDeBeApi. And I am experiencing segfaults of the python interpreter in less than 1% of the cases after the testrun finishes.

I set up a minimal test that just connects to the database and disconnects again with an execution time of ~5 seconds, which allows me to reproduce this bug fairly quickly in a loop.

Unfortunately no python backtrace is printed and the generated coredump does not seem to yield a valid stacktrace, so maybe the bug is related to memory corruption? Note that I can fix/work around it by calling jpype.shutdownJVM() manually, but my understanding was that this should not be necessary, correct?

Is there anything I can do to analyze this issue so this could be fixed properly?

@pelson
Copy link
Contributor

pelson commented Feb 5, 2024

Sounds very similar to #934. It has been a while since I last looked at that issue, and since then #937 has been merged. In principle, I think at least the segfault may be avoidable by setting jpype.config.free_resources = True before exiting. For example, you could do this as a pytest fixture (e.g. with autouse=True).

Perhaps you could try setting that config to see if it resolves the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants