JDK-4301697 : JVMDI: SuspendThread does not check for null thread reference
  • Type: Bug
  • Component: core-svc
  • Sub-Component: debugger
  • Affected Version: 1.3.0
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 1999-12-24
  • Updated: 2000-02-19
  • Resolved: 2000-02-19
Related Reports
Duplicate :  
Description

Name: icC57033			Date: 12/23/99


Classic VM 1.3fcs-R (both Solaris and WinNT) fails test
	nsk/jvmdi/SuspendThread/suspthread002
from
	testbase_nsk
Classic VM crashs.

To reproduce the bug run Korn shell script
	doit.ksh <jdk_root_directory> 
in
	/net/sqesvr/vsn/GammaBase/Bugs/<this bug number>

Running on HS 1.3fcs-R the test outputs:
1) Solaris
-------------------------- java ---------------------------------
Setting suspthread002_EventHook as event hook.
######## JVMDI_EVENT_VM_INIT ########
Error call to SuspendThread(NULL)
        error: JVMDI_ERROR_NULL_POINTER
######## JVMDI_EVENT_VM_DEATH ########
exit 97
-------------------------- java_g -------------------------------
Setting suspthread002_EventHook as event hook.
######## JVMDI_EVENT_VM_INIT ########
#
# HotSpot Virtual Machine Error, assertion failure
#
# assert(((jvmdiError)100) == ((jvmdiError)0), "not JVMDI_ERROR_NONE")
#
# Error ID: 
/usr/re/hotsparc_client1.3/ws/solsparc/hotsparc_client1.3fcs/build/solaris/.../..
/src/share/vm/prims/jvmdi.cpp, 1765 [ Patched ]
#
Dumping core....
../doit.ksh[48]: 2798 Abort
exit 134
-------------------------- java -classic ------------------------
Setting suspthread002_EventHook as event hook.
######## JVMDI_EVENT_VM_INIT ########
SIGSEGV   11*  segmentation violation
    si_signo [11]: SIGSEGV   11*  segmentation violation
    si_errno [0]: Error 0
    si_code [1]: SEGV_MAPERR [addr: 0x0]

        stackpointer=ffbedc3c

Full thread dump Classic VM (1.3.0-R, green threads):
    "Thread-0" (TID:0xfb8a00c0, sys_thread_t:0x124c28, state:S) prio=5
        at java.lang.Object.wait(Native Method)
        at java.lang.Object.wait(Object.java:420)
        at suspthread002a.run(suspthread002.java:86)
    "Finalizer" (TID:0xfb898528, sys_thread_t:0x6cf20, state:CW) prio=8
        at java.lang.Object.wait(Native Method)
        at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108)
        at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123)
        at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162)
    "Reference Handler" (TID:0xfb898300, sys_thread_t:0x6b7e0, state:CW) prio=10
        at java.lang.Object.wait(Native Method)
        at java.lang.Object.wait(Object.java:420)
        at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110)
    "Signal dispatcher" (TID:0xfb898330, sys_thread_t:0x673b0, state:CW) prio=5
    "main" (TID:0xfb8981a0, sys_thread_t:0x26378, state:R) prio=5
        at suspthread002.suspthread002SuspendThread(Native Method)
        at suspthread002.tryallsusp(suspthread002.java:60)
        at suspthread002.run(suspthread002.java:29)
        at suspthread002.main(suspthread002.java:23)
Monitor Cache Dump:
    java.lang.Object@FB8A00C8/FB90C4B8: owner "main" (0x26378) 1 entry
        Waiting to be notified:
            "Thread-0" (0x124c28)
    java.lang.ref.ReferenceQueue$Lock@FB898540/FB8CE7A8: <unowned>
        Waiting to be notified:
            "Finalizer" (0x6cf20)
    java.lang.ref.Reference$Lock@FB898310/FB8CE2B0: <unowned>
        Waiting to be notified:
            "Reference Handler" (0x6b7e0)
Registered Monitor Dump:
    utf8 hash table: <unowned>
    JNI pinning lock: <unowned>
    JNI global reference lock: <unowned>
    BinClass lock: <unowned>
    Class linking lock: <unowned>
    System class loader lock: <unowned>
    Code rewrite lock: <unowned>
    Heap lock: <unowned>
    Monitor cache lock: owner "main" (0x26378) 1 entry
    Dynamic loading lock: <unowned>
    Monitor IO lock: <unowned>
    User signal monitor: <unowned>
        Waiting to be notified:
            "Signal dispatcher" (0x673b0)
    Child death monitor: <unowned>
    I/O monitor: <unowned>
    Alarm monitor: <unowned>
        Waiting to be notified:
            <unknown thread> (0x27248)
    Thread queue lock: owner "main" (0x26378) 1 entry
    Monitor registry: owner "main" (0x26378) 1 entry

