JDK 1.5.0: application crash with multiple threads

Brian Clapper brian-freebsd-009 at clapper.org
Fri Apr 8 07:22:39 PDT 2005


I have a multithreaded application that is crashing under JDK 1.5.0 when
using multiple threads. Works fine (and has worked fine for quite some
time) with JDK 1.4.2.

Brief overview of application:

- It's a batch-oriented RSS reader (i.e., no GUI)
- It can be configured to process RSS feeds in parallel, using up to N
  threads. If N=1, it does not spawn threads, but processes the feeds
  sequentially.

If I try to run it with more than one thread, in the alpha JDK 1.5.0, it
crashes with:

# An unexpected error has been detected by HotSpot Virtual Machine:
#
#  SIGBUS (0xa) at pc=0x286f2377, pid=48305, tid=0x8625800
#
# Java VM: Java HotSpot(TM) Client VM (1.5.0-p1-bmc_03_apr_2005_13_15 mixed mode)
# Problematic frame:
# C  [libverify.so+0x8377]  VerifyClassForMajorVersion+0x5643

Other info:

1. This occurs with JDK 1.5.0-p1 on FreeBSD 4.11-RELEASE. The JDK was built
   on the same machine.

2. The machine itself is a 2.4 GHz Pentium 4 with 512 Mb of RAM

3. The application runs fine under JDK 1.5.0 without threads.

4. The same application runs fine with multiple threads on a Linux machine,
   using the Linux 1.5.0 JDK.

5. The same application runs fine with multiple threads on FreeBSD, using
   the FreeBSD 1.4.2 JDK. In fact, I have been running it with the FreeBSD
   1.4.2 JDK on FreeBSD 4.10/4.11 for a long time, without any problems.
   (It also runs fine on FreeBSD 4.8-RELEASE, with the 1.4.2 JDK, with no
   problems.)

6. It doesn't seem to matter whether the code is compiled with the 1.5.0
   javac compiler or the 1.4.2 javac compiler.

7. Specifying the "-server" option to "java" makes no difference. (It
   seemed worth a try...)

I've enclosed the output from the trace (i.e., the "hs_err_pid*.log" file)
that's produced when the VM dumps core, as well as a stack trace retrieved
from the core file via gdb(1).

I can reproduce this problem at will. I'd be happy to run additional tests,
try other things, etc.

Is there a known problem with threading in the 1.5.0 JDK?

Is there any other information that would be useful?

Regards,

Brian Clapper, http://www.clapper.org/bmc/

----------

********************
hs_err_pid47178.log:
********************

#
# An unexpected error has been detected by HotSpot Virtual Machine:
#
#  SIGBUS (0xa) at pc=0x286f2377, pid=47178, tid=0x85e8c00
#
# Java VM: Java HotSpot(TM) Client VM (1.5.0-p1-bmc_03_apr_2005_13_15 mixed mode)
# Problematic frame:
# C  [libverify.so+0x8377]  VerifyClassForMajorVersion+0x5643
#

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

Current thread (0x085e9000):  JavaThread "FeedDownloadThread-6" [_thread_in_native, id=140413952]

siginfo:si_signo=10, si_errno=0, si_code=12, si_addr=0x0867f000

Registers:
EAX=0x0867f000, EBX=0x286f5480, ECX=0x0000000b, EDX=0x35bba000
ESP=0x087bc1a8, EBP=0x087bc1c0, ESI=0x0867f000, EDI=0x087bc200
EIP=0x286f2377, EFLAGS=0x00010206

Top of Stack: (sp=0x087bc1a8)
0x087bc1a8:   286f5480 087bc44c 087bc390 00000001
0x087bc1b8:   00000000 087bc37c 087bc390 286ecdc2
0x087bc1c8:   087bc200 00000001 28444776 286ecd45
0x087bc1d8:   287163a4 085e9000 085e8850 087bc214
0x087bc1e8:   2833c3d0 0812e410 282536ce 2824b3ed
0x087bc1f8:   2833c3b4 087bc200 085e90c8 087bc44c
0x087bc208:   00000100 00000000 00000000 00000000
0x087bc218:   00000000 00000000 00000000 00000000

Instructions: (pc=0x286f2377)
0x286f2367:   83 c4 10 85 f6 75 09 83 c4 f4 57 e8 b9 01 00 00
0x286f2377:   c7 06 00 00 00 00 c7 46 04 d0 07 00 00 c7 87 5c

Stack: [0x0877d000,0x087bd000),  sp=0x087bc1a8,  free space=252k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  [libverify.so+0x8377]  VerifyClassForMajorVersion+0x5643
C  [libverify.so+0x2dc2]  VerifyClassForMajorVersion+0x8e
C  [libjava.so+0xc75e]  VerifyClassCodesForMajorVersion+0x2a
V  [libjvm.so+0x3b8b23]
V  [libjvm.so+0x23384b]
V  [libjvm.so+0x234111]
V  [libjvm.so+0x233f92]
V  [libjvm.so+0x233d74]
V  [libjvm.so+0x23448b]
V  [libjvm.so+0x2337f7]
V  [libjvm.so+0x247c98]
j  org.clapper.curn.FeedDownloadThread.handleFeed(Lorg/clapper/curn/FeedInfo;Lorg/clapper/curn/parser/RSSParser;Lorg/clapper/curn/ConfigFile;)Lorg/clapper/curn/parser/RSSChannel;+490
j  org.clapper.curn.FeedDownloadThread.processFeed(Lorg/clapper/curn/FeedInfo;)V+48
j  org.clapper.curn.FeedDownloadThread.run()V+101
v  ~StubRoutines::call_stub
V  [libjvm.so+0x254334]
V  [libjvm.so+0x347ab2]
V  [libjvm.so+0x25418e]
V  [libjvm.so+0x253b16]
V  [libjvm.so+0x253b92]
V  [libjvm.so+0x2a253a]
V  [libjvm.so+0x39b45f]
V  [libjvm.so+0x39b3f7]
V  [libjvm.so+0x345363]
C  [libc_r.so.4+0x1932c]  _thread_start+0x34

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j  org.clapper.curn.FeedDownloadThread.handleFeed(Lorg/clapper/curn/FeedInfo;Lorg/clapper/curn/parser/RSSParser;Lorg/clapper/curn/ConfigFile;)Lorg/clapper/curn/parser/RSSChannel;+490
j  org.clapper.curn.FeedDownloadThread.processFeed(Lorg/clapper/curn/FeedInfo;)V+48
j  org.clapper.curn.FeedDownloadThread.run()V+101
v  ~StubRoutines::call_stub

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

Java Threads: ( => current thread )
  0x085f4800 JavaThread "Keep-Alive-Timer" daemon [_thread_blocked, id=144805888]
  0x085f4000 JavaThread "FeedDownloadThread-14" [_thread_in_native, id=140454912]
  0x085e9e00 JavaThread "FeedDownloadThread-13" [_thread_in_native, id=140451840]
  0x085e9c00 JavaThread "FeedDownloadThread-12" [_thread_in_native, id=140444672]
  0x085e9a00 JavaThread "FeedDownloadThread-11" [_thread_in_native, id=140437504]
  0x085e9800 JavaThread "FeedDownloadThread-10" [_thread_in_native, id=140434432]
  0x085e9600 JavaThread "FeedDownloadThread-9" [_thread_in_native, id=140431360]
  0x085e9400 JavaThread "FeedDownloadThread-8" [_thread_in_native, id=140424192]
  0x085e9200 JavaThread "FeedDownloadThread-7" [_thread_in_native, id=140421120]
=>0x085e9000 JavaThread "FeedDownloadThread-6" [_thread_in_native, id=140413952]
  0x085f3e00 JavaThread "FeedDownloadThread-5" [_thread_in_native, id=140410880]
  0x085f3600 JavaThread "FeedDownloadThread-1" [_thread_in_native, id=140394496]
  0x085f3400 JavaThread "FeedDownloadThread-0" [_thread_in_native, id=140440576]
  0x080f6800 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=136796160]
  0x080f6600 JavaThread "CompilerThread0" daemon [_thread_blocked, id=136513536]
  0x080f6400 JavaThread "Finalizer" daemon [_thread_blocked, id=136201216]
  0x080f6200 JavaThread "Reference Handler" daemon [_thread_blocked, id=135931904]
  0x08076800 JavaThread "main" [_thread_blocked, id=134582272]

