FULL PRODUCT VERSION : java version "1.4.2_01" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_01-b06) Java HotSpot(TM) Client VM (build 1.4.2_01-b06, mixed mode) ADDITIONAL OS VERSION INFORMATION : Slackware 9.1.0: Linux tyre 2.4.25 #3 SMP Fri Mar 26 01:19:27 CET 2004 i686 unknown unknown GNU/Linux Microsoft Windows 2000 (in vmware) also gives the problem A DESCRIPTION OF THE PROBLEM : With Threads, it is possible to use countStackFrames(). However, that may cause the JRE to crash in libjvm.so. I suspect that this occures when using the method on threads which are already disposed. I think the bug exists in all JRE's from the beginning of java. (I use code like this for debugging purposes, and have been using it from java 1.0.2. Sometimes I saw the crash, sometimes not. But the supplied code will demonstrate it much more easy.) STEPS TO FOLLOW TO REPRODUCE THE PROBLEM : To reproduce, compile and run the supplied code and it will crash. Notice that it will not crash on every call to countStackFrames, but surely the test will show the problem. Notice that the problem also occures on Microsoft Windows 2000 (in a vmware session) with jre (1.4.2_04). (I am pretty sure I've had the same problem on Windows NT4.0 with older jvm's (1.2/1.3 etc) and was expecting that it should have been fixed by now...) EXPECTED VERSUS ACTUAL BEHAVIOR : EXPECTED - A lot of (not very interresting) output on a console. ACTUAL - Just a crash of the JRE. ERROR MESSAGES/STACK TRACES THAT OCCUR : Unexpected Signal : 11 occurred at PC=0x403B0EA5 Function=JVM_CountStackFrames+0xE9 Library=/usr/lib/j2sdk1.4.2_01/jre/lib/i386/client/libjvm.so Current Java thread: at java.lang.Thread.countStackFrames(Native Method) at t.main(t.java:16) Dynamic libraries: 08048000-0804e000 r-xp 00000000 08:02 61761 /usr/lib/j2sdk1.4.2_01/bin/java 0804e000-0804f000 rw-p 00005000 08:02 61761 /usr/lib/j2sdk1.4.2_01/bin/java 40000000-40015000 r-xp 00000000 08:02 13080 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 08:02 13080 /lib/ld-2.3.2.so 40016000-4001e000 r-xp 00000000 08:02 62243 /usr/lib/j2sdk1.4.2_01/jre/lib/i386/native_threads/libhpi.so 4001e000-4001f000 rw-p 00007000 08:02 62243 /usr/lib/j2sdk1.4.2_01/jre/lib/i386/native_threads/libhpi.so 4001f000-40023000 rw-s 00000000 00:07 5005544 /dev/shm/tmp/hsperfdata_bklip/22503 40023000-40026000 r--s 00000000 08:02 62226 /usr/lib/j2sdk1.4.2_01/jre/lib/ext/dnsns.jar 40028000-40036000 r-xp 00000000 08:02 13118 /lib/libpthread-0.10.so 40036000-40039000 rw-p 0000e000 08:02 13118 /lib/libpthread-0.10.so 40079000-4007b000 r-xp 00000000 08:02 13105 /lib/libdl-2.3.2.so 4007b000-4007c000 rw-p 00001000 08:02 13105 /lib/libdl-2.3.2.so 4007c000-401ab000 r-xp 00000000 08:02 13098 /lib/libc-2.3.2.so 401ab000-401b0000 rw-p 0012f000 08:02 13098 /lib/libc-2.3.2.so 401b2000-405ac000 r-xp 00000000 08:02 62247 /usr/lib/j2sdk1.4.2_01/jre/lib/i386/client/libjvm.so 405ac000-405c8000 rw-p 003f9000 08:02 62247 /usr/lib/j2sdk1.4.2_01/jre/lib/i386/client/libjvm.so 405da000-405ec000 r-xp 00000000 08:02 13113 /lib/libnsl-2.3.2.so 405ec000-405ed000 rw-p 00011000 08:02 13113 /lib/libnsl-2.3.2.so 405ef000-40611000 r-xp 00000000 08:02 12877 /lib/libm-2.3.2.so 40611000-40612000 rw-p 00021000 08:02 12877 /lib/libm-2.3.2.so 40612000-40623000 r--s 00000000 08:02 62363 /usr/lib/j2sdk1.4.2_01/jre/lib/jce.jar 40623000-4062e000 r-xp 00000000 08:02 13104 /lib/libnss_compat-2.3.2.so 4062e000-4062f000 rw-p 0000a000 08:02 13104 /lib/libnss_compat-2.3.2.so 4062f000-4063f000 r-xp 00000000 08:02 62236 /usr/lib/j2sdk1.4.2_01/jre/lib/i386/libverify.so 4063f000-40641000 rw-p 0000f000 08:02 62236 /usr/lib/j2sdk1.4.2_01/jre/lib/i386/libverify.so 40641000-40661000 r-xp 00000000 08:02 62252 /usr/lib/j2sdk1.4.2_01/jre/lib/i386/libjava.so 40661000-40663000 rw-p 0001f000 08:02 62252 /usr/lib/j2sdk1.4.2_01/jre/lib/i386/libjava.so 40663000-40677000 r-xp 00000000 08:02 62241 /usr/lib/j2sdk1.4.2_01/jre/lib/i386/libzip.so 40677000-4067a000 rw-p 00013000 08:02 62241 /usr/lib/j2sdk1.4.2_01/jre/lib/i386/libzip.so 4067a000-42012000 r--s 00000000 08:02 62357 /usr/lib/j2sdk1.4.2_01/jre/lib/rt.jar 4205c000-42072000 r--s 00000000 08:02 62316 /usr/lib/j2sdk1.4.2_01/jre/lib/sunrsasign.jar 42072000-4214d000 r--s 00000000 08:02 62292 /usr/lib/j2sdk1.4.2_01/jre/lib/jsse.jar 4214d000-426a6000 r--s 00000000 08:02 62355 /usr/lib/j2sdk1.4.2_01/jre/lib/charsets.jar4c7d0000-4c7ec000 r--s 00000000 08:02 62227 /usr/lib/j2sdk1.4.2_01/jre/lib/ext/sunjce_provider.jar 4c7ec000-4c7f9000 r--s 00000000 08:02 62228 /usr/lib/j2sdk1.4.2_01/jre/lib/ext/ldapsec.jar 4c7f9000-4c8b5000 r--s 00000000 08:02 62229 /usr/lib/j2sdk1.4.2_01/jre/lib/ext/localedata.jar Heap at VM Abort: Heap def new generation total 576K, used 384K [0x44750000, 0x447f0000, 0x44c30000) eden space 512K, 62% used [0x44750000, 0x447a0338, 0x447d0000) from space 64K, 100% used [0x447e0000, 0x447f0000, 0x447f0000) to space 64K, 0% used [0x447d0000, 0x447d0000, 0x447e0000) tenured generation total 1408K, used 21K [0x44c30000, 0x44d90000, 0x48750000) the space 1408K, 1% used [0x44c30000, 0x44c35628, 0x44c35800, 0x44d90000) compacting perm gen total 4096K, used 966K [0x48750000, 0x48b50000, 0x4c750000) the space 4096K, 23% used [0x48750000, 0x48841a00, 0x48841a00, 0x48b50000) Local Time = Fri Oct 29 11:34:43 2004 Elapsed Time = 0 # # HotSpot Virtual Machine Error : 11 # Error ID : 4F530E43505002EF # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # # Java VM: Java HotSpot(TM) Client VM (1.4.2_01-b06 mixed mode) # REPRODUCIBILITY : This bug can be reproduced always. ---------- BEGIN SOURCE ---------- public class t { static public void main(String[] args) { while (true) { new tt(); ThreadGroup rootGrp = Thread.currentThread().getThreadGroup(); while (rootGrp.getParent() != null) rootGrp = rootGrp.getParent(); Thread[] threads = new Thread[rootGrp.activeCount() + 8]; int count = rootGrp.enumerate(threads, true); System.err.print("count="+count); for (int i = 0; i < count; ++i) { Thread t = threads[i]; int tmp = t.countStackFrames(); // ************ causes the crash System.err.print(tmp+" "); } System.err.println(); } } } class tt implements Runnable { private Thread runner; public tt() { runner = new Thread(this, "tt"); runner.setDaemon(true); runner.start(); } public void run() { if (Thread.currentThread() == runner) { try { Thread.sleep(10); } catch (InterruptedException e) {} } } } ---------- END SOURCE ---------- CUSTOMER SUBMITTED WORKAROUND : I haven't found any. ###@###.### 10/29/04 16:31 GMT
|