JDK-6736207 : JVM crash with STACK_OVERFLOW exception
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 1.4.2_18
  • Priority: P2
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_2003
  • CPU: x86
  • Submitted: 2008-08-12
  • Updated: 2011-02-16
  • Resolved: 2009-02-26
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.
Other
1.4-poolResolved
Related Reports
Duplicate :  
Relates :  
Description
Problem Description    : JVM crashes during SAP installation with STACK_OVERFLOW exception. JVM error log with customer letter which describes JVM configuration attached

JDK Release / Build     : 1.4.2_18 b06 
Platform	        : windows-amd64
VM flavors              : server
VM Modes                : -Xmixed 
Java flags              : -Djco.jarm=1 -Dsys.global.dir=E:\usr\sap\J46\SYS\global -Dapplication.home=E:\usr\sap\J46\DVEBMGS01\exe -Djava.library.path=C:\j2sdk1.4.2_18-x64\jre\bin\server;C:\j2sdk1.4.2_18-x64\jre\bin;C:\j2sdk1.4.2_18-x64\bin;E:\usr\sap\J46\DVEBMGS01\j2ee\os_libs;C:\Program Files (x86)\Common Files\NetSarang;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files (x86)\SecureCRT 3.0;C:\j2sdk1.4.2_18-x64\jre\bin;E:\usr\sap\J46\SYS\exe\uc\NTAMD64 -Dmemory.manager=512M -Xmx512M -DLoadBalanceRestricted=no -Djstartup.mode=BOOTSTRAP -Djstartup.ownProcessId=3808 -Djstartup.ownHardwareId=I1930826672 -Djstartup.whoami=bootstrap -Djstartup.debuggable=yes -Xss2m -DSAPINFO=J46_01_bootstrap -DSAPSTART=1 -DCONNECT_PORT=1313 -DSAPSYSTEM=01 -DSAPSYSTEMNAME=J46 -DSAPMYNAME=zma-sap-p6_J46_01 -DSAPPROFILE=E:\usr\sap\J46\SYS\profile\J46_DVEBMGS01_zma-sap-p6 -DFRFC_FALLBACK=ON -DFRFC_FALLBACK_HOST=localhost -DSAPSTARTUP=1 -DSAPSYSTEM=01 -DSAPSYSTEMNAME=J46 -DSAPMYNAME=zma-sap-p6_J46_01 -DSAPDBHOST=zma-sap-ora -Dj2ee.dbhost=zma-sap-ora

Error Log :
#
# An unexpected error has been detected by HotSpot Virtual Machine:
#
#  EXCEPTION_STACK_OVERFLOW (0xc00000fd) at pc=0x00000000081cf62b, pid=3808, tid=804
#
# Java VM: Java HotSpot(TM) 64-Bit Server VM (1.4.2_18-b06 mixed mode)
# Problematic frame:
# V  [jvm.dll+0x1cf62b]
#

---------------  T H R E A D  ---------------

Current thread (0x0000000001330890):  JavaThread "CompilerThread1" daemon [_thread_in_native, id=804]

siginfo: ExceptionCode=0xc00000fd, ExceptionInformation=0x0000000000000001 0x0000000006370ff8 

Registers:
EAX=0x0000000006d0ee40, EBX=0x000000000251bf60, ECX=0x000000000251bf60, EDX=0x000000000251bf60
ESP=0x0000000006371000, EBP=0x0000000000004bfe, ESI=0x000000000251bf60, EDI=0x00000000063aef00
EIP=0x00000000081cf62b, EFLAGS=0x0000000000010283

Top of Stack: (sp=0x0000000006371000)
0x0000000006371000:   0000000000000000 0000000000000000
0x0000000006371010:   0000000000000000 0000000000000000
0x0000000006371020:   0000000000000000 0000000000000000
0x0000000006371030:   0000000000000000 0000000000000000
0x0000000006371040:   0000000000000000 00000000081cf660
0x0000000006371050:   0000000000000000 00000000063ae9a0
0x0000000006371060:   00000000063aef00 00000000063aef70
0x0000000006371070:   0000000000000000 00000000086d7810
0x0000000006371080:   00000000063aeee0 00000000063ae860
0x0000000006371090:   0000000000000010 00000000081d0404
0x00000000063710a0:   0000000000000000 00000000086d7810
0x00000000063710b0:   00000000063aef00 00000000063aef70
0x00000000063710c0:   0000000000000000 0000000000000000
0x00000000063710d0:   00000000086d7798 00000000063aeee0
0x00000000063710e0:   00000000086d7810 00000000081d127d
0x00000000063710f0:   00000000063aeee0 00000000086d7798 

