-
Notifications
You must be signed in to change notification settings - Fork 181
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
Handle assertions during JVM startup #1170
Comments
At best I can make some guess. It must be some change in the jvm_path or the dll that is located at the point. Perhaps it something in the script is now doing mixed architectures (32 vs 64). I would try to break down each step from the one which works to the one that doesn’t.
Alternatively it may be something that the JVM is loading indirectly like something in the resources path. Look for anything in those paths that changed in the time. Were it my site, where the system admin runs nightly “security patches”, I would assume that the admin pulled the rug out from me by changing the jdk or libraries.
Beyond these general tips I don’t think JPype devels can be much help as it is clearly a site install issue.
|
Thanks a lot for your help !
Did you already see something similar ? |
No. Though it is not very surprising that “-ea” would cause a problem. That enables assertions so that means something either in JPype, Java, or the jars loaded has an assert statement which is failing. Not sure how to find the failed assertion unless we can get some logs.
Can you try using the gdb instructions to capture a log of the failure? Either the traceback log or the crash dump from the JVM should show you the code that made the assert.
|
Looking at the documentation it appears that the assertion is sending up an exception. If it happens while the JVM is still getting going, then most likely sending us the flaming death. I think we should just put an issue to handle “java.lang.Error” during startup.
|
Hello. I tried to use WinDbg to analyze a dump file of the crash. I got the following information.
Seems like a memory corruption. I also performed tests on different computers. It is always crashing on 6 corporate computers but it is not crashing on computers which are not managed by my organisation. |
Can be a good improvement. Do you want me to create another issue ? |
We can use this one for now. Just need to rename it to the required task for now. Something like “Handle assertions during JVM startup”
The issue is that the assertion is failing some place, and it is likely bubbling up at a point in time when the system is vulnerable because we don’t yet have all the resources in place the handle it.
The solution will be to deliberately add a bad assertion at different points in the JPype support jar file. We then force the assertion to fail which will reproduce the crash. We then redirect the crash to a normal Python exception so the user can see it. It doesn’t mean that JPype will run as the best we can do is provide diagnostics. This will need to be repeated at different places in the start up code as we don’t’ know where it is currently happening so we would have to guard all points.
|
Hello all.
I have a python application which was working great but today the startJVM is crashing :/
I did not change anything in my application. I do not see any logs.
By looking at the windows logs I can see the python.exe processus is crashing because of ntdll.dll, version : 10.0.19041.3636.
located at C:\WINDOWS\SYSTEM32\ntdll.dll.
After debug, I can see it is crashing in the startJVM call I perform.
Here is the call I perform
startJVM(str(jvm_path), "-ea", f"-Djava.library.path={resources_path}", classpath=classpaths, interrupt=False)
I need to start the JVM with custom jar loaded with it.
I tried to start it with
startJVM
with no parameters and it seems it is working.I do not have any idea on how to fix this problem and it is crazy that it is crashing now without any changes to my code.
Hopefully you can help me with my problem.
Thanks a lot for your help.
The text was updated successfully, but these errors were encountered: