JDK 1.5.0 series hang or crash with some old glibc under Linux

In order to prepare a development web server running Redhat Linux 9 for 2007 DST changes, I upgraded its glibc from 2.3.2-27 to 2.3.2-71 to take advantage of tzdata rpm packages updated for 2007 DST changes.

  • glibc-2.3.2-64 is the earliest version of glibc RPM that has separated timezone data into a new rpm named tzdata (More details can be found here).
  • A backend Sybase ASE server also runs RHL 9, but with a newer glibc-2.3.2-71. The latter was recommended by Michael Peppler for Sybase ASE 12.5 on RHL9 to get around certain bugs in the glibc RPM package shipped with the original RHL9.

After upgrading to glibc-2.3.2-71, RPM installation of JDK-1.5.0-10 hangs.  process listing indicates that rpm command tries to run “java -client -Xshare:dump” from the RPM’s post-installation script. That java command hangs. Killing this java process helped the rpm installation to exit with an error. Otherwise rpm command would hang forever.

# fix for: 4728032 - Install needs to generate shared class files
/usr/java/jdk1.5.0_11/bin/java -client -Xshare:dump > /dev/null 2>&1

Other symptoms are below:

  • “java -fullversion” works just fine for all, including the JDK-1.5.0 series.
  • “java -version” works fine for jdk-1.4.1, but hang or crash for JDK-1.5.0 series such as JDK-1.5.0-05. Most of the time, it hangs. Not exactly sure when it’d crash instead.

If “java -version” ends up crashing, here is the exact verbiage:

/usr/java/jdk1.5.0_10/bin/java -version
#
# An unexpected error has been detected by HotSpot Virtual Machine:
#
# SIGSEGV (0xb) at pc=0×400a89b6, pid=5785, tid=1302989744
#
# Java VM: Java HotSpot(TM) Client VM (1.5.0_10-b03 mixed mode)
# Problematic frame:
# C [libc.so.6+0x719b6]
#
# An error report file with more information is saved as hs_err_pid5785.log
#
# If you would like to submit a bug report, please visit:
# http://java.sun.com/webapps/bugreport/crash.jsp

Thing tried to no avail,

  • turn off HotSpot and do interpreter-only : “java -Xint -version”
  • re-installing the JDK.
  • upgrading to the latest jdk1.5.0_11
  • downgrading to the older jdk1.5.0_05
  • rebooting the operating systems

Once the glibc is upgraded to 2.3.2-101, the latest glibc I can find from FC1 update repository (link can be found here), all starts to work again.

I am glad a workable solution is in place. Yet I am very curious what JDK-1.5.0 series do not like in 2.3.2-71 or glibc versions between 2.3.2-27 and -101. If you have some insight to share, feel free to comment at the end of this post.

For your reference, the hs_err_pid5785.log is appended below:

–cut———-x———–cut——————–x————-cut————–x———-

# An unexpected error has been detected by HotSpot Virtual Machine:
#
# SIGSEGV (0xb) at pc=0×400a89b6, pid=5785, tid=1302989744
#
# Java VM: Java HotSpot(TM) Client VM (1.5.0_10-b03 mixed mode)
# Problematic frame:
# C [libc.so.6+0x719b6]
#

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

Current thread (0×080b77f8): VMThread [id=0]

siginfo:si_signo=11, si_errno=0, si_code=1, si_addr=0×0000000c

Registers:
EAX=0×00000000, EBX=0×40168958, ECX=0×400273bd, EDX=0×00000000
ESP=0×4daa0888, EBP=0×4daa08e0, ESI=0×006e6f68, EDI=0×00000000
EIP=0×400a89b6, CR2=0×0000000c, EFLAGS=0×00010246

Top of Stack: (sp=0×4daa0888)
0×4daa0888: 00000000 40015500 40023000 00000127
0×4daa0898: 4daa08e8 4000c33f 4002319c 40023930
0×4daa08a8: 00000001 00000000 00000000 00000000
0×4daa08b8: 00000000 00000000 4daa0910 4002a28b
0×4daa08c8: 4daa08e8 00000000 00000000 40168958
0×4daa08d8: 401692a0 400273c5 4daa0900 400a7959
0×4daa08e8: 401692a0 400273c5 400273c5 40031530
0×4daa08f8: 4daa099c 4daa0938 4daa0910 40029f12

Instructions: (pc=0×400a89b6)
0×400a89a6: 01 0f 85 33 03 00 00 8b 57 08 8b 47 0c 8b 7d f0
0×400a89b6: 89 42 0c 01 fe 89 50 08 89 34 0e 8b 55 08 83 c2

