The default exit code is only used when a process is killed by the system or through a signal. These are exceptional cases where exit code 1 (killed by Task Manager) is more appropriate than the normal termination code of 0.
Chromium does not restart helper processes that exit with code 0 (see [kill.h](https://source.chromium.org/chromium/chromium/src/+/main:base/process/kill.h...)), with this fix they are restarted when killed by the system or by a signal.
-- v3: server: Set the default thread exit code to 1.
From: Brendan Shanks bshanks@codeweavers.com
The default exit code is only used when a process is killed by the system or through a signal. These are exceptional cases where exit code 1 (killed by Task Manager) is more appropriate than the normal termination code of 0. --- server/process.c | 2 +- server/thread.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/server/process.c b/server/process.c index a0d5ea64d97..cb7ed0c92ad 100644 --- a/server/process.c +++ b/server/process.c @@ -919,7 +919,7 @@ static void terminate_process( struct process *process, struct thread *skip, int restart: LIST_FOR_EACH_ENTRY( thread, &process->thread_list, struct thread, proc_entry ) { - if (exit_code) thread->exit_code = exit_code; + if (exit_code || thread->exit_code == 1) thread->exit_code = exit_code; if (thread == skip) continue; if (thread->state == TERMINATED) continue; kill_thread( thread, 1 ); diff --git a/server/thread.c b/server/thread.c index 3e35b27f694..2621d5af070 100644 --- a/server/thread.c +++ b/server/thread.c @@ -239,7 +239,7 @@ static inline void init_thread_structure( struct thread *thread ) thread->reply_fd = NULL; thread->wait_fd = NULL; thread->state = RUNNING; - thread->exit_code = 0; + thread->exit_code = 1; /* default to "killed by Task Manager" unless set otherwise */ thread->priority = 0; thread->suspend = 0; thread->dbg_hidden = 0;
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=136843
Your paranoid android.
=== debian11b (64 bit WoW report) ===
Report validation errors: ntdll:exception is missing some failure messages
This merge request was closed by Brendan Shanks.
Closing this, Alexandre mentioned he would rather detect abnormal process termination and then set a nonzero exit code.
On Thu Sep 21 00:50:14 2023 +0000, Brendan Shanks wrote:
Closing this, Alexandre mentioned he would rather detect abnormal process termination and then set a nonzero exit code.
@julliard an alternative approach that explicitly detects abnormal process termination is discussed in !3908, would that be more in line with what you're looking for?