JVM Crash due to `ParMarkBitMap::mark_obj` in HotSpot JDK

Solution Unverified - Updated

Environment

  • Red Hat Enterprise Linux 6.x
  • Oracle JDK 7.0_06-b24

Issue

  • JVM Crash due to ParMarkBitMap::mark_obj in HotSpot JDK
  • The following is seen in the crash file:
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007f3f2590b44f, pid=3277, tid=139909094418176
#
# JRE version: 7.0_06-b24
# Java VM: Java HotSpot(TM) 64-Bit Server VM (23.2-b09 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# V  [libjvm.so+0x75744f]  ParMarkBitMap::mark_obj(HeapWord*, unsigned long)+0xdf
#
# Core dump written. Default location: //core or core.3277 (max size 1 kB). To ensure a full core dump, try "ulimit -c unlimited" before starting Java again
#
[...]
---------------  T H R E A D  ---------------
  
Current thread (0x0000000000620800):  GCTaskThread [stack: 0x00007f3f1fcfa000,0x00007f3f1fdfb000] [id=3283]
[...]
Stack: [0x00007f3f1fcfa000,0x00007f3f1fdfb000],  sp=0x00007f3f1fdf9c20,  free space=1023k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0x75744f]  ParMarkBitMap::mark_obj(HeapWord*, unsigned long)+0xdf
V  [libjvm.so+0x79eb3e]  PSParallelCompact::MarkAndPushClosure::do_oop(oopDesc**)+0xce
V  [libjvm.so+0x5a1a60]  JNIHandles::oops_do(OopClosure*)+0x20
V  [libjvm.so+0x77a1b9]  MarkFromRootsTask::do_it(GCTaskManager*, unsigned int)+0xd9
V  [libjvm.so+0x4b74c0]  GCTaskThread::run()+0x130
V  [libjvm.so+0x746a00]  java_start(Thread*)+0x100
[...]

Resolution

  • As a workaround disable the use of LargePages in the environment.
  • Upgrade the JDK to the latest version, as there are a few bugs addressed in how the JDK interacts with LargePages.

Root Cause

  • The ParCompactionManager::_mark_bitmap data structure got corrupted. The JVM crashed while processing sections of the heap in the GC mark phase, and tried to access invalid memory in the marking bitmap. This appears to be caused due an issue with the way that the Oracle JDK interacts with LargePages in the JVM.

Diagnostic Steps

  • Obtain the hs_err crash file from the event.
Components
Tags

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.