Other Threads:
  0x0807af00 VMThread [id=135652352]
  0x0807a900 WatcherThread [id=137065472]

VM state:not at safepoint (normal execution)

VM Mutex/Monitor currently owned by a thread: None

Heap
 def new generation   total 576K, used 252K [0x2d220000, 0x2d2c0000, 0x2d700000)
  eden space 512K,  37% used [0x2d220000, 0x2d24fc88, 0x2d2a0000)
  from space 64K,  95% used [0x2d2b0000, 0x2d2bf4a8, 0x2d2c0000)
  to   space 64K,   0% used [0x2d2a0000, 0x2d2a0000, 0x2d2b0000)
 tenured generation   total 2072K, used 1241K [0x2d700000, 0x2d906000, 0x31220000)
   the space 2072K,  59% used [0x2d700000, 0x2d836598, 0x2d836600, 0x2d906000)
 compacting perm gen  total 8192K, used 3140K [0x31220000, 0x31a20000, 0x35220000)
   the space 8192K,  38% used [0x31220000, 0x31531128, 0x31531200, 0x31a20000)
No shared spaces configured.

Dynamic libraries:
0x08048000      /usr/local/java/jdk/bin/java
0x28073000      /usr/lib/libc_r.so.4
0x2812a000      /usr/local/jdk1.5.0/jre/lib/i386/client/libjvm.so
0x286bc000      /usr/lib/libm.so.2
0x286d8000      /usr/local/jdk1.5.0/jre/lib/i386/native_threads/libhpi.so
0x286ea000      /usr/local/jdk1.5.0/jre/lib/i386/libverify.so
0x286f6000      /usr/local/jdk1.5.0/jre/lib/i386/libjava.so
0x28717000      /usr/local/jdk1.5.0/jre/lib/i386/libzip.so
0x35f2c000      /usr/local/jdk1.5.0/jre/lib/i386/libnet.so
0x28055000      /usr/libexec/ld-elf.so.1

VM Arguments:
jvm_args: -Xrs -Djava.util.logging.config.file=/usr/home/bmc/.curn/logging.properties
java_command: org.clapper.curn.Tool --no-update common.cfg

Environment Variables:
JAVA_HOME=/usr/local/java/jdk
PATH=.:/usr/local/site/bin:/usr/home/bmc/bin:/home/bmc/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:/usr/X11R6/bin:/usr/local/lib/oss/bin:/usr/local/site/sbin:/usr/local/Acrobat4/bin:/usr/home/bmc/OpenOffice:/usr/local/java/jdk/bin:/usr/local/ant/bin:/usr/local/java/jython:/usr/local/java/javacc-3.0/bin:/usr/local/lib/oss/bin
LD_LIBRARY_PATH=/usr/local/jdk1.5.0/jre/lib/i386/client:/usr/local/jdk1.5.0/jre/lib/i386:/usr/local/jdk1.5.0/jre/../lib/i386:/usr/local/java/jdk/jre/lib/i386:.:/usr/local/site/lib
SHELL=/usr/local/bin/bash2
DISPLAY=localhost:11.0


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

OS:FreeBSD
uname:FreeBSD 4.11-RELEASE FreeBSD 4.11-RELEASE #1: Mon Ap i386
rlimit: STACK 65536k, CORE infinity, NOFILE 7322
CPU:total 1 family 15, cmov, cx8, fxsr, mmx, ht

Memory: 4k page, physical 453896k

vm_info: Java HotSpot(TM) Client VM (1.5.0-p1-bmc_03_apr_2005_13_15) for freebsd-x86, built on Apr  3 2005 14:29:27 by bmc with gcc 2.95.4 20020320 [FreeBSD]



----------

********************************
GDB stack trace, from core file:
********************************