SIGABRT   6*   abort (generated by abort(3) routine)
    si_signo [6]: SIGABRT   6*   abort (generated by abort(3) routine)
    si_errno [0]: Error 0
    si_code [0]: SI_USER [pid: 2809, uid: 1174]
        stackpointer=ffbedc3c

Full thread dump Classic VM (1.3.0-R, green threads):
    "Thread-0" (TID:0xfb8a00c0, sys_thread_t:0x124c28, state:S) prio=5
        at java.lang.Object.wait(Native Method)
        at java.lang.Object.wait(Object.java:420)
        at suspthread002a.run(suspthread002.java:86)
    "Finalizer" (TID:0xfb898528, sys_thread_t:0x6cf20, state:CW) prio=8
        at java.lang.Object.wait(Native Method)
        at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108)
        at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123)
        at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162)
    "Reference Handler" (TID:0xfb898300, sys_thread_t:0x6b7e0, state:CW) prio=10
        at java.lang.Object.wait(Native Method)
        at java.lang.Object.wait(Object.java:420)
        at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110)
    "Signal dispatcher" (TID:0xfb898330, sys_thread_t:0x673b0, state:CW) prio=5
    "main" (TID:0xfb8981a0, sys_thread_t:0x26378, state:R) prio=5
        at suspthread002.suspthread002SuspendThread(Native Method)
        at suspthread002.tryallsusp(suspthread002.java:60)
        at suspthread002.run(suspthread002.java:29)
        at suspthread002.main(suspthread002.java:23)
Monitor Cache Dump:
    java.lang.Object@FB8A00C8/FB90C4B8: owner "main" (0x26378) 1 entry
        Waiting to be notified:
            "Thread-0" (0x124c28)
    java.lang.ref.ReferenceQueue$Lock@FB898540/FB8CE7A8: <unowned>
        Waiting to be notified:
            "Finalizer" (0x6cf20)
    java.lang.ref.Reference$Lock@FB898310/FB8CE2B0: <unowned>
        Waiting to be notified:
            "Reference Handler" (0x6b7e0)
Registered Monitor Dump:
    utf8 hash table: <unowned>
    JNI pinning lock: <unowned>
    JNI global reference lock: <unowned>
    BinClass lock: <unowned>
    Class linking lock: <unowned>
    System class loader lock: <unowned>
    Code rewrite lock: <unowned>
    Heap lock: <unowned>
    Monitor cache lock: owner "main" (0x26378) 1 entry
    Dynamic loading lock: <unowned>
    Monitor IO lock: <unowned>
    User signal monitor: <unowned>
        Waiting to be notified:
            "Signal dispatcher" (0x673b0)
    Child death monitor: <unowned>
    I/O monitor: <unowned>
    Alarm monitor: <unowned>
        Waiting to be notified:
            <unknown thread> (0x27248)
    Thread queue lock: owner "main" (0x26378) 1 entry
    Monitor registry: owner "main" (0x26378) 1 entry

../doit.ksh[52]: 2809 Abort
exit 134

2) WinNT
-------------------------- java ---------------------------------
Setting suspthread002_EventHook as event hook.
######## JVMDI_EVENT_VM_INIT ########
Error call to SuspendThread(NULL)
        error: JVMDI_ERROR_NULL_POINTER
######## JVMDI_EVENT_VM_DEATH ########
exit 97
-------------------------- java_g -------------------------------
Setting suspthread002_EventHook as event hook.
######## JVMDI_EVENT_VM_INIT ########
#
# HotSpot Virtual Machine Error, assertion failure
#
# assert(((jvmdiError)100) == ((jvmdiError)0), "not JVMDI_ERROR_NONE")
#
# Error ID: C:/hotspot\src\share\vm\prims\jvmdi.cpp, 1645
#
exit 1
-------------------------- java -classic ------------------------
Setting suspthread002_EventHook as event hook.
######## JVMDI_EVENT_VM_INIT ########
[1] + Done(139) ?
  238   Segmentation violation  s:/ld24/java/hotspot/jdk1.3.0/win32/bin/java
exit 139

======================================================================

Comments
EVALUATION jvmdi_SuspendThread needs a NOT_NULL(threadObj) to guard against bad input. gordon.hirsch@eng 2000-01-03
03-01-2000