[crac] RFR: Fix crash after shm_open failure [v2]

Anton Kozlov akozlov at openjdk.java.net
Wed Jun 8 15:46:00 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
> #

Anton Kozlov has updated the pull request incrementally with one additional commit since the last revision:

  Handle read_from returning NULL

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

Changes:
  - all: https://git.openjdk.java.net/crac/pull/23/files
  - new: https://git.openjdk.java.net/crac/pull/23/files/62e4bb7a..ba466c16

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=crac&pr=23&range=01
 - incr: https://webrevs.openjdk.java.net/?repo=crac&pr=23&range=00-01

  Stats: 5 lines in 1 file changed: 3 ins; 0 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