[crac] RFR: Harden criuengine cppath reading
Anton Kozlov
akozlov at openjdk.org
Thu Apr 13 13:04:10 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.
Thanks for review,
> 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.
Exactly, this why we don't close the fd explicitly.
-------------
PR Comment: https://git.openjdk.org/crac/pull/56#issuecomment-1506924158
More information about the crac-dev
mailing list