[crac] RFR: CRaC may exit before image dump is completed [v2]

Dan Heidinga heidinga at openjdk.org
Tue Feb 28 18:48:36 UTC 2023


On Tue, 28 Feb 2023 17:39:05 GMT, Anton Kozlov <akozlov at openjdk.org> wrote:

>> Roman Marchenko has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Added sighandler to the main process
>
> src/java.base/share/native/launcher/main.c line 118:
> 
>> 116:         pid = wait(&st);
>> 117:         if (!status && 0 < pid && WIFEXITED(st)) {
>> 118:             status = WEXITSTATUS(st);
> 
> Some `WEXITSTATUS(st)` can end up 0, so the a next exited child can override this status.
> 
> I think here we should watch for the status of the g_child_pid, and ignoring statuses of other childs that are not our immediate java process child.

I think Anton's right - we want to exit with the `g_child_pid`'s status so it's the only one we need to save away.  The rest of the wait() loop looks right in that it ensures we correctly wait on all children (even children of the g_child_pid) like an init process should.

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

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


More information about the crac-dev mailing list