JDK-8256843 : [PPC64] runtime/logging/RedefineClasses.java fails with assert: registers not saved on stack
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 16
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2020-11-23
  • Updated: 2024-12-20
  • Resolved: 2020-12-18
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 16 JDK 17
16 b30Fixed 17Fixed
Related Reports
Relates :  
Relates :  
Description
Seen on ppc, ppcle

Reproduce (also w/o -XX:+Verbose which was removed with JDK-8256822):

make run-test TEST=runtime/logging/RedefineClasses.java

Analysis:

With optimized builds the frame returned by os::current_frame() is one frame too
high because the call os::current_stack_pointer() is inlined.

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (/sapmnt/sapjvm_work/openjdk/nb/linuxppc64/jdk/src/hotspot/cpu/ppc/methodHandles_ppc.cpp:521), pid=15547, tid=15550
#  assert(cur_frame.sp() <= saved_regs) failed: registers not saved on stack ?
#
# JRE version: OpenJDK Runtime Environment (16.0.0.1) (fastdebug build 16.0.0.1-internal+0-adhoc.openjdk.jdk)
# Java VM: OpenJDK 64-Bit Server VM (fastdebug 16.0.0.1-internal+0-adhoc.openjdk.jdk, mixed mode, sharing, tiered, compressed oops, g1 gc, linux-ppc64)
# Problematic frame:
# V  [libjvm.so+0x173863c]  trace_method_handle_stub(char const*, oopDesc*, long*, long*)+0x96c
#
# Core dump will be written. Default location: Core dumps may be processed with "/usr/libexec/abrt-hook-ccpp %s %c %p %u %g %t e" (or dumping to /priv/jvmtests/output_openjdk16_stage_dbgU_linuxppc64/jtreg_hotspot_tier1_work/JTwork/runtime/logging/RedefineClasses/core.15547)
#
# If you would like to submit a bug report, please visit:
#   https://bugreport.java.com/bugreport/crash.jsp
#

---------------  S U M M A R Y ------------

