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

dtrace jstack action is broken

    Details

    • Subcomponent:
      svc
    • Resolved In Build:
      b28
    • CPU:
      generic
    • OS:
      solaris

      Backports

        Description

        The DTrace jstack action support (HotSpot jhelper.d) is currently broken on both JDK 7 and 8.

        This is more complete picture:
        It is broken in the jdk 7 builds: b00 - b06
        It works Ok in the jdk 7 builds: b07 - b99
        It does not work in the jdk 7 updates.
        It does not work in the jdk 8.
        It works Ok in the jdk 6 updates: 01-24
        It does not work in the jdk 6 update 24 and later.



        It worked fine for JDK 7 build 99 (for instance, look at the dtst2.method* methods in the jstack output):

        -----------

        sspitsyn@hsdev-10 cd /java/svc/ss45998/dtrace/tests
        sspitsyn@hsdev-10 run dtst2 -jdk /java/re/j2se/1.7.0/promoted/all/b99/binaries/solaris-i586/
        TESTED_SDK = /java/re/j2se/1.7.0/promoted/all/b99/binaries/solaris-i586/

        run7 dtst2 -jdk /java/re/j2se/1.7.0/promoted/all/b99/binaries/solaris-i586/ [BEG: Mon Jul 30 16:27:22 PDT 2012]
        . . .
        /java/re/j2se/1.7.0/promoted/all/b99/binaries/solaris-i586//bin/java dtst2
        [1] 9025
        Start
        pid1 = 9025
        [2] 9028
        pid2 = 9028
        dtrace: script '/java/svc/ss45998/dtrace/tests/dtst/helpme0.d' matched 235 probes
        CPU ID FUNCTION:NAME
          5 1 :BEGIN
                BEGIN: tid: 1
                      libc.so.1`ioctl+0xa
                      libdtrace.so.1`dtrace_go+0x85
                      dtrace`go+0x1e4
                      dtrace`main+0x720
                      dtrace`_start+0x6c

          0 45748 pollsys:entry
                tid: 2
                      libc.so.1`__pollsys+0x7
                      libc.so.1`poll+0x52
                      libjvm.so`__1cCosFsleep6FpnGThread_xb_i_+0x8ef
                      libjvm.so`JVM_Sleep+0x224
                      java/lang/Thread.sleep(J)V
                      dtst2.method8(I)I
                      dtst2.method7(I)I
                      dtst2.method6(I)I
                      dtst2.method5(I)I
                      dtst2.method4(I)I
                      dtst2.method3(I)I
                      dtst2.method2(I)I
                      dtst2.method1(I)I
                      dtst2.main([Ljava/lang/String;)V
                      StubRoutines (1)
                      libjvm.so`__1cJJavaCallsLcall_helper6FpnJJavaValue_pnMmethodHandle_pnRJavaCallArguments_pnGThread__v_+0x513
                      libjvm.so`__1cCosUos_exception_wrapper6FpFpnJJavaValue_pnMmethodHandle_pnRJavaCallArguments_pnGThread__v2468_v_+0x17
                      libjvm.so`__1cJJavaCallsEcall6FpnJJavaValue_nMmethodHandle_pnRJavaCallArguments_pnGThread__v_+0x2f
                      libjvm.so`jni_CallStaticVoidMethod+0x3f4
                      libjli.so`JavaMain+0x88f
                      libc.so.1`_thr_setup+0x4e
                      libc.so.1`_lwp_start

          1 45748 pollsys:entry
                tid: 2
                      libc.so.1`__pollsys+0x7
                      libc.so.1`poll+0x52
                      libjvm.so`__1cCosFsleep6FpnGThread_xb_i_+0x8ef
                      libjvm.so`JVM_Sleep+0x224
                      java/lang/Thread.sleep(J)V
                      dtst2.method8(I)I
                      dtst2.method7(I)I
                      dtst2.method6(I)I
                      dtst2.method5(I)I
                      dtst2.method4(I)I
                      dtst2.method3(I)I
                      dtst2.method2(I)I
                      dtst2.method1(I)I
                      dtst2.main([Ljava/lang/String;)V
                      StubRoutines (1)
                      libjvm.so`__1cJJavaCallsLcall_helper6FpnJJavaValue_pnMmethodHandle_pnRJavaCallArguments_pnGThread__v_+0x513
                      libjvm.so`__1cCosUos_exception_wrapper6FpFpnJJavaValue_pnMmethodHandle_pnRJavaCallArguments_pnGThread__v2468_v_+0x17
                      libjvm.so`__1cJJavaCallsEcall6FpnJJavaValue_nMmethodHandle_pnRJavaCallArguments_pnGThread__v_+0x2f
                      libjvm.so`jni_CallStaticVoidMethod+0x3f4
                      libjli.so`JavaMain+0x88f
                      libc.so.1`_thr_setup+0x4e
                      libc.so.1`_lwp_start

          1 45748 pollsys:entry
                tid: 2
                      libc.so.1`__pollsys+0x7
                      libc.so.1`poll+0x52
                      libjvm.so`__1cCosFsleep6FpnGThread_xb_i_+0x8ef
                      libjvm.so`JVM_Sleep+0x224
                      java/lang/Thread.sleep(J)V
                      dtst2.method8(I)I
                      dtst2.method7(I)I
                      dtst2.method6(I)I
                      dtst2.method5(I)I
                      dtst2.method4(I)I
                      dtst2.method3(I)I
                      dtst2.method2(I)I
                      dtst2.method1(I)I
                      dtst2.main([Ljava/lang/String;)V
                      StubRoutines (1)
                      libjvm.so`__1cJJavaCallsLcall_helper6FpnJJavaValue_pnMmethodHandle_pnRJavaCallArguments_pnGThread__v_+0x513
                      libjvm.so`__1cCosUos_exception_wrapper6FpFpnJJavaValue_pnMmethodHandle_pnRJavaCallArguments_pnGThread__v2468_v_+0x17
                      libjvm.so`__1cJJavaCallsEcall6FpnJJavaValue_nMmethodHandle_pnRJavaCallArguments_pnGThread__v_+0x2f
                      libjvm.so`jni_CallStaticVoidMethod+0x3f4
                      libjli.so`JavaMain+0x88f
                      libc.so.1`_thr_setup+0x4e
                      libc.so.1`_lwp_start

          1 45748 pollsys:entry
                tid: 2 - d-script exit(0)
          7 2 :END
                END: tid: 1
                      libc.so.1`ioctl+0xa
                      libdtrace.so.1`dtrace_stop+0x56
                      libdtrace.so.1`dtrace_status+0x170
                      libdtrace.so.1`dtrace_work+0x31
                      dtrace`main+0x902
                      dtrace`_start+0x6c


        [2] - Done /java/svc/ss45998/dtrace/tests/dtst/helpme0.d 9025
        -------------


        However, the java frames are not translated well to symolic names for 7u1:


        -------------
        sspitsyn@hsdev-10 cd /java/svc/ss45998/dtrace/tests
        sspitsyn@hsdev-10 run dtst2 -jdk /java/re/j2se/1.7.0_01/promoted/latest/binaries/solaris-i586/
        TESTED_SDK = /java/re/j2se/1.7.0_01/promoted/latest/binaries/solaris-i586/

        run7 dtst2 -jdk /java/re/j2se/1.7.0_01/promoted/latest/binaries/solaris-i586/ [BEG: Mon Jul 30 17:07:35 PDT 2012]
        . . .
        [1] 9075
        Start
        pid1 = 9075
        [2] 9078
        pid2 = 9078
        dtrace: script '/java/svc/ss45998/dtrace/tests/dtst/helpme0.d' matched 235 probes
        CPU ID FUNCTION:NAME
          3 1 :BEGIN
                BEGIN: tid: 1
                      libc.so.1`ioctl+0xa
                      libdtrace.so.1`dtrace_go+0x85
                      dtrace`go+0x1e4
                      dtrace`main+0x720
                      dtrace`_start+0x6c

          7 45748 pollsys:entry
                tid: 2
                      libc.so.1`__pollsys+0x7
                      libc.so.1`poll+0x52
                      libjvm.so`__1cCosFsleep6FpnGThread_xb_i_+0x5ff
                      libjvm.so`JVM_Sleep+0x226
                      0xfac0a972
                      0xfac0357b
                      0xfac03433
                      0xfac03433
                      0xfac03433
                      0xfac03433
                      0xfac03433
                      0xfac03433
                      0xfac03433
                      0xfac03433
                      0xfac003d1
                      libjvm.so`__1cJJavaCallsLcall_helper6FpnJJavaValue_pnMmethodHandle_pnRJavaCallArguments_pnGThread__v_+0x52f
                      libjvm.so`__1cCosUos_exception_wrapper6FpFpnJJavaValue_pnMmethodHandle_pnRJavaCallArguments_pnGThread__v2468_v_+0x18
                      libjvm.so`__1cJJavaCallsEcall6FpnJJavaValue_nMmethodHandle_pnRJavaCallArguments_pnGThread__v_+0x31
                      libjvm.so`jni_CallStaticVoidMethod+0x4cd
                      libjli.so`JavaMain+0x522
                      libc.so.1`_thr_setup+0x4e
                      libc.so.1`_lwp_start

          7 45748 pollsys:entry
                tid: 2
                      libc.so.1`__pollsys+0x7
                      libc.so.1`poll+0x52
                      libjvm.so`__1cCosFsleep6FpnGThread_xb_i_+0x5ff
                      libjvm.so`JVM_Sleep+0x226
                      0xfac0a972
                      0xfac0357b
                      0xfac03433
                      0xfac03433
                      0xfac03433
                      0xfac03433
                      0xfac03433
                      0xfac03433
                      0xfac03433
                      0xfac03433
                      0xfac003d1
                      libjvm.so`__1cJJavaCallsLcall_helper6FpnJJavaValue_pnMmethodHandle_pnRJavaCallArguments_pnGThread__v_+0x52f
                      libjvm.so`__1cCosUos_exception_wrapper6FpFpnJJavaValue_pnMmethodHandle_pnRJavaCallArguments_pnGThread__v2468_v_+0x18
                      libjvm.so`__1cJJavaCallsEcall6FpnJJavaValue_nMmethodHandle_pnRJavaCallArguments_pnGThread__v_+0x31
                      libjvm.so`jni_CallStaticVoidMethod+0x4cd
                      libjli.so`JavaMain+0x522
                      libc.so.1`_thr_setup+0x4e
                      libc.so.1`_lwp_start

          7 45748 pollsys:entry
                tid: 2 - d-script exit(0)
          2 2 :END
                END: tid: 1
                      libc.so.1`ioctl+0xa
                      libdtrace.so.1`dtrace_stop+0x56
                      libdtrace.so.1`dtrace_status+0x170
                      libdtrace.so.1`dtrace_work+0x31
                      dtrace`main+0x902
                      dtrace`_start+0x6c


        [2] - Done /java/svc/ss45998/dtrace/tests/dtst/helpme0.d 9075
        -----------


        The DTrace jstack support is broken on the JDK 8 as well:

        sspitsyn@hsdev-10 cd /java/svc/ss45998/dtrace/tests
        sspitsyn@hsdev-10 run dtst2 -jdk /java/re/j2se/1.8.0/promoted/latest/binaries/solaris-i586
        TESTED_SDK = /java/re/j2se/1.8.0/promoted/latest/binaries/solaris-i586

        run dtst2 -jdk /java/re/j2se/1.8.0/promoted/latest/binaries/solaris-i586 [BEG: Mon Jul 30 17:50:19 PDT 2012]
        . . .
        [1] 9120
        Start
        pid1 = 9120
        [2] 9123
        pid2 = 9123
        dtrace: script '/java/svc/ss45998/dtrace/tests/dtst/helpme0.d' matched 235 probes
        CPU ID FUNCTION:NAME
          4 1 :BEGIN
                BEGIN: tid: 1
                      libc.so.1`ioctl+0xa
                      libdtrace.so.1`dtrace_go+0x85
                      dtrace`go+0x1e4
                      dtrace`main+0x720
                      dtrace`_start+0x6c

          7 45748 pollsys:entry
                tid: 2
                      libc.so.1`__pollsys+0x7
                      libc.so.1`poll+0x52
                      libjvm.so`__1cCosFsleep6FpnGThread_xb_i_+0x5fc
                      libjvm.so`JVM_Sleep+0x226
                      0xf7a0af6b
                      0xf7a036fb
                      0xf7a035b3
                      0xf7a035b3
                      0xf7a035b3
                      0xf7a035b3
                      0xf7a035b3
                      0xf7a035b3
                      0xf7a035b3
                      0xf7a035b3
                      0xf7a00451
                      libjvm.so`__1cJJavaCallsLcall_helper6FpnJJavaValue_pnMmethodHandle_pnRJavaCallArguments_pnGThread__v_+0x545
                      libjvm.so`__1cCosUos_exception_wrapper6FpFpnJJavaValue_pnMmethodHandle_pnRJavaCallArguments_pnGThread__v2468_v_+0x18
                      libjvm.so`__1cJJavaCallsEcall6FpnJJavaValue_nMmethodHandle_pnRJavaCallArguments_pnGThread__v_+0x31
                      libjvm.so`jni_CallStaticVoidMethod+0x4d6
                      libjli.so`JavaMain+0x53d
                      libc.so.1`_thr_setup+0x4e
                      libc.so.1`_lwp_start

          7 45748 pollsys:entry
                tid: 2
                      libc.so.1`__pollsys+0x7
                      libc.so.1`poll+0x52
                      libjvm.so`__1cCosFsleep6FpnGThread_xb_i_+0x5fc
                      libjvm.so`JVM_Sleep+0x226
                      0xf7a0af6b
                      0xf7a036fb
                      0xf7a035b3
                      0xf7a035b3
                      0xf7a035b3
                      0xf7a035b3
                      0xf7a035b3
                      0xf7a035b3
                      0xf7a035b3
                      0xf7a035b3
                      0xf7a00451
                      libjvm.so`__1cJJavaCallsLcall_helper6FpnJJavaValue_pnMmethodHandle_pnRJavaCallArguments_pnGThread__v_+0x545
                      libjvm.so`__1cCosUos_exception_wrapper6FpFpnJJavaValue_pnMmethodHandle_pnRJavaCallArguments_pnGThread__v2468_v_+0x18
                      libjvm.so`__1cJJavaCallsEcall6FpnJJavaValue_nMmethodHandle_pnRJavaCallArguments_pnGThread__v_+0x31
                      libjvm.so`jni_CallStaticVoidMethod+0x4d6
                      libjli.so`JavaMain+0x53d
                      libc.so.1`_thr_setup+0x4e
                      libc.so.1`_lwp_start

          7 45748 pollsys:entry
                tid: 2 - d-script exit(0)
          1 2 :END
                END: tid: 1
                      libc.so.1`ioctl+0xa
                      libdtrace.so.1`dtrace_stop+0x56
                      libdtrace.so.1`dtrace_status+0x170
                      libdtrace.so.1`dtrace_work+0x31
                      dtrace`main+0x902
                      dtrace`_start+0x6c


        [2] - Done /java/svc/ss45998/dtrace/tests/dtst/helpme0.d 9120

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  sspitsyn Serguei Spitsyn
                  Reporter:
                  sspitsyn Serguei Spitsyn
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  6 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Imported:
                    Indexed: