JDK-8017106 : -XX:+UseLargePages is not rejected on MacOSX - causing crashes at startup
  • Type: Bug
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: hs24
  • Priority: P5
  • Status: Closed
  • Resolution: Duplicate
  • Submitted: 2013-06-19
  • Updated: 2021-03-15
  • Resolved: 2013-06-25
Related Reports
Duplicate :  
Relates :  
Relates :  
Description
For example:
/localhome/java/jdk1.7.0_40.jdk/Contents/Home/bin/java -XX:+UseSerialGC -XX:+UseLargePages -version

# Problematic frame:
# V  [libjvm.dylib+0x279f88]  lcm(unsigned long, unsigned long)+0x1f

siginfo:si_signo=SIGFPE: si_errno=0, si_code=7 (FPE_FLTINV), si_addr=0x000000010a4e9f88

V  [libjvm.dylib+0x279f88]  lcm(unsigned long, unsigned long)+0x1f
V  [libjvm.dylib+0x1a6016]  GenCollectorPolicy::initialize_flags()+0x1c
V  [libjvm.dylib+0x1a69d0]  TwoGenerationCollectorPolicy::initialize_flags()+0x14
V  [libjvm.dylib+0x19ca08]  GenCollectorPolicy::initialize_all()+0x14
V  [libjvm.dylib+0x4f1955]  Universe::initialize_heap()+0x117
V  [libjvm.dylib+0x4f1d32]  universe_init()+0xe3
V  [libjvm.dylib+0x299bc4]  init_globals()+0x4c
V  [libjvm.dylib+0x4e3a72]  Threads::create_vm(JavaVMInitArgs*, bool*)+0x1be

This happens because os::large_page_size() returns 0, since its not setup in os_bsd.cpp

collectorPolicy.cpp:
if (UseLargePages && !UseParallelGC) {
      // in presence of large pages we have to make sure that our
      // alignment is large page aware
      alignment = lcm(os::large_page_size(), alignment); // CRASH here
}
Comments
Or there was a bug in macOS, similar to JDK-8261397 (https://feedbackassistant.apple.com/feedback/8984455) where Apple itself incorrectly assigned "FPE_FLT..." type code to a "FPE_INT..." type error.
10-03-2021

The bug output shows "siginfo:si_signo=SIGFPE: si_errno=0, si_code=7 (FPE_FLTINV), si_addr=0x000000010a4e9f88", but that can't be right. si_code=7 should be "FPE_INTDIV", not "FPE_FLTINV" "FPE_FLTINV" is si_code=5 also, the code in question crashed at while ((next = cur % div) != 0) { i.e. "cur % div" for div=0, and where "div" is of type "size_t" (i.e. an integer), not "float" or "double", so this should have generated type "FPE_INT...", not "FPE_FLT..." We probably had a bug in code mapping "si_code" to the wrong "FPE_..." constants. The point is, we were probably not catching "FPE_FLT...", only "FPE_INT..." type codes.
10-03-2021

JDK-7191817 fixed this in hs25. If this should be fixed in hs24 it should be a backport of the fix for JDK-7191817.
25-06-2013

This has already been fixed in hs25, so targeting it against hs25 doesn't make sense.
20-06-2013

Triaged. 25. (Very low priority)
20-06-2013

In hs25 large pages support for OSX was turned off. Maybe we should just backport that fix?
20-06-2013