Command Line: -Dtest.vm.opts=-Xmx768m -Djava.awt.headless=true -Djava.util.prefs.userRoot=/priv/jvmtests/output_openjdk16_stage_dbgU_linuxppc64/jtreg_hotspot_tier1_work/tmp -Djava.io.tmpdir=/priv/jvmtests/output_openjdk16_stage_dbgU_linuxppc64/jtreg_hotspot_tier1_work/tmp -ea -esa -Dtest.tool.vm.opts=-J-Xmx768m -J-Djava.awt.headless=true -J-Djava.util.prefs.userRoot=/priv/jvmtests/output_openjdk16_stage_dbgU_linuxppc64/jtreg_hotspot_tier1_work/tmp -J-Djava.io.tmpdir=/priv/jvmtests/output_openjdk16_stage_dbgU_linuxppc64/jtreg_hotspot_tier1_work/tmp -J-ea -J-esa -Dtest.compiler.opts= -Dtest.java.opts= -Dtest.jdk=/priv/jvmtests/output_openjdk16_stage_dbgU_linuxppc64/sapjvm_16 -Dcompile.jdk=/priv/jvmtests/output_openjdk16_stage_dbgU_linuxppc64/sapjvm_16 -Dtest.timeout.factor=6.0 -Dtest.nativepath=/priv/jvmtests/output_openjdk16_stage_dbgU_linuxppc64/grmpf/testdata/jtreg/jtreg_test_16/test/hotspot/jtreg/native -Dtest.root=/priv/jvmtests/output_openjdk16_stage_dbgU_linuxppc64/grmpf/testdata/jtreg/jtreg_test_16/test/hotspot/jtreg -Dtest.name=runtime/logging/RedefineClasses.java -Dtest.file=/priv/jvmtests/output_openjdk16_stage_dbgU_linuxppc64/grmpf/testdata/jtreg/jtreg_test_16/test/hotspot/jtreg/runtime/logging/RedefineClasses.java -Dtest.src=/priv/jvmtests/output_openjdk16_stage_dbgU_linuxppc64/grmpf/testdata/jtreg/jtreg_test_16/test/hotspot/jtreg/runtime/logging -Dtest.src.path=/priv/jvmtests/output_openjdk16_stage_dbgU_linuxppc64/grmpf/testdata/jtreg/jtreg_test_16/test/hotspot/jtreg/runtime/logging:/priv/jvmtests/output_openjdk16_stage_dbgU_linuxppc64/grmpf/testdata/jtreg/jtreg_test_16/test/lib -Dtest.classes=/priv/jvmtests/output_openjdk16_stage_dbgU_linuxppc64/jtreg_hotspot_tier1_work/JTwork/classes/runtime/logging/RedefineClasses.d -Dtest.class.path=/priv/jvmtests/output_openjdk16_stage_dbgU_linuxppc64/jtreg_hotspot_tier1_work/JTwork/classes/runtime/logging/RedefineClasses.d:/priv/jvmtests/output_openjdk16_stage_dbgU_linuxppc64/jtreg_hotspot_tier1_work/JTwork/classes/test/lib -Dtest.modules=java.compiler java.instrument --add-modules=java.compiler,java.instrument -Xmx768m -Djava.awt.headless=true -Djava.util.prefs.userRoot=/priv/jvmtests/output_openjdk16_stage_dbgU_linuxppc64/jtreg_hotspot_tier1_work/tmp -Djava.io.tmpdir=/priv/jvmtests/output_openjdk16_stage_dbgU_linuxppc64/jtreg_hotspot_tier1_work/tmp -ea -esa -Djava.library.path=/priv/jvmtests/output_openjdk16_stage_dbgU_linuxppc64/grmpf/testdata/jtreg/jtreg_test_16/test/hotspot/jtreg/native -Xmx256m -XX:MaxMetaspaceSize=64m -javaagent:redefineagent.jar -XX:+Verbose -Xlog:all=trace:file=all.log com.sun.javatest.regtest.agent.MainWrapper /priv/jvmtests/output_openjdk16_stage_dbgU_linuxppc64/jtreg_hotspot_tier1_work/JTwork/runtime/logging/RedefineClasses.d/main.1.jta

Host: ls3881, POWER8 (architected), altivec supported, 32 cores, 61G, Red Hat Enterprise Linux Server release 7.7 (Maipo)
Time: Sun Nov 22 07:13:09 2020 CET elapsed time: 1.983203 seconds (0d 0h 0m 1s)

---------------  T H R E A D  ---------------

Current thread (0x00003fffac031c10):  JavaThread "main" [_thread_in_Java, id=15550, stack(0x00003fffb0f70000,0x00003fffb1170000)]

Stack: [0x00003fffb0f70000,0x00003fffb1170000],  sp=0x00003fffb116c480,  free space=2033k
Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0x173863c]  trace_method_handle_stub(char const*, oopDesc*, long*, long*)+0x96c
v  ~BufferBlob::MethodHandles adapters
j  java.lang.invoke.Invokers$Holder.invokeExact_MT(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+28 java.base@16.0.0.1-internal
j  java.lang.invoke.BootstrapMethodInvoker.invoke(Ljava/lang/Class;Ljava/lang/invoke/MethodHandle;Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Class;)Ljava/lang/Object;+262 java.base@16.0.0.1-internal
j  java.lang.invoke.CallSite.makeSite(Ljava/lang/invoke/MethodHandle;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/Object;Ljava/lang/Class;)Ljava/lang/invoke/CallSite;+8 java.base@16.0.0.1-internal
j  java.lang.invoke.MethodHandleNatives.linkCallSiteImpl(Ljava/lang/Class;Ljava/lang/invoke/MethodHandle;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/invoke/MemberName;+6 java.base@16.0.0.1-internal
j  java.lang.invoke.MethodHandleNatives.linkCallSite(Ljava/lang/Object;ILjava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/invoke/MemberName;+46 java.base@16.0.0.1-internal
v  ~StubRoutines::call_stub
V  [libjvm.so+0x11c1de4]  JavaCalls::call_helper(JavaValue*, methodHandle const&, JavaCallArguments*, Thread*)+0x6e4
V  [libjvm.so+0x184ed94]  os::os_exception_wrapper(void (*)(JavaValue*, methodHandle const&, JavaCallArguments*, Thread*), JavaValue*, methodHandle const&, JavaCallArguments*, Thread*)+0x44
V  [libjvm.so+0x11c2eec]  JavaCalls::call_static(JavaValue*, Klass*, Symbol*, Symbol*, JavaCallArguments*, Thread*)+0x33c
V  [libjvm.so+0x1b32afc]  SystemDictionary::invoke_bootstrap_method(BootstrapInfo&, Thread*)+0x30c
V  [libjvm.so+0x157a224]  LinkResolver::resolve_dynamic_call(CallInfo&, BootstrapInfo&, Thread*)+0x44
V  [libjvm.so+0x157a8f8]  LinkResolver::resolve_invokedynamic(CallInfo&, constantPoolHandle const&, int, Thread*)+0x1e8
V  [libjvm.so+0x1585fc8]  LinkResolver::resolve_invoke(CallInfo&, Handle, constantPoolHandle const&, int, Bytecodes::Code, Thread*)+0x2e8
V  [libjvm.so+0x11ac55c]  InterpreterRuntime::resolve_invokedynamic(JavaThread*)+0x14c
V  [libjvm.so+0x11b1108]  InterpreterRuntime::resolve_from_cache(JavaThread*, Bytecodes::Code)+0x208
j  jdk.internal.module.DefaultRoots.compute(Ljava/lang/module/ModuleFinder;Ljava/lang/module/ModuleFinder;)Ljava/util/Set;+11 java.base@16.0.0.1-internal
j  jdk.internal.module.ModuleBootstrap.boot2()Ljava/lang/ModuleLayer;+715 java.base@16.0.0.1-internal
j  jdk.internal.module.ModuleBootstrap.boot()Ljava/lang/ModuleLayer;+77 java.base@16.0.0.1-internal
j  java.lang.System.initPhase2(ZZ)I+0 java.base@16.0.0.1-internal
v  ~StubRoutines::call_stub
V  [libjvm.so+0x11c1de4]  JavaCalls::call_helper(JavaValue*, methodHandle const&, JavaCallArguments*, Thread*)+0x6e4
V  [libjvm.so+0x184ed94]  os::os_exception_wrapper(void (*)(JavaValue*, methodHandle const&, JavaCallArguments*, Thread*), JavaValue*, methodHandle const&, JavaCallArguments*, Thread*)+0x44
V  [libjvm.so+0x11c2eec]  JavaCalls::call_static(JavaValue*, Klass*, Symbol*, Symbol*, JavaCallArguments*, Thread*)+0x33c
V  [libjvm.so+0x1b8da6c]  Threads::create_vm(JavaVMInitArgs*, bool*)+0x72c
V  [libjvm.so+0x13574b0]  JNI_CreateJavaVM+0xff1f02a0
C  [libjli.so+0x6408]  JavaMain+0xc8
C  [libjli.so+0xaa30]  ThreadJavaMain+0x10
C  [libpthread.so.0+0xc460]  start_thread+0x100

Comments
Changeset: 1ce2e94f Author: Richard Reingruber <rrich@openjdk.org> Date: 2020-12-18 13:16:09 +0000 URL: https://git.openjdk.java.net/jdk16/commit/1ce2e94f
18-12-2020

We should get this fixed in jdk16 to get the tests passing. Raising priority to match the one of JDK-8246378.
14-12-2020

Problem is that os::current_frame() doesn't return the right frame in fastdebug builds. (Slowdebug builds don't inline this function and are working ok.)
23-11-2020

Part of me thought that we should just delete that logging code which seems like it might have been useful for development but is no longer useful. I don't really know this code to know if there's a current use for it [~vlivanov] maybe would know.
23-11-2020