United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-5053405 : GetThreadGroupInfo crashes if Thread Group name is null (jvmpi too)

Details
Type:
Bug
Submit Date:
2004-05-26
Status:
Resolved
Updated Date:
2004-06-15
Project Name:
JDK
Resolved Date:
2004-06-15
Component:
hotspot
OS:
generic
Sub-Component:
jvmti
CPU:
generic
Priority:
P3
Resolution:
Fixed
Affected Versions:
1.4.2_03,5.0
Fixed Versions:
5.0 (b56)

Related Reports
Relates:

Sub Tasks

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
PUBLIC COMMENTS

.
                                     
2004-08-12
CONVERTED DATA

BugTraq+ Release Management Values

COMMIT TO FIX:
tiger-rc

FIXED IN:
tiger-rc

INTEGRATED IN:
tiger-b56
tiger-rc


                                     
2004-08-12
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
                                     
2004-08-11
EVALUATION

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



Hardware and Software, Engineered to Work Together