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

SA needs to provide a better error message

XMLWordPrintable

    • generic
    • generic

      ADDITIONAL SYSTEM INFORMATION :
      Tried on Ubuntu 16.04, Ubuntu 18.04, Centos 7.3.
      Tried with Java 1.8.171, 1.8.181, Java 11


      A DESCRIPTION OF THE PROBLEM :
      Trying to run jstack on a core with a regular installation of the oracle jdk or openjdk currently gives the following error message:
      ```
      $ jstack /usr/bin/java core.2997
      Attaching to core core.2997 from executable /usr/bin/java, please wait...
      Error attaching to core file: Can't attach to the core file
      sun.jvm.hotspot.debugger.DebuggerException: Can't attach to the core file
      at sun.jvm.hotspot.debugger.linux.LinuxDebuggerLocal.attach0(Native Method)
      at sun.jvm.hotspot.debugger.linux.LinuxDebuggerLocal.attach(LinuxDebuggerLocal.java:286)
      at sun.jvm.hotspot.HotSpotAgent.attachDebugger(HotSpotAgent.java:673)
      at sun.jvm.hotspot.HotSpotAgent.setupDebuggerLinux(HotSpotAgent.java:611)
      at sun.jvm.hotspot.HotSpotAgent.setupDebugger(HotSpotAgent.java:337)
      at sun.jvm.hotspot.HotSpotAgent.go(HotSpotAgent.java:304)
      at sun.jvm.hotspot.HotSpotAgent.attach(HotSpotAgent.java:156)
      at sun.jvm.hotspot.tools.Tool.start(Tool.java:191)
      at sun.jvm.hotspot.tools.Tool.execute(Tool.java:118)
      at sun.jvm.hotspot.tools.JStack.main(JStack.java:92)
      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:498)
      at sun.tools.jstack.JStack.runJStackTool(JStack.java:140)
      at sun.tools.jstack.JStack.main(JStack.java:106)
      ```

      The reason behind the failure is because debug symbols for java libraries are not found. The debug symbols are either installed as a separate package or a special environment variable has to be provided on debian systems when building the package from source using make-jpkg. Debugging this required several hours of investigation.

      A better error message would save developers many hours of work.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Make sure you have the jdk installed without the jdk-dbg package.
      1. produce core file of a java process (can use gcore).
      2. run jstack on the core: jstack /usr/bin/java core.<pid>


      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      A helpful error message.
      ACTUAL -
      An unhelpful error message and stack trace.

      FREQUENCY : always


            Unassigned Unassigned
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: