(Pseudo Console) Application Error 0xc0000142 pops up when the parent is killed. How to avoid this popup? #16975
Unanswered
asmichi (asmichi)
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hello, I am using pseudo consoles in my library to (a) run a child process in a UTF-8 console and (b) send Ctrl+C.
Suppose the parent is a console app, continuously launches child processes attached to pseudo consoles... and killed with the [x] button or something immediately after launching a child process. Then its leftover child process sometimes tries to connect to a closed pseudo console and pops up the "Application Error" (0xc0000142) dialog as described in the document:
Here is an artificial repro of the popup: https://gist.github.com/asmichi/a37622e5cb7117e2870df68f750cb69b .
Is there any way to avoid this popup?
It seems to work to kill the child process on parent termination with
JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE(included in the#if 0section of the repro). Because the parent is forcibly killed, forcibly killing the children can make sense.However, if there is a better solution, I'd really appreciate your help.
(Also mentioned in: #4132 (comment))
All reactions