[crac] RFR: Harden criuengine cppath reading

Radim Vansa duke at openjdk.org
Wed Apr 12 15:31:37 UTC 2023


On Fri, 24 Mar 2023 19:00:38 GMT, Anton Kozlov <akozlov at openjdk.org> wrote:

> On some older OSes I see a few `fgets error` coming from criuengine restore function. They are intermittent and hard to debug. After replacing libc fopen/fgets invocations with open/read, the problem went away. I'm still not completely sure why the problem with libc file functions exists but I suspect that EINTR is not correctly handled there, or the fact we store a sequence in characters without `\0` or `\n` in the file we read. So I propose using the lower-level interface to read the file.

The only objection here could be not closing the file descriptor upon error, but as the process terminates upon error anyway it's a non-issue.

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

Marked as reviewed by rvansa at github.com (no known OpenJDK username).

PR Review: https://git.openjdk.org/crac/pull/56#pullrequestreview-1381577462


More information about the crac-dev mailing list