Stack: [0x00000000,0x00000000), sp=0x4daa0888, free space=1272450k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C [libc.so.6+0x719b6]
C [libc.so.6+0x70959] __libc_free+0×89
C [libpthread.so.0+0x5f12] pthread_attr_destroy+0×22
V [libjvm.so+0x28e0c2]
V [libjvm.so+0x28de03]
V [libjvm.so+0x2fb53c]
V [libjvm.so+0x2fcdad]
V [libjvm.so+0x28c4b6]
C [libpthread.so.0+0x44fa]


————— P R O C E S S —————

Java Threads: ( => current thread )
0×0805bcc8 JavaThread [_thread_in_vm, id=5785]

Other Threads:
=>0×080b77f8 VMThread [id=0]

VM state:not at safepoint (normal execution)

VM Mutex/Monitor currently owned by a thread: None

Heap
def new generation total 576K, used 10K [0x459a0000, 0x45a40000, 0x45e80000)
eden space 512K, 2% used [0x459a0000, 0x459a2908, 0x45a20000)
from space 64K, 0% used [0x45a20000, 0x45a20000, 0x45a30000)
to space 64K, 0% used [0x45a30000, 0x45a30000, 0x45a40000)
tenured generation total 1408K, used 0K [0x45e80000, 0x45fe0000, 0x499a0000)
the space 1408K, 0% used [0x45e80000, 0x45e80000, 0x45e80200, 0x45fe0000)
compacting perm gen total 8192K, used 424K [0x499a0000, 0x4a1a0000, 0x4d9a0000
)
the space 8192K, 5% used [0x499a0000, 0x49a0a268, 0x49a0a400, 0x4a1a0000)
No shared spaces configured.

Dynamic libraries:
08048000-08057000 r-xp 00000000 03:05 1743360 /usr/java/jdk1.5.0_10/bin/java
08057000-08059000 rw-p 0000e000 03:05 1743360 /usr/java/jdk1.5.0_10/bin/java
08059000-080c4000 rwxp 00000000 00:00 0
40000000-40015000 r-xp 00000000 03:06 420236 /lib/ld-2.3.2.so
40015000-40016000 rw-p 00015000 03:06 420236 /lib/ld-2.3.2.so
40016000-40017000 r--p 00000000 00:00 0
40017000-40018000 rw-p 00000000 00:00 0
40018000-4001e000 r-xp 00000000 03:05 570727 /usr/java/jdk1.5.0_10/jre/lib/i386/native_threads/libhpi.so
4001e000-4001f000 rw-p 00006000 03:05 570727 /usr/java/jdk1.5.0_10/jre/lib/i386/native_threads/libhpi.so
40023000-40024000 rw-p 00000000 00:00 0
40024000-40031000 r-xp 00000000 03:06 581934 /lib/tls/libpthread-0.56.so
40031000-40032000 rw-p 0000c000 03:06 581934 /lib/tls/libpthread-0.56.so
40032000-40034000 rw-p 00000000 00:00 0
40034000-40036000 r-xp 00000000 03:06 420208 /lib/libdl-2.3.2.so
40036000-40037000 rw-p 00001000 03:06 420208 /lib/libdl-2.3.2.so
40037000-40166000 r-xp 00000000 03:06 581930 /lib/tls/libc-2.3.2.so
40166000-40169000 rw-p 0012f000 03:06 581930 /lib/tls/libc-2.3.2.so
40169000-4016d000 rw-p 00000000 00:00 0
4016d000-404da000 r-xp 00000000 03:05 570688 /usr/java/jdk1.5.0_10/jre/lib/i386/client/libjvm.so
404da000-404f8000 rw-p 0036c000 03:05 570688 /usr/java/jdk1.5.0_10/jre/lib/i386/client/libjvm.so
404f8000-4090f000 rw-p 00000000 00:00 0
4090f000-40930000 r-xp 00000000 03:06 581932 /lib/tls/libm-2.3.2.so
40930000-40931000 rw-p 00020000 03:06 581932 /lib/tls/libm-2.3.2.so
40931000-40939000 rw-s 00000000 03:06 98246 /tmp/hsperfdata_root/5785
4093e000-40950000 r-xp 00000000 03:06 420230 /lib/libnsl-2.3.2.so
40950000-40951000 rw-p 00011000 03:06 420230 /lib/libnsl-2.3.2.so
40951000-40953000 rw-p 00000000 00:00 0
40953000-4095d000 r-xp 00000000 03:06 420278 /lib/libnss_files-2.3.2.so
4095d000-4095e000 rw-p 0000a000 03:06 420278 /lib/libnss_files-2.3.2.so
4095e000-40969000 r-xp 00000000 03:05 570724 /usr/java/jdk1.5.0_10/jre/lib/i386/libverify.so
40969000-4096a000 rw-p 0000b000 03:05 570724 /usr/java/jdk1.5.0_10/jre/lib/i386/libverify.so
4096a000-4098b000 r-xp 00000000 03:05 570705 /usr/java/jdk1.5.0_10/jre/lib/i386/libjava.so
4098b000-4098d000 rw-p 00020000 03:05 570705 /usr/java/jdk1.5.0_10/jre/lib/i386/libjava.so
4098d000-4099c000 r-xp 00000000 03:05 570725 /usr/java/jdk1.5.0_10/jre/lib/i386/libzip.so
4099c000-4099e000 rw-p 0000e000 03:05 570725 /usr/java/jdk1.5.0_10/jre/lib/i386/libzip.so
4099e000-42fac000 r--s 00000000 03:05 571247 /usr/java/jdk1.5.0_10/jre/lib/rt.jar
42fac000-43015000 rw-p 00000000 00:00 0
43015000-4309a000 r--s 00000000 03:05 570828 /usr/java/jdk1.5.0_10/jre/lib/jsse.jar
4309a000-430af000 r--s 00000000 03:05 570767 /usr/java/jdk1.5.0_10/jre/lib/jce.jar
430af000-4391e000 r--s 00000000 03:05 570768 /usr/java/jdk1.5.0_10/jre/lib/charsets.jar
4391e000-4599e000 rwxp 00028000 00:00 0
459a0000-4da20000 rwxp 0214a000 00:00 0
4da20000-4da21000 ---p 0a1ca000 00:00 0
4da21000-4daa1000 rwxp 0a1cb000 00:00 0
bfe00000-bfe03000 ---p 00000000 00:00 0
bfe03000-c0000000 rwxp ffe04000 00:00 0

