AnsweredAssumed Answered

JVM crashes with Sun JVM 1.5.0_6

Question asked by kevinr on Jan 26, 2006
Latest reply on Aug 10, 2007 by prototribe
If you are running Sun JVM 1.5.0_6 (Windows or Linux) you may see the Alfresco server crash with the following report:

# An unexpected error has been detected by HotSpot Virtual Machine:
#  SIGSEGV (0xb) at pc=0x40520cd1, pid=31769, tid=2309221296 # # Java VM: Java HotSpot(TM) Server VM (1.5.0_06-b05 mixed mode) # Problematic frame:
# V  []

—————  T H R E A D  —————

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

siginfo:si_signo=11, si_errno=0, si_code=1, si_addr=0x00000000

EAX=0x00000000, EBX=0x407027f0, ECX=0x89a3cec0, EDX=0x89dafc44 ESP=0x89a3ce34, EBP=0x89a3ce58, ESI=0x89db336c, EDI=0x89a3cec0 EIP=0x40520cd1, CR2=0x00000000, EFLAGS=0x00010292

Top of Stack: (sp=0x89a3ce34)
0x89a3ce34:   89a3d470 89a3d480 40520c16 8a8f8ca8
0x89a3ce44:   8a8f8cc8 89a3ce78 407027f0 89db336c
0x89a3ce54:   89db3328 89a3ce88 40520d75 89db3a60
0x89a3ce64:   89dafc44 89db3a60 89a3cec0 89db3ac4
0x89a3ce74:   89db4168 89db3328 407027f0 89db3a60
0x89a3ce84:   00000000 89a3cee8 40521258 89db3a60
0x89a3ce94:   89db336c 89db3a60 89a3cec0 ffffffff
0x89a3cea4:   89db4704 89a3cee8 405a5bf1 89db4168

Instructions: (pc=0x40520cd1)
0x40520cc1:   10 eb de 31 c0 eb 8e 8b 42 04 83 ec 0c 8b 40 08
0x40520cd1:   8b 08 50 ff 51 28 83 c4 10 e9 48 ff ff ff 90 55

Stack: [0x899be000,0x89a3f000),  sp=0x89a3ce34,  free space=507k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) V  [] V  [] V  [] V  [] V  [] V  [] V  [] V  [] V  [] V  [] V  [] V  [] V  [] C  []

[b]Current CompileTask:
opto:2497      org.apache.lucene.index.IndexReader$1.doBody()Ljava/lang/Object; (99 bytes)[/b]

This has been identified as a JVM compiler (HotSpot) bug in that particular version of the JVM.

You can either:
1. Revert to Sun JVM 1.5.0_5 (which does not appear to have the problem)
2. Remove the method from JIT compliation:

This is done by creating a ".hotspot_compiler" file where java is called.
See the attached file which excludes the offending method.
For tomcat, this file would go in the TOMCAT_HOME/bin directory.
For use from Alfresco source, it would go in the project directory: e.g. \alfresco-src\root\projects\repository

To confirm this file is being picked up:
You should see the following as the JVM start up:

CompilerOracle: exclude org/apache/lucene/index/IndexReader$1 doBody

When an attempt to compile this method is made, it will be rejected and you will see:

### Excluding compile:  org.apache.lucene.index.IndexReader$1::doBody

If you want to see all compilation progress you can use  XX:+PrintCompilation

The file should contain the following line:
exclude  org/apache/lucene/index/IndexReader$1 doBody

It is possible the JVMs differ in how they find this file: