[crac] RFR: Fix crash after shm_open failure

Anton Kozlov akozlov at openjdk.java.net
Tue Jun 7 18:38:59 UTC 2022


When `_restore_parameters` is not set (e.g. after shm_open failure[0]), VM may crash on NULL dereference [1]. The change makes _restore_parameter always valid.

[0] https://github.com/openjdk/crac/blob/b2783c90a8ad81f6a8564e6cacf97a1ea0190ccd/src/hotspot/os/linux/os_linux.cpp#L6142
[1] https://github.com/openjdk/crac/blob/b2783c90a8ad81f6a8564e6cacf97a1ea0190ccd/src/hotspot/os/linux/os_linux.cpp#L415


shm_open: Function not implemented
shm_open (ignoring new args): Function not implemented
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007f85bce8ad37, pid=131, tid=146
#
# JRE version: OpenJDK Runtime Environment (17.0) (build 17-internal+0-adhoc..crac)
# Java VM: OpenJDK 64-Bit Server VM (17-internal+0-adhoc..crac, mixed mode, tiered, compressed oops, compressed class ptrs, serial gc, linux-amd64)
# Problematic frame:
# V  [libjvm.so+0xc47d37]  os::Linux::checkpoint(bool, JavaThread*)+0x107
#
# Core dump will be written. Default location: /tmp/core.%e.131
#
# An error report file with more information is saved as:
# /tmp/hs_err_pid131.log
#
# If you would like to submit a bug report, please visit:
#   https://bugreport.java.com/bugreport/crash.jsp
#

-------------

Commit messages:
 - Fix crash after shm_open failure

Changes: https://git.openjdk.java.net/crac/pull/23/files
 Webrev: https://webrevs.openjdk.java.net/?repo=crac&pr=23&range=00
  Stats: 5 lines in 1 file changed: 1 ins; 2 del; 2 mod
  Patch: https://git.openjdk.java.net/crac/pull/23.diff
  Fetch: git fetch https://git.openjdk.java.net/crac pull/23/head:pull/23

PR: https://git.openjdk.java.net/crac/pull/23


More information about the crac-dev mailing list