JDK-8325326 : [PPC64] Don't relocate in case of allocation failure
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 11,17,21,22,23
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • CPU: ppc
  • Submitted: 2024-02-06
  • Updated: 2024-03-20
  • Resolved: 2024-02-16
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 11 JDK 17 JDK 21 JDK 22 JDK 23
11.0.24Fixed 17.0.12Fixed 21.0.4Fixed 22.0.1Fixed 23 b11Fixed
Related Reports
Relates :  
Relates :  
Description
In the test compiler/codecache/TestStressCodeBuffers.java we see today 2 times the following assertion (when running with fastdebug binaries) :

#  Internal Error (/workspace/openjdk-jdk-dev-aix_ppc64-dbg/jdk/src/hotspot/share/asm/codeBuffer.hpp:212), pid=8257968, tid=3599
#  assert(allocates2(pc)) failed: relocation addr must be in this section
#
# JRE version: OpenJDK Runtime Environment (23.0) (fastdebug build 23-internal-adhoc.sapmachine.jdk)
# Java VM: OpenJDK 64-Bit Server VM (fastdebug 23-internal-adhoc.sapmachine.jdk, compiled mode, compressed oops, compressed class ptrs, g1 gc, aix-ppc64)
 .....

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

Current thread (0x00000001154140b0):  JavaThread "C2 CompilerThread0" daemon [_thread_in_native, id=3599, stack(0x0000000115420000,0x000000011581d888) (4086K)]


Current CompileTask:
C2:3266  461    b        sun.invoke.util.Wrapper::forBasicType (103 bytes)

Stack: [0x0000000115420000,0x000000011581d888],  sp=0x0000000115819a80,  free space=4070k
No context given, using current context.
Native frame:
iar:  0x09000000056bdc18 libjvm.so::AixNativeCallstack::print_callstack_for_context(outputStream*, ucontext_t const*, bool, char*, unsigned long)+0x4cc  (C++ uses_alloca saves_cr saves_lr stores_bc gpr_saved:18 fixedparms:5 parmsonstk:1)
lr:   0x09000000051989b4 libjvm.so::fdStream::write(char const*, unsigned long)+0x44  (C++ uses_alloca saves_lr stores_bc gpr_saved:4 fixedparms:3 parmsonstk:1)
sp:   0x0000000115818d40 (base - 0x4B48) 
rtoc: 0x08001000a03d9960 
|---stackaddr----|   |----lrsave------|:   <function name>
0x0000000115819130 - 0x09000000056bd6d8 libjvm.so::os::Aix::platform_print_native_stack(outputStream*, void const*, char*, int, unsigned char*&)+0x24  (C++ uses_alloca saves_lr stores_bc gpr_saved:1 fixedparms:5 parmsonstk:1)
0x00000001158191b0 - 0x09000000051a96b0 libjvm.so::VMError::report(outputStream*, bool)+0x1c0c  (C++ fp_present uses_alloca saves_cr saves_lr stores_bc gpr_saved:18 fixedparms:2 parmsonstk:1)
0x0000000115819a90 - 0x0900000005197dc8 libjvm.so::VMError::report_and_die(int, char const*, char const*, char*, Thread*, unsigned char*, void*, void*, char const*, int, unsigned long)+0x7cc  (C++ uses_alloca saves_lr stores_bc gpr_saved:18 fixedparms:8 parmsonstk:1)
0x0000000115819c80 - 0x09000000051975b0 libjvm.so::VMError::report_and_die(Thread*, void*, char const*, int, char const*, char const*, char*)+0x58  (C++ uses_alloca saves_lr stores_bc gpr_saved:2 fixedparms:7 parmsonstk:1)
0x0000000115819d20 - 0x0900000005197290 libjvm.so::report_vm_error(char const*, int, char const*, char const*, ...)+0x8c  (C++ uses_alloca saves_lr stores_bc gpr_saved:5 fixedparms:4 parmsonstk:1)
0x0000000115819dc0 - 0x090000000522bc58 libjvm.so::CodeSection::relocate(unsigned char*, RelocationHolder const&, int)+0x3b0  (C++ uses_alloca saves_cr saves_lr stores_bc gpr_saved:12 fixedparms:4 parmsonstk:1)
0x0000000115819e90 - 0x0900000005b64600 libjvm.so::loadConP_hiNode::emit(CodeBuffer&, PhaseRegAlloc*) const+0x210  (C++ uses_alloca saves_lr stores_bc gpr_saved:9 fixedparms:3 parmsonstk:1)
0x0000000115819fb0 - 0x0900000005fa7760 libjvm.so::PhaseOutput::fill_buffer(CodeBuffer*, unsigned int*)+0x1678  (C++ uses_alloca saves_cr saves_lr stores_bc gpr_saved:18 fixedparms:3 parmsonstk:1)
0x000000011581a3d0 - 0x0900000005f9e2a0 libjvm.so::PhaseOutput::Output()+0x8d8  (C++ fp_present uses_alloca saves_lr stores_bc gpr_saved:12 fixedparms:1 parmsonstk:1)
0x000000011581a4a0 - 0x0900000005f3e7e4 libjvm.so::Compile::Code_Gen()+0x3dc  (C++ uses_alloca saves_lr stores_bc gpr_saved:6 fixedparms:1 parmsonstk:1)
0x000000011581b0e0 - 0x0900000005fbbb8c libjvm.so::Compile::Compile(ciEnv*, ciMethod*, int, Options, DirectiveSet*)+0x1718  (C++ fp_present uses_alloca saves_cr saves_lr stores_bc gpr_saved:18 fixedparms:6 parmsonstk:1)
0x000000011581bd50 - 0x09000000061cc780 libjvm.so::C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x25c  (C++ uses_alloca saves_cr saves_lr stores_bc gpr_saved:18 fixedparms:6 parmsonstk:1)
0x000000011581ca90 - 0x09000000054de564 libjvm.so::CompileBroker::invoke_compiler_on_method(CompileTask*)+0xcb4  (C++ fp_present uses_alloca saves_cr saves_lr stores_bc gpr_saved:18 fixedparms:1 parmsonstk:1)
0x000000011581d210 - 0x09000000054cec80 libjvm.so::CompileBroker::compiler_thread_loop()+0x4c0  (C++ fp_present uses_alloca saves_cr saves_lr stores_bc gpr_saved:18 parmsonstk:1)
0x000000011581d460 - 0x09000000054ce740 libjvm.so::CompilerThread::thread_entry(JavaThread*, JavaThread*)+0x58  (C++ uses_alloca saves_lr stores_bc gpr_saved:1 fixedparms:2 parmsonstk:1)
0x000000011581d4e0 - 0x090000000536c7f8 libjvm.so::JavaThread::thread_main_inner()+0x1f8  (C++ uses_alloca saves_lr stores_bc gpr_saved:4 fixedparms:1 parmsonstk:1)
0x000000011581d5b0 - 0x090000000536a8e0 libjvm.so::JavaThread::run()+0x214  (C++ uses_alloca saves_lr stores_bc gpr_saved:5 fixedparms:1 parmsonstk:1)
0x000000011581d650 - 0x0900000005298640 libjvm.so::Thread::call_run()+0x128  (C++ uses_alloca saves_lr stores_bc gpr_saved:3 fixedparms:1 parmsonstk:1)
0x000000011581d6e0 - 0x0900000005297b34 libjvm.so::thread_native_entry(Thread*)+0x194  (C++ uses_alloca saves_lr stores_bc gpr_saved:9 fixedparms:1 parmsonstk:1)
0x000000011581d7a0 - 0x090000000056204c libpthreads.a::_pthread_body+0xec  (C saves_lr stores_bc gpr_saved:1 fixedparms:1 )
0x000000011581d820 - 0x0000000000000000 
*** end of backchain ***
-----------------------
Comments
[jdk11u-fix-request] Approval Request from Martin JDK 11 is affected by this bug. The fix is small, only touches one PPC64 file and applies cleanly. It has been tested in head for some time and retested in 22u, 21u-dev, 17u-dev and 11u-dev. No regression found.
18-03-2024

A pull request was submitted for review. URL: https://git.openjdk.org/jdk11u-dev/pull/2603 Date: 2024-03-15 20:11:05 +0000
15-03-2024

[jdk17u-fix-request] Approval Request from Martin JDK 17 is affected by this bug. The fix is small, only touches one PPC64 file and applies cleanly. It has been tested in head for some time and retested in 22u and 21u-dev and 17u-dev. No regression found.
13-03-2024

A pull request was submitted for review. URL: https://git.openjdk.org/jdk17u-dev/pull/2280 Date: 2024-03-09 03:49:50 +0000
09-03-2024

[jdk21u-fix-request] Approval Request from Martin JDK 21 is affected by this bug. The fix is small, only touches one PPC64 file and applies cleanly. It has been tested in head for some time and retested in 22u and 21u-dev. No regression found.
02-03-2024

A pull request was submitted for review. URL: https://git.openjdk.org/jdk21u-dev/pull/311 Date: 2024-03-01 15:47:13 +0000
01-03-2024

[jdk22u-fix-request] Approval Request from Martin JDK 22 is affected by this bug. The fix is small, only touches one PPC64 file and applies cleanly. It has been tested in head for some time and retested in 22u. No regression found.
01-03-2024

A pull request was submitted for review. URL: https://git.openjdk.org/jdk22u/pull/75 Date: 2024-02-28 09:59:47 +0000
28-02-2024

Changeset: 4388095c Author: Martin Doerr <mdoerr@openjdk.org> Date: 2024-02-16 15:58:37 +0000 URL: https://git.openjdk.org/jdk/commit/4388095cde20dec602ada9fe2977f1a359ceab91
16-02-2024

Similar issue seen in JDK11 linuxppc64be, stack backtrace however looks a little different # Internal Error (/test/openjdk-11u-linux_ppc64le-dbg/jdk/src/hotspot/share/asm/codeBuffer.hpp:198), pid=30296, tid=30316 # assert(allocates2(pc)) failed: relocation addr must be in this section V [libjvm.so+0x1a794b4] VMError::report_and_die(Thread*, void*, char const*, int, char const*, char const*, char*)+0x54 V [libjvm.so+0xa97a70] report_vm_error(char const*, int, char const*, char const*, ...)+0xf0 V [libjvm.so+0x8cf418] CodeSection::relocate(unsigned char*, RelocationHolder const&, int) [clone .part.84]+0x348 V [libjvm.so+0x8cf714] CodeSection::relocate(unsigned char*, relocInfo::relocType, int, int)+0x94 V [libjvm.so+0x13a8890] MacroAssembler::bxx64_patchable(unsigned char*, relocInfo::relocType, bool)+0x3f0 V [libjvm.so+0x23decc] HandlerImpl::emit_deopt_handler(CodeBuffer&)+0x9c V [libjvm.so+0x1613124] Compile::fill_buffer(CodeBuffer*, unsigned int*)+0x2004 V [libjvm.so+0x9766c4] Compile::Code_Gen()+0x434 V [libjvm.so+0x97acf0] Compile::Compile(ciEnv*, C2Compiler*, ciMethod*, int, bool, bool, bool, bool, DirectiveSet*)+0x1480 V [libjvm.so+0x6ca1ac] C2Compiler::compile_method(ciEnv*, ciMethod*, int, DirectiveSet*)+0x19c V [libjvm.so+0x98da5c] CompileBroker::invoke_compiler_on_method(CompileTask*)+0x3dc V [libjvm.so+0x98ed18] CompileBroker::compiler_thread_loop()+0x638 V [libjvm.so+0x1954db4] compiler_thread_entry(JavaThread*, Thread*)+0x44 V [libjvm.so+0x197091c] JavaThread::thread_main_inner()+0x34c V [libjvm.so+0x196ab10] Thread::call_run()+0xc0 V [libjvm.so+0x15dff1c] thread_native_entry(Thread*)+0x14c C [libpthread.so.0+0x8cd4] start_thread+0x104
16-02-2024

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/17744 Date: 2024-02-07 09:41:29 +0000
07-02-2024

I had to set the jtreg "-vmoption:-Xmx768m" to reproduce the issue locally (no need to run :tier1 , just running the single test with this option is sufficient) .
07-02-2024

ILW = Same as JDK-8248411 = P3
07-02-2024

there was a similar assert in the issue JDK-8248411 but on aarch64
06-02-2024