Instructions: (pc=0x00000000081cf62b)
0x00000000081cf61b:   8b ca 48 8b 1c c8 eb 02 33 db 49 8b d4 49 8b ce
0x00000000081cf62b:   e8 80 8a ff ff 85 c0 74 09 4d 3b f4 0f 85 cc 07 


Stack: [0x0000000006370000,0x00000000063b0000),  sp=0x0000000006371000,  free space=4k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [jvm.dll+0x1cf62b]

[error occurred during error reporting, step 120, id 0xc0000005]


Current CompileTask:
opto: 75      com.sap.engine.core.configuration.impl.persistence.rdbms.DBAccessDefault.buildStatements([Ljava/lang/String;)V (2099 bytes)


---------------  P R O C E S S  ---------------

Java Threads: ( => current thread )
  0x0000000001330b20 JavaThread "Thread-1" [_thread_blocked, id=3932]
=>0x0000000001330890 JavaThread "CompilerThread1" daemon [_thread_in_native, id=804]
  0x0000000001330600 JavaThread "CompilerThread0" daemon [_thread_in_native, id=1104]
  0x0000000001330370 JavaThread "AdapterThread" daemon [_thread_blocked, id=2724]
  0x00000000013300e0 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=3736]
  0x000000000132fe50 JavaThread "Finalizer" daemon [_thread_blocked, id=3716]
  0x000000000132fbc0 JavaThread "Reference Handler" daemon [_thread_blocked, id=3760]
  0x000000000132f930 JavaThread "main" [_thread_in_native, id=3756]

Other Threads:
  0x0000000001299010 VMThread [id=3764]
  0x0000000001299210 WatcherThread [id=2612]

VM state:not at safepoint (normal execution)

VM Mutex/Monitor currently owned by a thread: None

Heap
 def new generation   total 1984K, used 631K [0x0000000010010000, 0x0000000010230000, 0x000000001aab0000)
  eden space 1792K,  35% used [0x0000000010010000, 0x00000000100adcb0, 0x00000000101d0000)
  from space 192K,   0% used [0x00000000101d0000, 0x00000000101d0000, 0x0000000010200000)
  to   space 192K,   0% used [0x0000000010200000, 0x0000000010200000, 0x0000000010230000)
 tenured generation   total 3788K, used 2272K [0x000000001aab0000, 0x000000001ae63000, 0x0000000030010000)
   the space 3788K,  59% used [0x000000001aab0000, 0x000000001ace81a0, 0x000000001ace8200, 0x000000001ae63000)
 compacting perm gen  total 20480K, used 10193K [0x0000000030010000, 0x0000000031410000, 0x0000000036010000)
   the space 20480K,  49% used [0x0000000030010000, 0x0000000030a04460, 0x0000000030a04600, 0x0000000031410000)

