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

jstack not working on core files

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2 P2
    • 9
    • 9
    • hotspot
    • svc
    • b26
    • Verified

        The change "8046282: SA update" introduced the following new code in
        agent/src/share/classes/sun/jvm/hotspot/oops/Klass.java

        + traceIDField = type.getField("_trace_id");

        But I can not find the corresponding field in
        src/share/vm/oops/klass.hpp. The Klass class only contains the macro
        TRACE_DEFINE_KLASS_TRACE_ID which is defined to "typedef int
        ___IGNORED_hs_trace_type2" in traceMacros.hpp.

        This leads to an error when calling for example jstack on a core file:

        $ images/j2sdk-image/bin/jstack ./images/j2sdk-image/bin/java core
        Attaching to core core from executable ./images/j2sdk-image/bin/java,
        please wait...
        Debugger attached successfully.
        Server compiler detected.
        JVM version is 1.9.0-internal-d046063_2014_07_10_11_16-b00
        Deadlock Detection:

        Exception in thread "main" java.lang.reflect.InvocationTargetException
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            at java.lang.reflect.Method.invoke(Method.java:484)
            at sun.tools.jstack.JStack.runJStackTool(JStack.java:140)
            at sun.tools.jstack.JStack.main(JStack.java:106)
        Caused by: java.lang.ExceptionInInitializerError
            at sun.jvm.hotspot.oops.ObjectHeap.initialize(ObjectHeap.java:74)
            at sun.jvm.hotspot.oops.ObjectHeap.<init>(ObjectHeap.java:110)
            at sun.jvm.hotspot.runtime.VM.getObjectHeap(VM.java:582)
            at sun.jvm.hotspot.runtime.DeadlockDetector.print(DeadlockDetector.java:55)
            at sun.jvm.hotspot.runtime.DeadlockDetector.print(DeadlockDetector.java:39)
            at sun.jvm.hotspot.tools.StackTrace.run(StackTrace.java:62)
            at sun.jvm.hotspot.tools.StackTrace.run(StackTrace.java:45)
            at sun.jvm.hotspot.tools.JStack.run(JStack.java:66)
            at sun.jvm.hotspot.tools.Tool.startInternal(Tool.java:260)
            at sun.jvm.hotspot.tools.Tool.start(Tool.java:223)
            at sun.jvm.hotspot.tools.Tool.execute(Tool.java:118)
            at sun.jvm.hotspot.tools.JStack.main(JStack.java:92)
            ... 6 more
        Caused by: java.lang.RuntimeException: field "_trace_id" not found in type Klass
            at sun.jvm.hotspot.types.basic.BasicType.getField(BasicType.java:183)
            at sun.jvm.hotspot.types.basic.BasicType.getField(BasicType.java:190)
            at sun.jvm.hotspot.types.basic.BasicType.getField(BasicType.java:194)
            at sun.jvm.hotspot.oops.Klass.initialize(Klass.java:58)
            at sun.jvm.hotspot.oops.Klass.access$000(Klass.java:33)
            at sun.jvm.hotspot.oops.Klass$1.update(Klass.java:37)
            at sun.jvm.hotspot.runtime.VM.registerVMInitializedObserver(VM.java:394)
            at sun.jvm.hotspot.oops.Klass.<clinit>(Klass.java:35)
            ... 18 more

        Is this a problem with OpenJDK only (i.e. is '_trace_id' defined in
        Oracle proprietary builds) ?. Or is this another problem?

              poonam Poonam Bajaj Parhar
              egahlin Erik Gahlin
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: