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

Handle assertions during JVM startup #1170

Open
FabienSe opened this issue Jan 29, 2024 · 7 comments
Open

Handle assertions during JVM startup #1170

FabienSe opened this issue Jan 29, 2024 · 7 comments

Comments

@FabienSe
Copy link

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.

@Thrameos
Copy link
Contributor

Thrameos commented Jan 30, 2024 via email

@FabienSe
Copy link
Author

Thanks a lot for your help !
Thanks to your directions. I tried a lot of things. But it is still very strange to me.

startJVM() is working but startJVM("-ea") is not working. So I assume it is linked if I pass arguments or not to the JVM.
It seems strange to me some site rules can impact this behavior.

Did you already see something similar ?

@Thrameos
Copy link
Contributor

Thrameos commented Jan 30, 2024 via email

@Thrameos
Copy link
Contributor

Thrameos commented Jan 30, 2024 via email

@FabienSe
Copy link
Author

Hello.

I tried to use WinDbg to analyze a dump file of the crash. I got the following information.

ntdll!RtlReportFatalFailure+0x9:
00007ffa`f12cf349 eb00            jmp     ntdll!RtlReportFatalFailure+0xb (00007ffa`f12cf34b)
Resetting default scope

EXCEPTION_RECORD:  (.exr -1)
ExceptionAddress: 00007ffaf12cf349 (ntdll!RtlReportFatalFailure+0x0000000000000009)
   ExceptionCode: c0000374
  ExceptionFlags: 00000001
NumberParameters: 1
   Parameter[0]: 00007ffaf13397f0

PROCESS_NAME:  python.exe
ERROR_CODE: (NTSTATUS) 0xc0000374 - Un segment de m moire a  t  endommag .
EXCEPTION_CODE_STR:  c0000374
EXCEPTION_PARAMETER1:  00007ffaf13397f0
ADDITIONAL_DEBUG_TEXT:  Followup set based on attribute [Heap_Error_Type] from Frame:[0] on thread:[PSEUDO_THREAD] ; Followup set based on attribute [Is_ChosenCrashFollowupThread] from Frame:[0] on thread:[PSEUDO_THREAD]
FAULTING_THREAD:  ffffffff
STACK_TEXT:  
00000000`00000000 00000000`00000000 ntdll!RtlpFreeHeapInternal+0x0
STACK_COMMAND:  !heap ; ** Pseudo Context ** ManagedPseudo ** Value: ffffffff ** ; kb
SYMBOL_NAME:  ntdll!RtlpFreeHeapInternal+0
MODULE_NAME: ntdll
IMAGE_NAME:  ntdll.dll
FAILURE_BUCKET_ID:  HEAP_CORRUPTION_ACTIONABLE_BlockNotBusy_DOUBLE_FREE_c0000374_ntdll.dll!RtlpFreeHeapInternal
OS_VERSION:  10.0.19041.1
BUILDLAB_STR:  vb_release
OSPLATFORM_TYPE:  x64
OSNAME:  Windows 10
IMAGE_VERSION:  10.0.19041.3636
FAILURE_ID_HASH:  {f9e860eb-b03f-7415-804c-7e671e26c730}
Followup:     MachineOwner

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.
It is probably linked like you said on your previous message to the systems admins. Now the difficult part will be to know what they have change or how to fix it 😢

@FabienSe
Copy link
Author

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.

Can be a good improvement. Do you want me to create another issue ?

@Thrameos
Copy link
Contributor

Thrameos commented Jan 31, 2024 via email

@FabienSe FabienSe changed the title startJVM crashs on Windows 10 Handle assertions during JVM startup Feb 1, 2024
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