Dynamic libraries:
0x0000000000400000 - 0x000000000102c000 	E:\usr\sap\J46\DVEBMGS01\exe\jlaunch.exe
0x0000000077ec0000 - 0x0000000077ff9000 	C:\WINDOWS\system32\ntdll.dll
0x0000000077d40000 - 0x0000000077eb3000 	C:\WINDOWS\system32\kernel32.dll
0x0000000077c20000 - 0x0000000077d2c000 	C:\WINDOWS\system32\USER32.dll
0x000007ff7fc90000 - 0x000007ff7fd2b000 	C:\WINDOWS\system32\GDI32.dll
0x000007ff7fbf0000 - 0x000007ff7fbfb000 	C:\WINDOWS\system32\VERSION.dll
0x000007ff7fc00000 - 0x000007ff7fc86000 	C:\WINDOWS\system32\msvcrt.dll
0x000007ff7fee0000 - 0x000007ff7ffe5000 	C:\WINDOWS\system32\ADVAPI32.dll
0x000007ff7fd30000 - 0x000007ff7fec9000 	C:\WINDOWS\system32\RPCRT4.dll
0x000007ff7e9c0000 - 0x000007ff7e9e2000 	C:\WINDOWS\system32\Secur32.dll
0x000007ff77310000 - 0x000007ff77340000 	C:\WINDOWS\system32\WS2_32.dll
0x000007ff77140000 - 0x000007ff7714c000 	C:\WINDOWS\system32\WS2HELP.dll
0x0000000075010000 - 0x00000000750e8000 	E:\usr\sap\J46\DVEBMGS01\exe\icuuc30.dll
0x0000000075210000 - 0x0000000075a3c000 	E:\usr\sap\J46\DVEBMGS01\exe\icudt30.dll
0x0000000075b10000 - 0x0000000075c07000 	E:\usr\sap\J46\DVEBMGS01\exe\icuin30.dll
0x000007ff771b0000 - 0x000007ff7722d000 	C:\WINDOWS\System32\mswsock.dll
0x000007ff7e8f0000 - 0x000007ff7e93e000 	C:\WINDOWS\system32\DNSAPI.dll
0x000007ff7e9f0000 - 0x000007ff7e9fb000 	C:\WINDOWS\System32\winrnr.dll
0x000007ff7e950000 - 0x000007ff7e9b6000 	C:\WINDOWS\system32\WLDAP32.dll
0x000007ff77370000 - 0x000007ff77408000 	C:\WINDOWS\system32\netapi32.dll
0x000007ff7ea00000 - 0x000007ff7ea07000 	C:\WINDOWS\system32\rasadhlp.dll
0x000007ff7f190000 - 0x000007ff7fb9a000 	C:\WINDOWS\system32\SHELL32.dll
0x000007ff7ef60000 - 0x000007ff7effb000 	C:\WINDOWS\system32\SHLWAPI.dll
0x000007ff7f000000 - 0x000007ff7f187000 	C:\WINDOWS\WinSxS\amd64_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.3790.3959_x-ww_0A7B2435\comctl32.dll
0x000007ff77150000 - 0x000007ff77166000 	C:\WINDOWS\system32\SAMLIB.dll
0x0000000008000000 - 0x00000000083d4000 	C:\j2sdk1.4.2_18-x64\jre\bin\server\jvm.dll
0x000007ff7e240000 - 0x000007ff7e290000 	C:\WINDOWS\system32\WINMM.dll
0x000007ff77100000 - 0x000007ff7710b000 	C:\WINDOWS\system32\rdpsnd.dll
0x000007ff7d4d0000 - 0x000007ff7d4ea000 	C:\WINDOWS\system32\WINSTA.dll
0x000007ff7e380000 - 0x000007ff7e390000 	C:\WINDOWS\system32\PSAPI.DLL
0x0000000010000000 - 0x0000000010008000 	C:\j2sdk1.4.2_18-x64\jre\bin\hpi.dll
0x0000000002180000 - 0x0000000002194000 	C:\j2sdk1.4.2_18-x64\jre\bin\verify.dll
0x00000000021a0000 - 0x00000000021c5000 	C:\j2sdk1.4.2_18-x64\jre\bin\java.dll
0x00000000021d0000 - 0x00000000021e3000 	C:\j2sdk1.4.2_18-x64\jre\bin\zip.dll
0x0000000006dd0000 - 0x0000000006de3000 	C:\j2sdk1.4.2_18-x64\jre\bin\net.dll
0x000007ff6d200000 - 0x000007ff6d293000 	C:\WINDOWS\system32\hnetcfg.dll
0x000007ff77170000 - 0x000007ff7717b000 	C:\WINDOWS\System32\wshtcpip.dll

VM Arguments:
jvm_args: exit abort vfprintf -Djco.jarm=1 -Dsys.global.dir=E:\usr\sap\J46\SYS\global -Dapplication.home=E:\usr\sap\J46\DVEBMGS01\exe -Djava.library.path=C:\j2sdk1.4.2_18-x64\jre\bin\server;C:\j2sdk1.4.2_18-x64\jre\bin;C:\j2sdk1.4.2_18-x64\bin;E:\usr\sap\J46\DVEBMGS01\j2ee\os_libs;C:\Program Files (x86)\Common Files\NetSarang;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files (x86)\SecureCRT 3.0;C:\j2sdk1.4.2_18-x64\jre\bin;E:\usr\sap\J46\SYS\exe\uc\NTAMD64 -Dmemory.manager=512M -Xmx512M -DLoadBalanceRestricted=no -Djstartup.mode=BOOTSTRAP -Djstartup.ownProcessId=3808 -Djstartup.ownHardwareId=I1930826672 -Djstartup.whoami=bootstrap -Djstartup.debuggable=yes -Xss2m -DSAPINFO=J46_01_bootstrap -DSAPSTART=1 -DCONNECT_PORT=1313 -DSAPSYSTEM=01 -DSAPSYSTEMNAME=J46 -DSAPMYNAME=zma-sap-p6_J46_01 -DSAPPROFILE=E:\usr\sap\J46\SYS\profile\J46_DVEBMGS01_zma-sap-p6 -DFRFC_FALLBACK=ON -DFRFC_FALLBACK_HOST=localhost -DSAPSTARTUP=1 -DSAPSYSTEM=01 -DSAPSYSTEMNAME=J46 -DSAPMYNAME=zma-sap-p6_J46_01 -DSAPDBHOST=zma-sap-ora -Dj2ee.dbhost=zma-sap-ora
java_command: <unknown>
Launcher Type: generic

