[crac] RFR: Disable rseq in libc on checkpoint

Anton Kozlov akozlov at openjdk.org
Tue Oct 11 09:23:38 UTC 2022


Restartable sequences (rseq) [0] may be used by the glibc [1]. Without proper support of rseq in the ptrace [2], CRIU fails to create the checkpoint [3]. Some paravirtualized environments like Docker on Mac, and WSL, which are commonly used during development, still do not provide a proper rseq support, leading to the error. A simple usability workaround is to disable rseq in glibc. The patch disables rseq if JVM is started with -XX:CRaCheckpointTo and there is no explicit setting of rseq for glibc.  The workaround is not going to live forever, just until rseq support is implemented in the majority of environments. Alternatives like more clever detection of rseq in the ptrace, or detection of a paravirtualized environment seem too complex, having that positive impact from rseq on java performance is unknown. 

[0] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=d7822b1e24f2
[1] https://sourceware.org/git/?p=glibc.git;a=commit;h=95e114a0919d844d8fe07839cb6538b7f5ee920e. 
[2] https://github.com/CRaC/criu/blob/cc01f191639a5c2c988f49f1e314d17b055497b2/criu/kerndat.c#L944
[3] https://github.com/CRaC/criu/blob/cc01f191639a5c2c988f49f1e314d17b055497b2/criu/cr-dump.c#L225

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

Commit messages:
 - Fix possible null string formatting
 - Disable rseq in case the kernel does not support ptrace for rseq

Changes: https://git.openjdk.org/crac/pull/31/files
 Webrev: https://webrevs.openjdk.org/?repo=crac&pr=31&range=00
  Stats: 35 lines in 1 file changed: 35 ins; 0 del; 0 mod
  Patch: https://git.openjdk.org/crac/pull/31.diff
  Fetch: git fetch https://git.openjdk.org/crac pull/31/head:pull/31

PR: https://git.openjdk.org/crac/pull/31


More information about the crac-dev mailing list