JDK-8358578 : Small -XX:NMethodSizeLimit triggers "not in CodeBuffer memory" assert in C1
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 8
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2025-06-04
  • Updated: 2025-07-03
  • Resolved: 2025-06-20
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 26
26 b04Fixed
Related Reports
Relates :  
Description
java -XX:NMethodSizeLimit=100 -version

# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (/open/src/hotspot/share/asm/codeBuffer.hpp:202), pid=1872518, tid=1872537
#  assert(allocates2(pc)) failed: not in CodeBuffer memory: 0x0000794733c29de0 <= 0x0000794733c29e22 <= 0x0000794733c29e20
#
# JRE version: Java(TM) SE Runtime Environment (25.0+26) (fastdebug build 25-ea+26-LTS-3300)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 25-ea+26-LTS-3300, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
# Problematic frame:
# V  [libjvm.so+0x6d63d0]  AbstractAssembler::emit_int24(int, int, int) [clone .isra.0]+0x160

Stack: [0x000079470b100000,0x000079470b200000],  sp=0x000079470b1fdae8,  free space=1014k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0x6d63d0]  AbstractAssembler::emit_int24(int, int, int) [clone .isra.0]+0x160  (codeBuffer.hpp:202)
V  [libjvm.so+0x6d8773]  Assembler::emit_operand_helper(int, int, int, Address::ScaleFactor, int, RelocationHolder const&, int)+0x3f3
V  [libjvm.so+0x6d8e2a]  Assembler::emit_operand(Register, Register, Register, Address::ScaleFactor, int, RelocationHolder const&, int) [clone .constprop.0
]+0x6a
V  [libjvm.so+0x77d073]  Assembler::movq(Address, Register)+0xf3
V  [libjvm.so+0x1590aa6]  MacroAssembler::save_legacy_gprs()+0x2b6
V  [libjvm.so+0x908a1b]  C1_MacroAssembler::save_live_registers_no_oop_map(bool)+0x3b
V  [libjvm.so+0x90b1e1]  Runtime1::generate_code_for(C1StubId, StubAssembler*)+0x841
V  [libjvm.so+0x8faff1]  Runtime1::generate_blob(BufferBlob*, C1StubId, char const*, bool, StubAssemblerCodeGenClosure*) [clone .part.0]+0x1f1
V  [libjvm.so+0x8fb86d]  Runtime1::generate_blob_for(BufferBlob*, C1StubId)+0x11d
V  [libjvm.so+0x8fb8d2]  Runtime1::initialize(BufferBlob*)+0x32
V  [libjvm.so+0x81d6bd]  Compiler::init_c1_runtime()+0x3d
V  [libjvm.so+0x81d823]  Compiler::initialize()+0x83
V  [libjvm.so+0xb2fb05]  CompileBroker::init_compiler_runtime()+0x155
V  [libjvm.so+0xb38cd7]  CompileBroker::compiler_thread_loop()+0x167

Comments
Changeset: a6464b74 Branch: master Author: Manuel Hässig <mhaessig@openjdk.org> Committer: SendaoYan <syan@openjdk.org> Date: 2025-06-20 01:33:54 +0000 URL: https://git.openjdk.org/jdk/commit/a6464b74a8c9b97653b292c18f5604d4d030a9cb
20-06-2025

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/25876 Date: 2025-06-18 14:07:29 +0000
18-06-2025

ILW = Assert in C1 (very old issue), easy to reproduce with low value of debug flag, disable compilation of affected method = MLH = P4
04-06-2025