Environment Variables:
JAVA_HOME=C:\j2sdk1.4.2_18-x64
PATH=C:\j2sdk1.4.2_18-x64\jre\bin\server;C:\j2sdk1.4.2_18-x64\jre\bin;C:\j2sdk1.4.2_18-x64\bin;E:\usr\sap\J46\DVEBMGS01\j2ee\os_libs;C:\Program Files (x86)\Common Files\NetSarang;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files (x86)\SecureCRT 3.0;C:\j2sdk1.4.2_18-x64\jre\bin;E:\usr\sap\J46\SYS\exe\uc\NTAMD64
OS=Windows_NT
PROCESSOR_IDENTIFIER=EM64T Family 6 Model 23 Stepping 6, GenuineIntel


---------------  S Y S T E M  ---------------

OS: Windows Server 2003 family Build 3790 Service Pack 2

CPU:total 8 em64t ht

Memory: 4k page, physical 66321412k(63243524k free), swap 140178140k(70182376k free)

vm_info: Java HotSpot(TM) 64-Bit Server VM (1.4.2_18-b06) for windows-amd64, built on May 27 2008 23:18:38 by "java_re" with unknown MS VC++:1400

Comments
EVALUATION The same issue has been recently solved for the same customer by Kevin Walls under CR 6778571. The fix was to change logic for recognising stack settings when creating CompilerThread, to recognise -Xss value if CompilerThreadStackSize is not set. I'm closing this CR as a duplicate of CR 6778571.
26-02-2009

WORK AROUND Beginning with 1.4.2_17, a correct way to workaround the problem is to use -XX:CompilerThreadStackSize=2048 (for 2MB) instead of -Xss2m, or -XX:CompilerThreadStackSize=3072 (for 3MB) instead of -Xss3m, or -XX:CompilerThreadStackSize=4096 (for 4MB) instead of -Xss4m It needs to be ensured, that the change affects all NetWeaver processes of the entire product.
27-11-2008

EVALUATION SAP could either implement the workaround (short term fix) or use a larger value for the default stack size at compile time (long term fix).
27-11-2008

EVALUATION This bug report should be closed as "not a bug". The behavior described is due to using a workaround that was based on bug # 6579892, and that stopped working after bug # 6579892 was fixed.
25-11-2008

EVALUATION Failing thread was the "CompilerThread1": =>0x0000000001330890 JavaThread "CompilerThread1" daemon [_thread_in_native, id=804] failing thread experienced a stack overflow on Windows: EXCEPTION_STACK_OVERFLOW. Stack information was given as follows: Stack: [0x0000000006370000,0x00000000063b0000), sp=0x0000000006371000, free space=4k EXCEPTION_STACK_OVERFLOW was encountered when stack space was nearly exhausted, with free stack space as little as 4k. The size of the thread's stack segment was only 256 kB 0x00000000063b0000 - 0x0000000006370000 = 0x40000 bytes = 256 kB This is far too little stack space for JVM's runtime compiler thread. The problem is a consequence of bug fix for # 6579892. 6579892 1.4.2_12 server VM fails with EXCEPTION_STACK_OVERFLOW on Windows in PhaseCFG::set_pinned The incorrect behavior was twofold: -XX:CompilerThreadStackSize=<size> was disregarded by the JVM on Windows for the CompilerThread -Xss<size> could be used in order to set the size of the CompilerThread for JVM on Windows. Meanwhile the latter was used as a workaround by many SAP customers. Please mind the definition of -Xss: -Xss<size> set java thread stack size With 1.4.2_17 the fix for # 6579892 became officially available. The fix changed two things: -Xss<size> does no longer affect native threads' stack size like JVM's runtime CompilerThread -XX:CompilerThreadStackSize=<size> is now regarded by JVM on Windows to set the stack size of the CompilerThread. Beginning with 1.4.2_17 the original workaround to increase the CompilerThreads' stack size using -Xss stopped working, as this workaround was based on bug # 6579892. The JVM's CompilerThreads take again as default thread stack size the default stack size for native threads, which is a compile-time parameter of the binary. For SAP's binary "jlaunch.exe" the parameter was set to 256kB (0x40000). Beginning with 1.4.2_17, a correct way to workaround the problem is to use -XX:CompilerThreadStackSize=2048 (for 2MB) instead of -Xss2m, or -XX:CompilerThreadStackSize=3072 (for 3MB) instead of -Xss3m, or -XX:CompilerThreadStackSize=4096 (for 4MB) instead of -Xss4m This worked fine and was verified with CA # 38193450 (1.4.2_18). The only caveat for SAP customers is to make the change in a way, that all NetWeaver processes are affected.
24-11-2008