Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-7105883

JDWP: agent crash if there exists a ThreadGroup with null name

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • P3
    • Resolution: Fixed
    • 7, 8
    • 8
    • core-svc
    • b115
    • x86
    • linux

    Description

      FULL PRODUCT VERSION :
      (The issue reproduces with openjdk-6, Sun JDK 1.6_29 and Sun JDK 1.7_01)

      java version "1.7.0_01"
      Java(TM) SE Runtime Environment (build 1.7.0_01-b08)
      Java HotSpot(TM) Server VM (build 21.1-b02, mixed mode)


      FULL OS VERSION :
      2.6.38-12-generic-pae #51-Ubuntu SMP Wed Sep 28 16:11:32 UTC 2011 i686 i686 i386 GNU/Linux

      Distributor ID: Ubuntu
        Description: Ubuntu 11.04
        Release: 11.04
      Codename: natty


      A DESCRIPTION OF THE PROBLEM :
      If a ThreadGroup with a null name is used (ie. new ThreadGroup(null)) and the application is run from inside Eclipse with "Debug" it crashes. It seems that in this case a null pointer is passed to the libc strlen function when the JVM tries to send the threadgroup name. Here is the GDB stacktrace for this case:

      #0 __strlen_sse2_bsf () at ../sysdeps/i386/i686/multiarch/strlen-sse2-bsf.S:52
      No locals.
      #1 0xb71b0283 in outStream_writeString () from /usr/java/jdk1.7.0_01/jre/lib/i386/libjdwp.so
      No symbol table info available.
      #2 0xb719a978 in name () from /usr/java/jdk1.7.0_01/jre/lib/i386/libjdwp.so
      No symbol table info available.
      #3 0xb71a3723 in debugLoop_run () from /usr/java/jdk1.7.0_01/jre/lib/i386/libjdwp.so
      No symbol table info available.
      #4 0xb71b7e6f in connectionInitiated () from /usr/java/jdk1.7.0_01/jre/lib/i386/libjdwp.so
      No symbol table info available.
      #5 0xb71b7eb0 in attachThread () from /usr/java/jdk1.7.0_01/jre/lib/i386/libjdwp.so
      No symbol table info available.
      #6 0xb771f02c in JvmtiAgentThread::call_start_function() () from /usr/java/jdk1.7.0_01/jre/lib/i386/server/libjvm.so
      No symbol table info available.
      #7 0xb791d088 in JavaThread::run() () from /usr/java/jdk1.7.0_01/jre/lib/i386/server/libjvm.so
      No symbol table info available.
      #8 0xb781e821 in java_start(Thread*) () from /usr/java/jdk1.7.0_01/jre/lib/i386/server/libjvm.so
      No symbol table info available.
      #9 0xb7fcae99 in start_thread (arg=0x6f2ffb70) at pthread_create.c:304
              pd = 0x6f2ffb70
              unwind_buf = {cancel_jmp_buf = {{jmp_buf = {-1208111116, 0, 4001536, 1865413784, 1550239239, -86149706}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
              not_first_call = <value optimized out>
              robust = <value optimized out>
              pagesize_m1 = <value optimized out>
              sp = <value optimized out>
              freesize = <value optimized out>
              __PRETTY_FUNCTION__ = "start_thread"
      #10 0xb7f1c73e in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:130
      No locals.

      THE PROBLEM WAS REPRODUCIBLE WITH -Xint FLAG: Yes

      THE PROBLEM WAS REPRODUCIBLE WITH -server FLAG: Yes

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1. Create a new ThreadGroup with null name
      2. Run it under Eclipse with debug

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      Expected: for it to run
      Actual: it crashes
      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      #
      # A fatal error has been detected by the Java Runtime Environment:
      #
      # SIGSEGV (0xb) at pc=0xb75fd706, pid=26238, tid=1857411952
      #
      # JRE version: 7.0_01-b08
      # Java VM: Java HotSpot(TM) Server VM (21.1-b02 mixed mode linux-x86 )
      # Problematic frame:
      # C [libc.so.6+0x7a706] envz_strip+0x4b6
      #
      # Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
      #
      # If you would like to submit a bug report, please visit:
      # http://bugreport.sun.com/bugreport/crash.jsp
      # The crash happened outside the Java Virtual Machine in native code.
      # See problematic frame for where to report the bug.
      #

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

      Current thread (0x6ec41c00): JavaThread "JDWP Transport Listener: dt_socket" daemon [_thread_in_native, id=26255, stack(0x6eb0d000,0x6eb5e000)]

      siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0x00000008

      Registers:
      EAX=0x00000000, EBX=0xb68ff16c, ECX=0x00000000, EDX=0x00000000
      ESP=0x6eb5cd34, EBP=0x6eb5cd78, ESI=0xb68ff5a0, EDI=0x00000000
      EIP=0xb75fd706, EFLAGS=0x00210283, CR2=0x00000008

        Top of Stack: (sp=0x6eb5cd34)
      0x6eb5cd34: 6ec41d20 b68ff5a0 b68e7283 00000000
      0x6eb5cd44: 6ec0b638 6eb5cd9c b68ff16c 6ec0b638
      0x6eb5cd54: 6eb5cf5c 6eb5cd78 b68e435a 00000000
      0x6eb5cd64: 6eb5cdfc 00000000 b68ff16c 6eb5cf5c
      0x6eb5cd74: 6ec41d20 6eb5cdb8 b68d1978 6eb5cdfc
      0x6eb5cd84: 00000000 ffffffff b68ff16c 6eb5cdfc
      0x6eb5cd94: 00000005 6ec0b638 09d405c0 00000000
      0x6eb5cda4: 0000000a 00000000 b68ff16c 0000000c

      Instructions: (pc=0xb75fd706)
      0xb75fd6e6: 0e c3 83 c0 0f c3 90 90 90 90 56 57 8b 7c 24 0c
      0xb75fd6f6: 31 c0 89 f9 83 e1 3f 66 0f ef c0 83 f9 30 77 17
      0xb75fd706: f3 0f 6f 0f 66 0f 74 c1 66 0f d7 d0 85 d2 75 73
      0xb75fd716: 89 f8 83 e0 f0 eb 1a 89 f8 83 e0 f0 66 0f 74 00

      Register to memory mapping:

      EAX=0x00000000 is an unknown value
      EBX=0xb68ff16c: <offset 0x3716c> in /usr/java/jdk1.7.0_01/jre/lib/i386/libjdwp.so at 0xb68c8000
      ECX=0x00000000 is an unknown value
      EDX=0x00000000 is an unknown value
      ESP=0x6eb5cd34 is pointing into the stack for thread: 0x6ec41c00
      EBP=0x6eb5cd78 is pointing into the stack for thread: 0x6ec41c00
      ESI=0xb68ff5a0: <offset 0x375a0> in /usr/java/jdk1.7.0_01/jre/lib/i386/libjdwp.so at 0xb68c8000
      EDI=0x00000000 is an unknown value


      Stack: [0x6eb0d000,0x6eb5e000], sp=0x6eb5cd34, free space=319k
      Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
      C [libc.so.6+0x7a706] envz_strip+0x4b6
      C [libjdwp.so+0x9978] name+0xa8
      C [libjdwp.so+0x12723] debugLoop_run+0x303
      C [libjdwp.so+0x26e6f] connectionInitiated+0xbf
      C [libjdwp.so+0x26eb0] attachThread+0x30
      V [libjvm.so+0x4a302c] JvmtiAgentThread::call_start_function()+0x9c
      V [libjvm.so+0x6a1088] JavaThread::run()+0x178
      V [libjvm.so+0x5a2821] java_start(Thread*)+0x111
      C [libpthread.so.0+0x5e99] start_thread+0xd9


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

      Java Threads: ( => current thread )
        0x6e72e000 JavaThread "ReaderThread" [_thread_in_vm, id=26266, stack(0x6e831000,0x6e882000)]
        0x6ec4ac00 JavaThread "Service Thread" daemon [_thread_blocked, id=26264, stack(0x6e918000,0x6e969000)]
        0x6ec48c00 JavaThread "C2 CompilerThread1" daemon [_thread_blocked, id=26263, stack(0x6e969000,0x6e9ea000)]
        0x6ec46800 JavaThread "C2 CompilerThread0" daemon [_thread_blocked, id=26262, stack(0x6e9ea000,0x6ea6b000)]
        0x09d40800 JavaThread "JDWP Command Reader" daemon [_thread_in_native, id=26259, stack(0x6ea6b000,0x6eabc000)]
        0x6ec44400 JavaThread "JDWP Event Helper Thread" daemon [_thread_blocked, id=26258, stack(0x6eabc000,0x6eb0d000)]
      =>0x6ec41c00 JavaThread "JDWP Transport Listener: dt_socket" daemon [_thread_in_native, id=26255, stack(0x6eb0d000,0x6eb5e000)]
        0x6ec39400 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=26253, stack(0x6eb5e000,0x6ebaf000)]
        0x6ec00c00 JavaThread "Finalizer" daemon [_thread_blocked, id=26252, stack(0x6ebaf000,0x6ec00000)]
        0x09d3b800 JavaThread "Reference Handler" daemon [_thread_blocked, id=26251, stack(0x6ed29000,0x6ed7a000)]
        0x09c6e000 JavaThread "main" [_thread_blocked, id=26244, stack(0xb693c000,0xb698d000)]

      Other Threads:
        0x09d36000 VMThread [stack: 0x6ed7a000,0x6edfb000] [id=26250]
        0x6ec5cc00 WatcherThread [stack: 0x6e897000,0x6e918000] [id=26265]

      VM state:not at safepoint (normal execution)

      VM Mutex/Monitor currently owned by a thread: None

      Heap
       PSYoungGen total 19136K, used 9237K [0x9e050000, 0x9f5a0000, 0xb35a0000)
        eden space 16448K, 56% used [0x9e050000,0x9e955720,0x9f060000)
        from space 2688K, 0% used [0x9f300000,0x9f300000,0x9f5a0000)
        to space 2688K, 0% used [0x9f060000,0x9f060000,0x9f300000)
       PSOldGen total 43712K, used 0K [0x735a0000, 0x76050000, 0x9e050000)
        object space 43712K, 0% used [0x735a0000,0x735a0000,0x76050000)
       PSPermGen total 16384K, used 3759K [0x6f5a0000, 0x705a0000, 0x735a0000)
        object space 16384K, 22% used [0x6f5a0000,0x6f94bfb0,0x705a0000)

      Code Cache [0xb366e000, 0xb38ae000, 0xb666e000)
       total_blobs=146 nmethods=22 adapters=85 free_code_cache=48817Kb largest_free_block=49972352

      Dynamic libraries:
      08048000-08049000 r-xp 00000000 08:08 2758419 /usr/java/jdk1.7.0_01/bin/java
      08049000-0804a000 rw-p 00000000 08:08 2758419 /usr/java/jdk1.7.0_01/bin/java
      09c66000-09e36000 rw-p 00000000 00:00 0 [heap]
      6e500000-6e542000 rw-p 00000000 00:00 0
      6e542000-6e600000 ---p 00000000 00:00 0
      6e65e000-6e661000 ---p 00000000 00:00 0
      6e661000-6e6af000 rw-p 00000000 00:00 0
      6e6af000-6e6b2000 ---p 00000000 00:00 0
      6e6b2000-6e700000 rw-p 00000000 00:00 0
      6e700000-6e7cb000 rw-p 00000000 00:00 0
      6e7cb000-6e800000 ---p 00000000 00:00 0
      6e822000-6e830000 r-xp 00000000 08:08 2882432 /usr/java/jdk1.7.0_01/jre/lib/i386/libnio.so
      6e830000-6e831000 rw-p 0000e000 08:08 2882432 /usr/java/jdk1.7.0_01/jre/lib/i386/libnio.so
      6e831000-6e834000 ---p 00000000 00:00 0
      6e834000-6e882000 rw-p 00000000 00:00 0
      6e882000-6e896000 r-xp 00000000 08:08 2882419 /usr/java/jdk1.7.0_01/jre/lib/i386/libnet.so
      6e896000-6e897000 rw-p 00014000 08:08 2882419 /usr/java/jdk1.7.0_01/jre/lib/i386/libnet.so
      6e897000-6e898000 ---p 00000000 00:00 0
      6e898000-6e918000 rw-p 00000000 00:00 0
      6e918000-6e91b000 ---p 00000000 00:00 0
      6e91b000-6e969000 rw-p 00000000 00:00 0
      6e969000-6e96c000 ---p 00000000 00:00 0
      6e96c000-6e9ea000 rw-p 00000000 00:00 0
      6e9ea000-6e9ed000 ---p 00000000 00:00 0
      6e9ed000-6ea6b000 rw-p 00000000 00:00 0
      6ea6b000-6ea6e000 ---p 00000000 00:00 0
      6ea6e000-6eabc000 rw-p 00000000 00:00 0
      6eabc000-6eabf000 ---p 00000000 00:00 0
      6eabf000-6eb0d000 rw-p 00000000 00:00 0
      6eb0d000-6eb10000 ---p 00000000 00:00 0
      6eb10000-6eb5e000 rw-p 00000000 00:00 0
      6eb5e000-6eb61000 ---p 00000000 00:00 0
      6eb61000-6ebaf000 rw-p 00000000 00:00 0
      6ebaf000-6ebb2000 ---p 00000000 00:00 0
      6ebb2000-6ec00000 rw-p 00000000 00:00 0
      6ec00000-6ecff000 rw-p 00000000 00:00 0
      6ecff000-6ed00000 ---p 00000000 00:00 0
      6ed0b000-6ed11000 r--s 00034000 00:14 5767175 /home/attilab/.m2/repository/junit/junit/4.8.2/junit-4.8.2.jar
      6ed11000-6ed1a000 r--s 0006d000 00:14 5767706 /home/attilab/.m2/repository/log4j/log4j/1.2.16/log4j-1.2.16.jar
      6ed1a000-6ed29000 r--s 0007c000 00:14 1318003 /home/attilab/.m2/repository/joda-time/joda-time/2.0/joda-time-2.0.jar
      6ed29000-6ed2c000 ---p 00000000 00:00 0
      6ed2c000-6ed7a000 rw-p 00000000 00:00 0
      6ed7a000-6ed7b000 ---p 00000000 00:00 0
      6ed7b000-6ee46000 rw-p 00000000 00:00 0
      6ee46000-6f005000 r--s 039fc000 08:08 2758541 /usr/java/jdk1.7.0_01/jre/lib/rt.jar
      6f005000-6f006000 ---p 00000000 00:00 0
      6f006000-6f086000 rw-p 00000000 00:00 0
      6f086000-6f087000 ---p 00000000 00:00 0
      6f087000-6f107000 rw-p 00000000 00:00 0
      6f107000-6f108000 ---p 00000000 00:00 0
      6f108000-6f188000 rw-p 00000000 00:00 0
      6f188000-6f189000 ---p 00000000 00:00 0
      6f189000-6f211000 rw-p 00000000 00:00 0
      6f211000-6f229000 rw-p 00000000 00:00 0
      6f229000-6f23f000 rw-p 00000000 00:00 0
      6f23f000-6f37f000 rw-p 00000000 00:00 0
      6f37f000-6f387000 rw-p 00000000 00:00 0
      6f387000-6f39f000 rw-p 00000000 00:00 0
      6f39f000-6f3b5000 rw-p 00000000 00:00 0
      6f3b5000-6f4f4000 rw-p 00000000 00:00 0
      6f4f4000-6f4ff000 rw-p 00000000 00:00 0
      6f4ff000-6f59f000 rw-p 00000000 00:00 0
      6f59f000-705a0000 rw-p 00000000 00:00 0
      705a0000-735a0000 rw-p 00000000 00:00 0
      735a0000-76050000 rw-p 00000000 00:00 0
      76050000-9e050000 rw-p 00000000 00:00 0
      9e050000-9f5a0000 rw-p 00000000 00:00 0
      9f5a0000-b35a0000 rw-p 00000000 00:00 0
      b35a0000-b35a1000 r--s 00000000 00:14 5649360 /home/attilab/.m2/repository/com/tora/g2/base/base/1.0.0-SNAPSHOT/base-1.0.0-SNAPSHOT.jar
      b35a1000-b35a6000 r--s 00041000 00:14 5767645 /home/attilab/.m2/repository/commons-lang/commons-lang/2.6/commons-lang-2.6.jar
      b35a6000-b35aa000 r--s 00027000 00:14 1318002 /home/attilab/.m2/repository/com/google/code/gson/gson/1.7.1/gson-1.7.1.jar
      b35aa000-b35ad000 r-xp 00000000 08:08 2882431 /usr/java/jdk1.7.0_01/jre/lib/i386/libdt_socket.so
      b35ad000-b35ae000 rw-p 00002000 08:08 2882431 /usr/java/jdk1.7.0_01/jre/lib/i386/libdt_socket.so
      b35ae000-b35b7000 rw-p 00000000 00:00 0
      b35b7000-b366e000 rw-p 00000000 00:00 0
      b366e000-b38ae000 rwxp 00000000 00:00 0
      b38ae000-b666e000 rw-p 00000000 00:00 0
      b666e000-b6685000 r-xp 00000000 08:08 2882421 /usr/java/jdk1.7.0_01/jre/lib/i386/libzip.so
      b6685000-b6686000 rw-p 00017000 08:08 2882421 /usr/java/jdk1.7.0_01/jre/lib/i386/libzip.so
      b6686000-b668e000 rw-s 00000000 08:08 785708 /tmp/hsperfdata_attilab/26238
      b668e000-b6698000 r-xp 00000000 08:08 654959 /lib/i386-linux-gnu/libnss_files-2.13.so
      b6698000-b6699000 r--p 00009000 08:08 654959 /lib/i386-linux-gnu/libnss_files-2.13.so
      b6699000-b669a000 rw-p 0000a000 08:08 654959 /lib/i386-linux-gnu/libnss_files-2.13.so
      b669a000-b66a3000 r-xp 00000000 08:08 654963 /lib/i386-linux-gnu/libnss_nis-2.13.so
      b66a3000-b66a4000 r--p 00008000 08:08 654963 /lib/i386-linux-gnu/libnss_nis-2.13.so
      b66a4000-b66a5000 rw-p 00009000 08:08 654963 /lib/i386-linux-gnu/libnss_nis-2.13.so
      b66a5000-b66b8000 r-xp 00000000 08:08 654953 /lib/i386-linux-gnu/libnsl-2.13.so
      b66b8000-b66b9000 r--p 00012000 08:08 654953 /lib/i386-linux-gnu/libnsl-2.13.so
      b66b9000-b66ba000 rw-p 00013000 08:08 654953 /lib/i386-linux-gnu/libnsl-2.13.so
      b66ba000-b66bc000 rw-p 00000000 00:00 0
      b66bc000-b66c2000 r-xp 00000000 08:08 654955 /lib/i386-linux-gnu/libnss_compat-2.13.so
      b66c2000-b66c3000 r--p 00005000 08:08 654955 /lib/i386-linux-gnu/libnss_compat-2.13.so
      b66c3000-b66c4000 rw-p 00006000 08:08 654955 /lib/i386-linux-gnu/libnss_compat-2.13.so
      b66c4000-b66c5000 r--p 002a1000 08:08 923638 /usr/lib/locale/locale-archive
      b66c5000-b68c5000 r--p 00000000 08:08 923638 /usr/lib/locale/locale-archive
      b68c5000-b68c7000 r-xp 00000000 08:08 2882436 /usr/java/jdk1.7.0_01/jre/lib/i386/libnpt.so
      b68c7000-b68c8000 rw-p 00002000 08:08 2882436 /usr/java/jdk1.7.0_01/jre/lib/i386/libnpt.so
      b68c8000-b68ff000 r-xp 00000000 08:08 2882427 /usr/java/jdk1.7.0_01/jre/lib/i386/libjdwp.so
      b68ff000-b6900000 rw-p 00037000 08:08 2882427 /usr/java/jdk1.7.0_01/jre/lib/i386/libjdwp.so
      b6900000-b6901000 rw-p 00000000 00:00 0
      b6901000-b6902000 r--p 00000000 00:00 0
      b6902000-b6925000 r-xp 00000000 08:08 2882456 /usr/java/jdk1.7.0_01/jre/lib/i386/libjava.so
      b6925000-b6926000 rw-p 00022000 08:08 2882456 /usr/java/jdk1.7.0_01/jre/lib/i386/libjava.so
      b6926000-b6932000 r-xp 00000000 08:08 2882461 /usr/java/jdk1.7.0_01/jre/lib/i386/libverify.so
      b6932000-b6933000 rw-p 0000c000 08:08 2882461 /usr/java/jdk1.7.0_01/jre/lib/i386/libverify.so
      b6933000-b693a000 r-xp 00000000 08:08 654982 /lib/i386-linux-gnu/librt-2.13.so
      b693a000-b693b000 r--p 00006000 08:08 654982 /lib/i386-linux-gnu/librt-2.13.so
      b693b000-b693c000 rw-p 00007000 08:08 654982 /lib/i386-linux-gnu/librt-2.13.so
      b693c000-b693f000 ---p 00000000 00:00 0
      b693f000-b698d000 rw-p 00000000 00:00 0
      b698d000-b69b1000 r-xp 00000000 08:08 654950 /lib/i386-linux-gnu/libm-2.13.so
      b69b1000-b69b2000 r--p 00023000 08:08 654950 /lib/i386-linux-gnu/libm-2.13.so
      b69b2000-b69b3000 rw-p 00024000 08:08 654950 /lib/i386-linux-gnu/libm-2.13.so
      b69b3000-b7117000 r-xp 00000000 08:08 2882445 /usr/java/jdk1.7.0_01/jre/lib/i386/server/libjvm.so
      b7117000-b7162000 rw-p 00763000 08:08 2882445 /usr/java/jdk1.7.0_01/jre/lib/i386/server/libjvm.so
      b7162000-b7583000 rw-p 00000000 00:00 0
      b7583000-b76dd000 r-xp 00000000 08:08 654913 /lib/i386-linux-gnu/libc-2.13.so
      b76dd000-b76de000 ---p 0015a000 08:08 654913 /lib/i386-linux-gnu/libc-2.13.so
      b76de000-b76e0000 r--p 0015a000 08:08 654913 /lib/i386-linux-gnu/libc-2.13.so
      b76e0000-b76e1000 rw-p 0015c000 08:08 654913 /lib/i386-linux-gnu/libc-2.13.so
      b76e1000-b76e4000 rw-p 00000000 00:00 0
      b76e4000-b76e6000 r-xp 00000000 08:08 654923 /lib/i386-linux-gnu/libdl-2.13.so
      b76e6000-b76e7000 r--p 00001000 08:08 654923 /lib/i386-linux-gnu/libdl-2.13.so
      b76e7000-b76e8000 rw-p 00002000 08:08 654923 /lib/i386-linux-gnu/libdl-2.13.so
      b76e8000-b76fb000 r-xp 00000000 08:08 2882455 /usr/java/jdk1.7.0_01/jre/lib/i386/jli/libjli.so
      b76fb000-b76fc00


      ( This report has more than 16,000 characters and has been truncated. )

      Attachments

        Activity

          People

            egahlin Erik Gahlin
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: