Module: wine Branch: master Commit: 9fa65a8751f36eea57d52717c9f8df2c27924458 URL: https://source.winehq.org/git/wine.git/?a=commit;h=9fa65a8751f36eea57d52717c...
Author: Piotr Caban piotr@codeweavers.com Date: Tue Jan 8 16:12:27 2019 +0100
server: Fix process trace_data initialization race on Mac.
Signed-off-by: Piotr Caban piotr@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/ntdll/server.c | 7 ++++--- server/process.c | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/dlls/ntdll/server.c b/dlls/ntdll/server.c index 38356f4..094b530 100644 --- a/dlls/ntdll/server.c +++ b/dlls/ntdll/server.c @@ -1419,9 +1419,6 @@ void server_init_process(void) "Or maybe the wrong wineserver is still running?\n", version, SERVER_PROTOCOL_VERSION, (version > SERVER_PROTOCOL_VERSION) ? "wine" : "wineserver" ); -#ifdef __APPLE__ - send_server_task_port(); -#endif #if defined(__linux__) && defined(HAVE_PRCTL) /* work around Ubuntu's ptrace breakage */ if (server_pid != -1) prctl( 0x59616d61 /* PR_SET_PTRACER */, server_pid ); @@ -1440,6 +1437,10 @@ void server_init_process_done(void) NTSTATUS status; int suspend;
+#ifdef __APPLE__ + send_server_task_port(); +#endif + /* Install signal handlers; this cannot be done earlier, since we cannot * send exceptions to the debugger before the create process event that * is sent by REQ_INIT_PROCESS_DONE. diff --git a/server/process.c b/server/process.c index 3bd545a..e55c8a8 100644 --- a/server/process.c +++ b/server/process.c @@ -587,7 +587,6 @@ data_size_t init_process( struct thread *thread ) struct process *process = thread->process; struct startup_info *info = process->startup_info;
- init_process_tracing( process ); if (!info) return 0; return info->data_size; } @@ -1319,6 +1318,7 @@ DECL_HANDLER(init_process_done) if (process->exe_file) release_object( process->exe_file ); process->exe_file = NULL;
+ init_process_tracing( process ); generate_startup_debug_events( process, req->entry ); set_process_startup_state( process, STARTUP_DONE );