Details
-
Bug
-
Resolution: Fixed
-
P3
-
9
-
b06
-
generic
-
generic
Backports
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8045254 | 8u25 | Vladimir Kozlov | P3 | Resolved | Fixed | b01 |
JDK-8037263 | 8u20 | Vladimir Kozlov | P3 | Closed | Fixed | b06 |
JDK-8053255 | emb-8u26 | Vladimir Kozlov | P3 | Resolved | Fixed | b17 |
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.
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
- backported by
-
JDK-8045254 Fix "Native frames:" in crash report (hs_err file)
-
- Resolved
-
-
JDK-8053255 Fix "Native frames:" in crash report (hs_err file)
-
- Resolved
-
-
JDK-8037263 Fix "Native frames:" in crash report (hs_err file)
-
- Closed
-
- relates to
-
JDK-8194652 VMError::print_native_stack() is missing an os::is_first_C_frame() check
-
- Resolved
-