Flurry of `WARN Reaped child` when killing Chrome

I’m running chrome in a worker thread with chrome-launcher and after I’m done I get rid of chrome with the provided kill command chrome.kill() so it releases the insane amount of RAM it was hogging. But every time I do it adds a bunch of noise to the logs:

WARN Reaped child process with pid: 773 and signal: SIGKILL, core dumped? false
WARN Reaped child process with pid: 753 and signal: SIGKILL, core dumped? false
WARN Reaped child process with pid: 858 and signal: SIGKILL, core dumped? false
WARN Reaped child process with pid: 878 and signal: SIGKILL, core dumped? false
WARN Reaped child process with pid: 728 and signal: SIGKILL, core dumped? false
WARN Reaped child process with pid: 729 and signal: SIGKILL, core dumped? false
WARN Reaped child process with pid: 751 and signal: SIGKILL, core dumped? false
WARN Reaped child process with pid: 846 and signal: SIGKILL, core dumped? false
WARN Reaped child process with pid: 827 and signal: SIGKILL, core dumped? false
WARN Reaped child process with pid: 868 and signal: SIGKILL, core dumped? false
WARN Reaped child process with pid: 883 and signal: SIGKILL, core dumped? false
WARN Reaped child process with pid: 798 and signal: SIGKILL, core dumped? false
WARN Reaped child process with pid: 799 and signal: SIGKILL, core dumped? false
WARN Reaped child process with pid: 826 and signal: SIGKILL, core dumped? false

I see it originates from here init-snapshot/src/bin/init/main.rs at 48cf36ff7ac6229df66bf1de2b1e2b1c233b2e51 · superfly/init-snapshot · GitHub

SIGKILL is a bit harsh in general, what would be preferred way to terminate the process or make the logs more quiet in some other way?

Also, what does core dumped? false actually mean?

Thanks!

Hi @hilja—these are interesting questions!

For anyone reading who’s unfamiliar with this: This log message occurs when init adopts an orphan process and that process terminates. Sometimes processes may be “orphaned” unintentionally, so this message lets you know that it happened and what the exit status was. My guess is that it is a “WARN” message simply because it’s often an unusual/unintended situation.

In this case, I suspect that Chrome is running multiple processes, and that the parent process is SIGKILLed before the children, so they are orphaned and re-parented in the tiny amount of time before they themselves are also SIGKILLed.

Perhaps sending SIGTERM instead would be better. However, I’m not sure how it would interact with Chrome’s multi-process design, or if it would actually prevent processes from being orphaned. You’d have to try it out and see! (Also, FWIW, it does look like chrome-launcher uses SIGKILL intentionally :man_shrugging:.)

I’d also propose that in this case, the log messages are explainable and probably not indicative of a bug or problem, so you may not need to worry about addressing them. That said, if they’re still annoying, confusing, or otherwise getting in your way, I’d be happy to hear more about that!

It refers to whether a copy of the program’s memory was saved to disk for use in debugging, which can happen if the process crashes. AFAIK core dumps are disabled by default on Linux and our init doesn’t change this, so this will always be false unless you enable them explicitly.

1 Like

Thanks, good to finally understand this more deeply.

Also great, don’t need that for anything.

I’m happy to just ignore the logs :slight_smile:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.