JDK-4741238 : application crashes at JNI_CreateJavaVM
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 1.3.1_02,1.4.0_01
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: windows_2000,windows_xp
  • CPU: x86
  • Submitted: 2002-09-04
  • Updated: 2013-06-21
  • Resolved: 2002-09-28
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
1.4.1_01 01Fixed
When the cust. follows below's procedure on windowsXP 
to exercize their JNI application attached to the windows'
explorer (not IE), it fails to create the JVM. WinDgb 4.0.0018.0
is being used to extract the kernel stack trace.

1. Launch WinDbg
2. Using the Task Manager 
	- kill explorer.exe
	- Restart explorer.exe [File -> New Task (run)]

In WinDbg:

3. File -> Attach To a Process; then click on explorer.exe
4. In the command line type: 
	.kframes 100
5. Hit F5 (Go)
6. While explorer.exe is running stop the debugger [Debug -> Break]
   and type in the command line:
        bp kernel32!ExitProcess
7. Hit F5 (Go)
8. Launch the explorer functionnality:
	Start -> All Programs -> Accessories -> Windows Explorer
9. In the new 'My Documents' popup window go on the Folder subwindow
   and click on MyComputer. This will cause the failure which will bring
   the Java Internal Error Popup with the following question:
	"Fatal error, must be the same thread, slowly. Do you
         want to debug the problem?"
   to which you click 'yes'.
10. Dump the stack trace by typing in the command line:

@@@@@@@@@@@@@@@@@@@@ stack trace excerpt @@@@@@@@@@@@@@@@@@@@@@@@@@@@
Opened log file 'R:\Personal_Projects\Individuals\XXXXXX\logs\edit bugreport'
Symbol search path is: srv*e:\debugging symbols for windbg*http://msdl.microsoft.com/download/symbols;r:\personal_projects\individuals\XXXXX XXXXXXX\sun jvm issues\windows explorer\vcdjshell\debug

Microsoft (R) Windows User-Mode Debugger  Version 4.0.0018.0
Copyright (c) Microsoft Corporation. All rights reserved.

*** wait with pending attach

