JDK-5053405 : GetThreadGroupInfo crashes if Thread Group name is null (jvmpi too)
  • Type: Bug
  • Component: hotspot
  • Sub-Component: jvmti
  • Affected Version: 1.4.2_03,5.0
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2004-05-26
  • Updated: 2004-06-15
  • Resolved: 2004-06-15
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
5.0 b56Fixed
Related Reports
Relates :  
Description
cruella<37> cat Test.java
class MyThread extends Thread {
    public MyThread(ThreadGroup g, String name) {
        super(g,name);
    }
    public void run() {
        try {
            synchronized( this ) {
                wait();
            }
        } catch ( InterruptedException i ) {
        }
    }
}
public class Test {
    public static void main(String[] ARGS) {
        Thread th = new MyThread(new ThreadGroup((String)null), "tname");
        th.start();
        System.out.println("ThreadGroup=" + th.getThreadGroup().toString());
        synchronized( th ) {
            th.notify();
        }
    }
}
cruella<38> javac -d . Test.java
cruella<39> java -version
java version "1.4.2_02"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_02-b03)
Java HotSpot(TM) Client VM (build 1.4.2_02-b03, mixed mode)
cruella<40> java Test
ThreadGroup=java.lang.ThreadGroup[name=null,maxpri=10]
cruella<41> tjava -version
java version "1.5.0-beta2"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-beta2-b51)
Java HotSpot(TM) Client VM (build 1.5.0-beta2-b51, mixed mode)
cruella<42> tjava Test
ThreadGroup=java.lang.ThreadGroup[name=null,maxpri=10]
cruella<43> java -Xrunhprof Test
HPROF ERROR: unable to resolve a method id
HPROF ERROR: got NULL trace in obj_alloc
HPROF ERROR: duplicate obj_id in object_alloc
HPROF ERROR: unable to resolve a method id
HPROF ERROR: got NULL trace in obj_alloc
HPROF ERROR: unable to resolve a method id
HPROF ERROR: got NULL trace in obj_alloc
HPROF ERROR: unable to resolve a method id
HPROF ERROR: got NULL trace in obj_alloc
HPROF ERROR: unable to resolve a method id
HPROF ERROR: got NULL trace in obj_alloc
HPROF ERROR: class ID already in use

Unexpected Signal : 11 occurred at PC=0xFEE66D68
Function=[Unknown. Nearest: AsyncGetCallTrace+0x2A08C]
Library=/opt/java/j2sdk1.4.2_02/jre/lib/sparc/client/libjvm.so
...
cruella<44> tjava -Xrunhprof Test
#
# An unexpected error has been detected by HotSpot Virtual Machine:
#
#  SIGSEGV (0xb) at pc=0xfeeb76b0, pid=10257, tid=10
#
# Java VM: Java HotSpot(TM) Client VM (1.5.0-beta2-b51 mixed mode)
# Problematic frame:
# V  [libjvm.so+0x2b76b0]
#
ThreadGroup=java.lang.ThreadGroup[name=null,maxpri=10]
# An error report file with more information is saved as hs_err_pid10257.log
#
# If you would like to submit a bug report, please visit:
#   http://java.sun.com/webapps/bugreport/crash.jsp
#
Abort (core dumped)


Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: tiger-rc FIXED IN: tiger-rc INTEGRATED IN: tiger-b56 tiger-rc
12-08-2004

PUBLIC COMMENTS .
12-08-2004

SUGGESTED FIX ------- javaClasses.cpp ------- *** /tmp/geta27372 Wed Aug 11 11:13:07 2004 --- /tmp/getb27372 Wed Aug 11 11:13:07 2004 *************** *** 526,533 **** typeArrayOop java_lang_ThreadGroup::name(oop java_thread_group) { oop name = java_thread_group->obj_field(_name_offset); ! assert(name != NULL, "threadgroups should have a name"); ! return java_lang_String::value(name); } int java_lang_ThreadGroup::nthreads(oop java_thread_group) { --- 526,533 ---- typeArrayOop java_lang_ThreadGroup::name(oop java_thread_group) { oop name = java_thread_group->obj_field(_name_offset); ! // ThreadGroup.name can be null ! return name == NULL ? NULL : java_lang_String::value(name); } int java_lang_ThreadGroup::nthreads(oop java_thread_group) { ###@###.### 2004-08-11
11-08-2004

EVALUATION Legacy java.lang.ThreadGroup allows the name to be null so the vm needs to allow for this. ###@###.### 2004-05-27
27-05-2004