#0  0x280b2584 in kill () from /usr/lib/libc_r.so.4
#1  0x28100b9e in abort () from /usr/lib/libc_r.so.4
#2  0x284700e5 in os::abort ()
   from /usr/local/jdk1.5.0/jre/lib/i386/client/libjvm.so
#3  0x284f0a59 in VMError::report_and_die ()
   from /usr/local/jdk1.5.0/jre/lib/i386/client/libjvm.so
#4  0x2847332f in JVM_handle_bsd_signal ()
   from /usr/local/jdk1.5.0/jre/lib/i386/client/libjvm.so
#5  0x28471ae2 in signalHandler ()
   from /usr/local/jdk1.5.0/jre/lib/i386/client/libjvm.so
#6  0x280c470e in _thread_sig_handler () from /usr/lib/libc_r.so.4
#7  0x280c458e in _thread_sig_handler () from /usr/lib/libc_r.so.4
#8  0xbfbfffac in ?? ()
#9  0x286ecdc2 in VerifyClassForMajorVersion ()
   from /usr/local/jdk1.5.0/jre/lib/i386/libverify.so
#10 0x2870275e in VerifyClassCodesForMajorVersion ()
   from /usr/local/jdk1.5.0/jre/lib/i386/libjava.so
#11 0x284e2b23 in Verifier::verify_byte_codes ()
   from /usr/local/jdk1.5.0/jre/lib/i386/client/libjvm.so
#12 0x2835d84b in instanceKlass::verify_code ()
   from /usr/local/jdk1.5.0/jre/lib/i386/client/libjvm.so
#13 0x2835e111 in instanceKlass::link_class_impl ()
   from /usr/local/jdk1.5.0/jre/lib/i386/client/libjvm.so
#14 0x2835df92 in instanceKlass::link_class_impl ()
   from /usr/local/jdk1.5.0/jre/lib/i386/client/libjvm.so
#15 0x2835dd74 in instanceKlass::link_class ()
   from /usr/local/jdk1.5.0/jre/lib/i386/client/libjvm.so
#16 0x2835e48b in instanceKlass::initialize_impl ()
   from /usr/local/jdk1.5.0/jre/lib/i386/client/libjvm.so
#17 0x2835d7f7 in instanceKlass::initialize ()
   from /usr/local/jdk1.5.0/jre/lib/i386/client/libjvm.so
#18 0x28371c98 in InterpreterRuntime::_new ()
   from /usr/local/jdk1.5.0/jre/lib/i386/client/libjvm.so
#19 0x2b1a29bc in ?? ()
#20 0x2b195a1a in ?? ()
#21 0x2b195943 in ?? ()
#22 0x2b193160 in ?? ()
#23 0x2837e334 in JavaCalls::call_helper ()
   from /usr/local/jdk1.5.0/jre/lib/i386/client/libjvm.so
#24 0x28471ab2 in os::os_exception_wrapper ()
   from /usr/local/jdk1.5.0/jre/lib/i386/client/libjvm.so
#25 0x2837e18e in JavaCalls::call ()
   from /usr/local/jdk1.5.0/jre/lib/i386/client/libjvm.so
#26 0x2837db16 in JavaCalls::call_virtual ()
   from /usr/local/jdk1.5.0/jre/lib/i386/client/libjvm.so
#27 0x2837db92 in JavaCalls::call_virtual ()
   from /usr/local/jdk1.5.0/jre/lib/i386/client/libjvm.so
#28 0x283cc53a in thread_entry ()
   from /usr/local/jdk1.5.0/jre/lib/i386/client/libjvm.so
#29 0x284c545f in JavaThread::thread_main_inner ()
   from /usr/local/jdk1.5.0/jre/lib/i386/client/libjvm.so
---Type <return> to continue, or q <return> to quit---
#30 0x284c53f7 in JavaThread::run ()
   from /usr/local/jdk1.5.0/jre/lib/i386/client/libjvm.so
#31 0x2846f363 in _start ()
   from /usr/local/jdk1.5.0/jre/lib/i386/client/libjvm.so
#32 0x2808c32c in _thread_start () from /usr/lib/libc_r.so.4
#33 0x0 in ?? ()

----------



More information about the freebsd-java mailing list