ModLoad: 08000000 0825c000   E:\Program Files\Java\j2re1.4.0_01\bin\client\jvm.dll
ModLoad: 6d1d0000 6d1d7000   E:\Program Files\Java\j2re1.4.0_01\bin\hpi.dll
Break instruction exception - code 80000003 (first chance)
eax=00000001 ebx=03f10988 ecx=ffffffff edx=08200fdc esi=03f10988 edi=08226f3c
eip=080d44c6 esp=03bfcbd4 ebp=03bfcbd8 iopl=0         nv up ei pl nz ac po nc
cs=001b  ss=0023  ds=0023  es=0023  fs=0038  gs=0000             efl=00000216
*** WARNING: Unable to verify checksum for E:\Program Files\Java\j2re1.4.0_01\bin\client\jvm.dll
080d44c6 cc               int     3
0:015> kp
ChildEBP RetAddr  
03bfcbd8 080cfe99 jvm!ThreadLocalStorage::set_thread(Thread* thread = 03f10988)+0x56 [h:\net-disk\1.4.0\hotspot\src\share\vm\runtime\threadLocalStorage.cpp @ 58]
03bfcbe4 080d2972 jvm!Thread::initialize_thread_local_storage()+0x9 [h:\net-disk\1.4.0\hotspot\src\share\vm\runtime\thread.cpp @ 73]
03bfcc68 0805a845 jvm!Threads::create_vm(JavaVMInitArgs* args = 03bfcce8)+0xd2 [h:\net-disk\1.4.0\hotspot\src\share\vm\runtime\thread.cpp @ 2506]
*** WARNING: Unable to verify checksum for R:\Personal_Projects\Individuals\Craig Randall\Sun JVM issues\Windows Explorer\VCDJShell\Debug\VCDJShell.dll
03bfcc78 03ac33ce jvm!JNI_CreateJavaVM(JavaVM_** vm = 03bfccfc, void** penv = 03bfccf8, void* args = 03bfcce8)+0x25 [h:\net-disk\1.4.0\hotspot\src\share\vm\prims\jni.cpp @ 2130]
03bfcd1c 03ac6da9 VCDJShell!CVCDJFolder::CVCDJFolder()+0xde [R:\Personal_Projects\Individuals\XXXXX XXXXXXXX\Sun JVM issues\Windows Explorer\VCDJShell\VCDJFolder.cpp @ 100]
03bfcd80 03ac6c60 VCDJShell!ATL::CComObject<CVCDJFolder>::CComObject<CVCDJFolder>(void* __formal = 00000000)+0x29 [e:\program files\microsoft visual studio\vc98\atl\include\atlcom.h @ 2398]
03bfce10 03ac610e VCDJShell!ATL::CComCreator<ATL::CComObject<CVCDJFolder> >::CreateInstance(void* pv = 00000000, _GUID* riid = 03bfd840, void** ppv = 03bfcf38)+0x90 [e:\program files\microsoft visual studio\vc98\atl\include\atlcom.h @ 1827]
03bfce74 03ac63d2 VCDJShell!ATL::CComCreator2<ATL::CComCreator<ATL::CComObject<CVCDJFolder> >,ATL::CComCreator<ATL::CComAggObject<CVCDJFolder> > >::CreateInstance(void* pv = 00000000, _GUID* riid = 03bfd840, void** ppv = 03bfcf38)+0x4e [e:\program files\microsoft visual studio\vc98\atl\include\atlcom.h @ 1887]
03bfced8 771c6626 VCDJShell!ATL::CComClassFactory::CreateInstance(IUnknown* pUnkOuter = 00000000, _GUID* riid = 03bfd840, void** ppvObj = 03bfcf38)+0x92 [e:\program files\microsoft visual studio\vc98\atl\include\atlcom.h @ 2937]
03bfcf4c 771c63d2 ole32!CServerContextActivator::CreateInstance+0x12f
03bfcf78 771c670d ole32!ActivationPropertiesIn::DelegateCreateInstance+0xf5
03bfcfbc 771c669f ole32!CApartmentActivator::CreateInstance+0xf6
03bfcfd8 771c5a82 ole32!CProcessActivator::CCICallback+0x59
03bfcff8 771c5a42 ole32!CProcessActivator::AttemptActivation+0x2a
03bfd030 771c675f ole32!CProcessActivator::ActivateByContext+0x41
03bfd058 771c63d2 ole32!CProcessActivator::CreateInstance+0x47
03bfd084 771c6464 ole32!ActivationPropertiesIn::DelegateCreateInstance+0xf5
03bfd2d4 771c63d2 ole32!CClientContextActivator::CreateInstance+0x8d
03bfd300 771c6329 ole32!ActivationPropertiesIn::DelegateCreateInstance+0xf5
03bfd3e0 77f56be8 ole32!ICoCreateInstanceEx+0x2db
03bfda44 77f5168d ntdll!RtlAppendUnicodeToString+0x4e
03bfd9a0 00000000 ntdll!RtlFreeHeap+0x5c9

Key Files are in attachment:

CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: 1.4.1_01 mantis FIXED IN: 1.4.1_01 mantis INTEGRATED IN: 1.4.1_01 mantis mantis-b03

EVALUATION So far I could not access the reproducing system (beila.sfbay) successfully thru "vnc" software.Based on the Info available in bugTRAQ the evaluation comments are as below. From the "description" STEP-9 the failure occurs at "ThreadLocalStorage::set_thread()" at the gaurantee statement " guarantee(get_thread() == thread, "must be the same thread, slowly");" The problem may be occuring in the generated code for get_thread() (i.e in ThreadLocalStorage::generate_code_for_get_thread()) In an attempt to reproduce the bug locally I have written a small testcase ("test1.dll" calling "jvm.dll") and "Test.exe" calling "test1.dll" and tested with XP, but I could'nt reproduce the bug. ###@###.### 2002-09-09 --------------------------------------------------------------------------------