[crac] RFR: Print better diagnostics for spawning CRIU [v2]
Anton Kozlov
akozlov at openjdk.org
Wed Aug 9 20:04:58 UTC 2023
On Fri, 4 Aug 2023 06:34:53 GMT, Jan Kratochvil <jkratochvil at openjdk.org> wrote:
>> src/java.base/unix/native/criuengine/criuengine.c line 227:
>>
>>> 225: criu_log = path_abs2(imagedir, log_local);
>>> 226: fprintf(stderr, "Spawned CRIU \"%s\" has not properly exited: exit code %d - check %s\n", criu_cmdline, WEXITSTATUS(status), criu_log);
>>> 227: }
>>
>> Could you unify these handlings? There is a slight difference in each code path.
>
> Either it got fixed by C++ or describe more the difference, please.
I was thinking of something like
if (child != wait(&status)) {
msg = "unexpected child pid"
} else if (!WIFEXITED(status)) {
msg = "child killed"
} else if ((ecode = WEXITSTATUS(status))) {
msg = asprintf("exit code: %d", ecode);
}
fprintf("CRIU failure: %s", msg)
for (int i = 0; i < n_args; ++i) {
fprintf(" %s", args[i]);
That would not also require join_args abstrastion, but OK.
-------------
PR Review Comment: https://git.openjdk.org/crac/pull/97#discussion_r1289122221
More information about the crac-dev
mailing list