Open gregg-miskelly opened 3 years ago
Tagging subscribers to this area: @tommcdon See info in area-owners.md if you want to be subscribed.
same problem was in netcoredbg cc @kfrolov @viewizard
Yes, we also faced with this issue and temporary added hook for waitpid
in netcoredbg code - https://github.com/Samsung/netcoredbg/blob/0809b8aa1a80c88b35a04106fbfeb9f5be42853e/src/debugger/manageddebugger.cpp#L41-L127
Description
On Linux/Mac the exit code of the target process is obtained through waitpid (Linux docs, Apple docs, PAL code that makes use of it). However, unlike on Windows -- if multiple places in a process are calling waitpid, unless the
WNOWAIT
flag is used (which doesn't seem to exist OSX), then my understanding is that this will prevent other callers from obtaining the exit code.The debugging services open a HANDLE to the target process (as expected) through the PAL, which means that they may wind up 'owning' the exit code of the target process, but they don't, at least as far as I know, wind up propagating this exit code to the debugger.
The potential fixes I can think of are:
Regression?
No, this has never worked on Linux/Mac