Skip to content

Commit dd97d50

Browse files
committed
DPL: better message when child dies
1 parent 42978b6 commit dd97d50

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Framework/Core/src/runDataProcessing.cxx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -864,10 +864,9 @@ bool processSigChild(DeviceInfos& infos, DeviceSpecs& specs)
864864
int status;
865865
pid_t pid = waitpid((pid_t)(-1), &status, WNOHANG);
866866
if (pid > 0) {
867+
// Normal exit
867868
int es = WEXITSTATUS(status);
868-
869869
if (WIFEXITED(status) == false || es != 0) {
870-
es = WIFEXITED(status) ? es : 128 + es;
871870
// Look for the name associated to the pid in the infos
872871
std::string id = "unknown";
873872
assert(specs.size() == infos.size());
@@ -882,8 +881,9 @@ bool processSigChild(DeviceInfos& infos, DeviceSpecs& specs)
882881
} else if (forceful_exit) {
883882
LOGP(error, "pid {} ({}) was forcefully terminated after being requested to quit", pid, id);
884883
} else {
885-
if (es == 128) {
886-
LOGP(error, "Workflow crashed - pid {} ({}) was killed abnormally with exit code {}, could be out of memory killer, segfault, unhandled exception, SIGKILL, etc...", pid, id, es);
884+
if (WIFSIGNALED(status)) {
885+
int exitSignal = WTERMSIG(status);
886+
LOGP(error, "Workflow crashed - pid {} ({}) was killed abnormally with {} and exited with {}", pid, id, strsignal(exitSignal), es);
887887
} else {
888888
LOGP(error, "pid {} ({}) crashed with or was killed with exit code {}", pid, id, es);
889889
}

0 commit comments

Comments
 (0)