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

Jstack seems to output unnecessary information in 7u9

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: hs22, hs23, hs24, hs25
    • Fix Version/s: 8
    • Component/s: hotspot
    • Environment:

      JDK: 7u9 server
      E:\export2\java\>java -server -version
      java version "1.7.0_09"
      Java(TM) SE Runtime Environment (build 1.7.0_09-b05)
      Java HotSpot(TM) Server VM (build 23.5-b02, mixed mode)

      OS : WindowsXP/Windows2008

    • Subcomponent:
      svc
    • Introduced In Build:
      b06
    • Introduced In Version:
    • Resolved In Build:
      b79
    • CPU:
      x86
    • OS:
      windows_xp

      Backports

        Description

        jstack command seems to output deoptimization inf.
        Those inf. does not seem related to stack inf. and should not be output in jstack.


        REPRODUCE:
        1. Run SwingSet2.jar

           E:\export2\java\jdk7u9\demo\jfc\SwingSet2> java -server -jar SwingSet2.jar

        2. Run jps in another command prompt and check the pid of SwinfSet2.jar

            E:\export2\java>jps -l
            3268 SwingSet2.jar
            620 sun.tools.jps.Jps

        3. Run jstack

           E:\export2\java>jstack -F -l 3268

        The following messages will shows up.


        Attaching to process ID 3268, please wait...
        Debugger attached successfully.
        Server compiler detected.
        JVM version is 23.5-b02
        Deadlock Detection:

        No deadlocks found.

        none
        null_check
        null_assert
        range_check
        class_check
        array_check
        intrinsic
        bimorphic
        unloaded
        uninitialized
        unreached
        unhandled
        constraint
        div0_check
        age
        predicate
        loop_limit_check
        Finding object size using Printezis bits and skipping over...
        Finding object size using Printezis bits and skipping over...
        Thread 20: (state = BLOCKED)
         - sun.misc.Unsafe.park(boolean, long) @bci=0 (Interpreted frame)
         - java.util.concurrent.locks.LockSupport.park(java.lang.Object) @bci=14, line=186 (Interpreted frame)
         - java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await() @bci=42, line=2043 (Interpreted frame)
         - java.util.concurrent.LinkedBlockingQueue.take() @bci=29, line=442 (Interpreted frame)
         - java.util.concurrent.ThreadPoolExecutor.getTask() @bci=156, line=1043 (Interpreted frame)
         - java.util.concurrent.ThreadPoolExecutor.runWorker(java.util.concurrent.ThreadPoolExecutor$Worker) @bci=17, line=1103 (Interpreted frame)
         - java.util.concurrent.ThreadPoolExecutor$Worker.run() @bci=5, line=603 (Interpreted frame)
         - java.lang.Thread.run() @bci=11, line=722 (Interpreted frame)

        Locked ownable synchronizers:
            - None

        Thread 1: (state = BLOCKED)

        Locked ownable synchronizers:
            - None

        Thread 19: (state = BLOCKED)
         - sun.misc.Unsafe.park(boolean, long) @bci=0 (Interpreted frame)
         - java.util.concurrent.locks.LockSupport.park(java.lang.Object) @bci=14, line=186 (Interpreted frame)
         - java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await() @bci=42, line=2043 (Interpreted frame)
         - java.awt.EventQueue.getNextEvent() @bci=48, line=531 (Compiled frame)
         - java.awt.EventDispatchThread.pumpOneEventForFilters(int) @bci=51, line=213 (Compiled frame)
         - java.awt.EventDispatchThread.pumpEventsForFilter(int, java.awt.Conditional, java.awt.EventFilter) @bci=48, line=163 (Compiled frame)
         - java.awt.EventDispatchThread.pumpEventsForHierarchy(int, java.awt.Conditional, java.awt.Component) @bci=11, line=151 (Interpreted frame)
         - java.awt.EventDispatchThread.pumpEvents(int, java.awt.Conditional) @bci=4, line=147 (Interpreted frame)
         - java.awt.EventDispatchThread.pumpEvents(java.awt.Conditional) @bci=3, line=139 (Interpreted frame)
         - java.awt.EventDispatchThread.run() @bci=9, line=97 (Interpreted frame)

        Locked ownable synchronizers:
            - None

        Thread 18: (state = BLOCKED)
         - java.lang.Object.wait(long) @bci=0 (Interpreted frame)
         - java.lang.Object.wait() @bci=2, line=503 (Interpreted frame)
         - sun.awt.AWTAutoShutdown.run() @bci=32, line=287 (Interpreted frame)
         - java.lang.Thread.run() @bci=11, line=722 (Interpreted frame)

        Locked ownable synchronizers:
            - None

        Thread 17: (state = BLOCKED)
         - sun.misc.Unsafe.park(boolean, long) @bci=0 (Interpreted frame)
         - java.util.concurrent.locks.LockSupport.park(java.lang.Object) @bci=14, line=186 (Interpreted frame)
         - java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await() @bci=42, line=2043 (Interpreted frame)
         - java.util.concurrent.DelayQueue.take() @bci=28, line=209 (Interpreted frame)
         - javax.swing.TimerQueue.run() @bci=20, line=171 (Interpreted frame)
         - java.lang.Thread.run() @bci=11, line=722 (Interpreted frame)

        Locked ownable synchronizers:
            - <0x082d5f38>, (a java/util/concurrent/locks/ReentrantLock$NonfairSync)

        Thread 16: (state = IN_NATIVE)
         - sun.awt.windows.WToolkit.eventLoop() @bci=0 (Interpreted frame)
         - sun.awt.windows.WToolkit.run() @bci=49, line=299 (Interpreted frame)
         - java.lang.Thread.run() @bci=11, line=722 (Interpreted frame)

        Locked ownable synchronizers:
            - None

        Thread 15: (state = BLOCKED)
         - java.lang.Object.wait(long) @bci=0 (Interpreted frame)
         - java.lang.ref.ReferenceQueue.remove(long) @bci=44, line=135 (Interpreted frame)
         - java.lang.ref.ReferenceQueue.remove() @bci=2, line=151 (Interpreted frame)
         - sun.java2d.Disposer.run() @bci=3, line=145 (Interpreted frame)
         - java.lang.Thread.run() @bci=11, line=722 (Interpreted frame)

        Locked ownable synchronizers:
            - None

        Thread 10: (state = BLOCKED)

        Locked ownable synchronizers:
            - None

        Thread 9: (state = BLOCKED)

        Locked ownable synchronizers:
            - None

        Thread 8: (state = BLOCKED)
         - java.lang.Object.wait(long) @bci=0 (Interpreted frame)
         - java.lang.ref.ReferenceQueue.remove(long) @bci=44, line=135 (Interpreted frame)
         - java.lang.ref.ReferenceQueue.remove() @bci=2, line=151 (Interpreted frame)
         - java.lang.ref.Finalizer$FinalizerThread.run() @bci=3, line=177 (Interpreted frame)

        Locked ownable synchronizers:
            - None

        Thread 7: (state = BLOCKED)
         - java.lang.Object.wait(long) @bci=0 (Interpreted frame)
         - java.lang.Object.wait() @bci=2, line=503 (Interpreted frame)
         - java.lang.ref.Reference$ReferenceHandler.run() @bci=46, line=133 (Interpreted frame)

        Locked ownable synchronizers:
            - None

        -----------------------------

        In the above message, the following 17 lines do not seem
        related to stack, but just debug inf.
        --
        none
        null_check
        null_assert
        range_check
        class_check
        array_check
        intrinsic
        bimorphic
        unloaded
        uninitialized
        unreached
        unhandled
        constraint
        div0_check
        age
        predicate
        loop_limit_check
        ----


        NOTE:
        There is some portion of jdk7u9 source code,

        ----[hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/MethodData.java]

          private static synchronized void initialize(TypeDataBase db) throws WrongTypeException {
             ...

            164 // Find Deopt reasons
            165 Iterator i = db.getIntConstants();
            166 String prefix = "Deoptimization::Reason_";
            167 while (i.hasNext()) {
            168 String name = (String)i.next();
            169 if (name.startsWith(prefix)) {
            170 // Strip prefix
            171 if (!name.endsWith("Reason_many") &&
            172 !name.endsWith("Reason_LIMIT") &&
            173 !name.endsWith("Reason_RECORDED_LIMIT")) {
            174 String trimmed = name.substring(prefix.length());
            175 int value = db.lookupIntConstant(name).intValue();
            176 if (trapReasonName[value] != null) {
            177 throw new InternalError("duplicate reasons: " + trapReasonName[value] + " " + trimmed);
            178 }
            179 trapReasonName[value] = trimmed;
            180 }
            181 }
            182 }
            183 for (int index = 0; index < trapReasonName.length; index++) {
            184 if (trapReasonName[index] == null) {
            185 throw new InternalError("missing reason for " + index);
            186 }
            187 System.out.println(trapReasonName[index]); <=== HERE!
            188 }
            189 }
        ....

        -----

        The above mentioned 17 lines are printed at the line#187.
        The line seems to print the reason of deoptimization.

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                sla Staffan Larsen (Inactive)
                Reporter:
                tbaba Tadayuki Baba (Inactive)
                Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved: