JDK-8358748 : Large page size initialization fails with assert "page_size must be a power of 2"
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 17
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2025-06-06
  • Updated: 2025-08-26
  • Resolved: 2025-08-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 b12Fixed
Related Reports
Causes :  
Description
Seems to be a regression from JDK-8256155. The VM should exit with an error gracefully instead of asserting.

java -XX:+UseLargePages -XX:LargePageSizeInBytes=6 -version

# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (workspace/open/src/hotspot/share/runtime/os.cpp:2449), pid=1885945, tid=1885946
#  assert(is_power_of_2(page_size)) failed: page_size must be a power of 2: 0x6

Stack: [0x000076879d900000,0x000076879da00000],  sp=0x000076879d9fc7d0,  free space=1009k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0x1bc6fb3]  VMError::report(outputStream*, bool)+0x2f93  (os.cpp:2449)
V  [libjvm.so+0x1bcaa23]  VMError::report_and_die(int, char const*, char const*, __va_list_tag*, Thread*, unsigned char*, void const*, void const*, char const*, int, unsigned long)+0x5a3
V  [libjvm.so+0xbf6a60]  report_vm_error(char const*, int, char const*, char const*, ...)+0x100
V  [libjvm.so+0x1749330]  os::PageSizes::next_smaller(unsigned long) const+0x0
V  [libjvm.so+0x175cb2c]  os::Linux::large_page_init()+0x90c
V  [libjvm.so+0x174c467]  os::init_before_ergo()+0x47
V  [libjvm.so+0x1af1aca]  Threads::create_vm(JavaVMInitArgs*, bool*)+0x13a
V  [libjvm.so+0x119c9f4]  JNI_CreateJavaVM+0x54
C  [libjli.so+0x3dff]  JavaMain+0x8f
C  [libjli.so+0x8019]  ThreadJavaMain+0x9
C  [libc.so.6+0x9caa4]

Comments
Changeset: 40bc0832 Branch: master Author: Yagmur Eren <yagmur.eren@oracle.com> Committer: Albert Mingkun Yang <ayang@openjdk.org> Date: 2025-08-20 07:16:36 +0000 URL: https://git.openjdk.org/jdk/commit/40bc083267c0bac64b1092c63325b8d245937b0e
20-08-2025

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/25994 Date: 2025-06-26 07:48:43 +0000
26-06-2025

This reproduces with all JDK versions since 17.
11-06-2025

Maybe a power of two check in jvmFlagConstraints* is needed for this flag.
11-06-2025