JDK-8066185 : VM crashed with SIGSEGV VirtualMemoryTracker::add_reserved_region
  • Type: Bug
  • Component: tools
  • Sub-Component: launcher
  • Affected Version: 8u40,9
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • OS: linux
  • Submitted: 2014-11-28
  • Updated: 2018-02-15
  • Resolved: 2015-02-25
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 8 JDK 9
8u162Fixed 9 b53Fixed
Related Reports
Relates :  
Description
Jdk 9 b40 - strange NMT failure:

./9b40/bin/java -version
java version "1.9.0-ea"
Java(TM) SE Runtime Environment (build 1.9.0-ea-b40)
Java HotSpot(TM) 64-Bit Server VM (build 1.9.0-ea-b40, mixed mode)

./9b40/bin/java -version -XX:NativeMemoryTracking=summary
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007f2fd66f6773, pid=9232, tid=139843427251968
#
# JRE version:  (9.0-b40) (build )
# Java VM: Java HotSpot(TM) 64-Bit Server VM (1.9.0-ea-b40 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# V  [libjvm.so+0xa12773]  VirtualMemoryTracker::add_reserved_region(unsigned char*, unsigned long, NativeCallStack const&, MemoryType, bool)+0x93
#
# Core dump written. Default location: /export/home/gtee/tmp/jdk/core or core.9232
#
# An error report file with more information is saved as:
# /export/home/gtee/tmp/jdk/hs_err_pid9232.log
Phoning home...
Using server: 10.161.186.18, port 4711
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp
#
Aborted (core dumped)

The same on 8u40 b16:

./8u40b16/bin/java -version
java version "1.8.0_40-ea"
Java(TM) SE Runtime Environment (build 1.8.0_40-ea-b16)
Java HotSpot(TM) 64-Bit Server VM (build 25.40-b20, mixed mode)

./8u40b16/bin/java -version -XX:NativeMemoryTracking=summary
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007ff6bbcd1be7, pid=9886, tid=140697678300928
#
# JRE version:  (8.0_40-b16) (build )
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.40-b20 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# V  [libjvm.so+0xaa4be7]  VirtualMemoryTracker::add_reserved_region(unsigned char*, unsigned long, NativeCallStack const&, MemoryType, bool)+0x97
#
# Core dump written. Default location: /export/home/gtee/tmp/jdk/core or core.9886
#
# An error report file with more information is saved as:
# /export/home/gtee/tmp/jdk/hs_err_pid9886.log
Phoning home...
Using server: 10.161.186.18, port 4711
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp
#
Aborted (core dumped)

Reproduced on Oracle linux 6.3 and 6.4, Ubuntu 14.04(x64)

Reproducible: always
No any core or hs_err attached due to easy to reproduce.

Behavior on Ubuntu (linux-i586):
./b16/bin/java -version
java version "1.8.0_40-ea"
Java(TM) SE Runtime Environment (build 1.8.0_40-ea-b16)
Java HotSpot(TM) Server VM (build 25.40-b20, mixed mode)

./b16/bin/java -version -XX:NativeMemoryTracking=summary
Segmentation fault (core dumped)
---
./b40/bin/java -version
java version "1.9.0-ea"
Java(TM) SE Runtime Environment (build 1.9.0-ea-b40)
Java HotSpot(TM) Server VM (build 1.9.0-ea-b40, mixed mode)

./b40/bin/java -version -XX:NativeMemoryTracking=summary
Segmentation fault (core dumped)


Comments
http://cr.openjdk.java.net/~ksrini/8066185
23-02-2015

Yes, this is a bug, I will post a patch for review next week. Also I think it is best to leave the VM/Runtime safety net in place, just in case.
23-02-2015

This is a bug in the launcher. If you pass java HelloWorld -XX:NativeMemoryTracking=detail the launcher sets the environment variable for native memory tracking but doesn't pass the option, because it's an argument to the class file. The launcher should not set the environment variable in this case. I can work around this within the JVM but we think the launcher should be fixed.
04-12-2014

Might be a similar issue. While running a script that executes JT-Reg tests with multiple common flag combos, the NMT case crashed. The command is: $JAVA_HOME/bin/java -jar /tools/jtreg/lib/jtreg.jar -XX:+UnlockDiagnosticVMOptions -XX:NativeMemoryTracking=detail -version Encountered on Linux-x64, 100% reproducible. Crash: assert(_reserved_regions != NULL) failed: Sanity check Log attached: hs_err_pid14687.log Stack: [0x00007ffeb8915000,0x00007ffeb8a16000], sp=0x00007ffeb8a147a0, free space=1021k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) V [libjvm.so+0x10580b1] VMError::report_and_die()+0x151 V [libjvm.so+0x72e38b] report_vm_error(char const*, int, char const*, char const*)+0x7b V [libjvm.so+0x104ce29] VirtualMemoryTracker::add_reserved_region(unsigned char*, unsigned long, NativeCallStack const&, MemoryType, bool)+0x649 V [libjvm.so+0xe2d88b] PerfMemory::create_memory_region(unsigned long)+0x93b V [libjvm.so+0xe2bfde] perfMemory_init()+0x5e V [libjvm.so+0xfd55c5] Threads::create_vm(JavaVMInitArgs*, bool*)+0x205 V [libjvm.so+0xa88ddc] JNI_CreateJavaVM+0x8c C [libjli.so+0x6833] JavaMain+0x83
02-12-2014

Looks like argument parser error - if use correct sequence of argumets ( -XX:NativeMemoryTracking=summary -version ) - all works fine.
28-11-2014