VM Arguments:
java_command: <unknown>
Launcher Type: SUN_STANDARD

Environment Variables:
PATH=/usr/kerberos/sbin:/usr/kerberos/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr/bin/X11:/usr/X11R6/bin:/root/bin
USERNAME=root
LD_LIBRARY_PATH=/usr/java/jdk1.5.0_10/jre/lib/i386/client:/usr/java/jdk1.5.0_10/jre/lib/i386:/usr/java/jdk1.5.0_10/jre/../lib/i386
SHELL=/bin/bash

Signal Handlers:
SIGSEGV: [libjvm.so+0x326820], sa_mask[0]=0×7ffbfeff, sa_flags=0×14000004
SIGBUS: [libjvm.so+0x326820], sa_mask[0]=0×7ffbfeff, sa_flags=0×14000004
SIGFPE: [libjvm.so+0x28aa10], sa_mask[0]=0×7ffbfeff, sa_flags=0×14000004
SIGPIPE: [libjvm.so+0x28aa10], sa_mask[0]=0×7ffbfeff, sa_flags=0×14000004
SIGILL: [libjvm.so+0x28aa10], sa_mask[0]=0×7ffbfeff, sa_flags=0×14000004
SIGUSR1: SIG_DFL, sa_mask[0]=0×00000000, sa_flags=0×00000000
SIGUSR2: [libjvm.so+0x28ce60], sa_mask[0]=0×00000000, sa_flags=0×14000004
SIGHUP: SIG_DFL, sa_mask[0]=0×00000000, sa_flags=0×00000000
SIGINT: SIG_DFL, sa_mask[0]=0×00000000, sa_flags=0×00000000
SIGQUIT: SIG_DFL, sa_mask[0]=0×00000000, sa_flags=0×00000000
SIGTERM: SIG_DFL, sa_mask[0]=0×00000000, sa_flags=0×00000000


————— S Y S T E M —————

OS:Red Hat Linux release 9 (Shrike)

uname:Linux 2.4.20-20.9 #1 Mon Aug 18 11:45:58 EDT 2003 i686
libc:glibc 2.3.2 NPTL 0.56
rlimit: STACK 8192k, CORE 0k, NPROC 7168, NOFILE 1024, AS infinity
load average:0.01 0.05 0.16

CPU:total 1 (cores per cpu 1, threads per core 2) family 15 model 4 stepping 1,cmov, cx8, fxsr, mmx, sse, sse2, sse3, ht

Memory: 4k page, physical 2064780k(179496k free), swap 920384k(657208k free)

vm_info: Java HotSpot(TM) Client VM (1.5.0_10-b03) for linux-x86, built on Nov 9 2006 14:22:56 by java_re with gcc 3.2.1-7a (J2SE release)

–cut———-x———–cut——————–x————-cut————–x———-

Leave a Comment

Powered by WP Hashcash