-
Notifications
You must be signed in to change notification settings - Fork 151
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
Sometimes got error SIGSEGV when using numpy #341
Comments
Does the hs_err_pid list what library it crashed in? libjvm.so or something else? And what JRE are you using? |
In hs_err_pid it shows the following which I think is your want:
|
The crash is in the multiarray library, which is part of numpy. I see you're already using SharedInterpreter which is the best advice I can give you for using numpy with Jep. Unfortunately numpy wasn't written with sub-interpreters in mind and may not work correctly even when using SharedInterpreter. There's not really much Jep can do about this. If you're going to try and solve it, I would try to narrow down what lines of Python are causing the crash and see if you can crash it with a normal CPython interpreter (not Jep). |
On a project I work on, we encountered a crash in the same place, I don't know that this is directly related to the original problem since the original problem on this Issue is using SharedInterpreters. But if there was a mix of SubInterpreters also in the same process, then maybe something like this happened. Regardless, I felt I should document it in case others encounter something similar. The key to figuring it out on this particular software system was the numpy warning/disclaimer when importing numpy in a sub-interpreter:
If you're using shared modules with your Jep SubInterpreters, then that warning should not appear. For Jep, we should somehow improve how we detect and initialize numpy to try and avoid this in the future. |
Sometimes the code runs OK, but sometimes got the following errors and the program stoped:
*** Aborted at 1627296117 (unix time) try "date -d @1627296117" if you are using GNU date ***
PC: @ 0x0 (unknown)
*** SIGSEGV (@0x2b77d8087e00) received by PID 15991 (TID 0x2b78aa92c700) from PID 18446744073039019520; stack trace: ***
@ 0x2b77d87dd6d0 (unknown)
@ 0x2b77d9cf8b6b ciBytecodeStream::get_method()
@ 0x2b77d9c263e3 GraphBuilder::invoke()
@ 0x2b77d9c22ebf GraphBuilder::iterate_bytecodes_for_block()
@ 0x2b77d9c2487f GraphBuilder::iterate_all_blocks()
@ 0x2b77d9c24e0a GraphBuilder::GraphBuilder()
@ 0x2b77d9c2ab6a IRScope::IRScope()
@ 0x2b77d9c2b6f9 IR::IR()
@ 0x2b77d9c0d277 Compilation::build_hir()
@ 0x2b77d9c0f3f0 Compilation::compile_java_method()
@ 0x2b77d9c0f59a Compilation::compile_method()
@ 0x2b77d9c0fa10 Compilation::Compilation()
@ 0x2b77d9c10198 Compiler::compile_method()
@ 0x2b77d9d6cc9c CompileBroker::invoke_compiler_on_method()
@ 0x2b77d9d6e8d8 CompileBroker::compiler_thread_loop()
@ 0x2b77da366bbb JavaThread::thread_main_inner()
@ 0x2b77da366ec1 JavaThread::run()
@ 0x2b77da1f5132 java_start()
@ 0x2b77d87d5e25 start_thread
@ 0x2b77d8f04bad __clone
@ 0x0 (unknown)
*** Aborted at 1627350873 (unix time) try "date -d @1627350873" if you are using GNU date ***
PC: @ 0x0 (unknown)
*** SIGSEGV (@0x2ad282005080) received by PID 31929 (TID 0x2ad342335700) from PID 18446744071595643008; stack trace: ***
@ 0x2ad2826546d0 (unknown)
@ 0x2ad28402b333 Monitor::wait()
@ 0x2ad283bdcab2 CompileQueue::get()
@ 0x2ad283be538b CompileBroker::compiler_thread_loop()
@ 0x2ad2841ddbbb JavaThread::thread_main_inner()
@ 0x2ad2841ddec1 JavaThread::run()
@ 0x2ad28406c132 java_start()
@ 0x2ad28264ce25 start_thread
@ 0x2ad282d7bbad __clone
@ 0x0 (unknown)
The text was updated successfully, but these errors were encountered: