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

Fix "Native frames:" in crash report (hs_err file)

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 9
    • Fix Version/s: 9
    • Component/s: hotspot
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b06
    • CPU:
      generic
    • OS:
      generic

      Backports

        Description

        We don't print whole stack if native frames intermix with compiled java frames in Java thread (on x86 fp is used by compiled code).

        Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
        V [libjvm.so+0x1e28428] void VMError::report(outputStream*)+0x1478
        V [libjvm.so+0x1e29dd4] void VMError::report_and_die()+0x6b4
        V [libjvm.so+0x14ad9ba] void report_vm_error(const char*,int,const char*,const char*)+0x9a
        V [libjvm.so+0x1b6ccf5] void ObjectMonitor::exit(bool,Thread*)+0x125
        V [libjvm.so+0x1d41cda] void ObjectSynchronizer::fast_exit(oopDesc*,BasicLock*,Thread*)+0x38a
        V [libjvm.so+0x1d41fba] void ObjectSynchronizer::slow_exit(oopDesc*,BasicLock*,Thread*)+0x2a
        V [libjvm.so+0x1caa13f] void SharedRuntime::complete_monitor_unlocking_C(oopDesc*,BasicLock*)+0x27f

        The next changes seem fixed the problem:

        src/share/vm/utilities/vmError.cpp
        @@ -590,15 +590,17 @@
                   while (count++ < StackPrintLimit) {
                      fr.print_on_error(st, buf, sizeof(buf));
                      st->cr();
        + // Catch very first native frame by using stack address.
        + if ((address)(fr.sp() + 4) >= _thread->stack_base()) break;
        +
                      // Compiled code may use EBP register on x86 so it looks like
        - // non-walkable C frame. Use frame.sender() for java frames.
        + // non-walkable C frame. Use frame.sender() for java threads.
                      if (_thread && _thread->is_Java_thread() && fr.is_java_frame()) {
                        RegisterMap map((JavaThread*)_thread, false); // No update
                        fr = fr.sender(&map);
        - continue;
        + } else {
        + fr = os::get_sender_for_C_frame(&fr);
                      }
        - if (os::is_first_C_frame(&fr)) break;
        - fr = os::get_sender_for_C_frame(&fr);
                   }
         
                   if (count > StackPrintLimit) {

        Instead of using os::is_first_C_frame() which produces incorrect result for compiled java frames I am suggesting to look on frame's stack pointer relative to stack's base.

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  kvn Vladimir Kozlov
                  Reporter:
                  kvn Vladimir Kozlov
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: