You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
Closing the pseudoconsole session while the hosted process is still starting up and connecting can result in an error dialog being shown by the client application. The same error dialog is shown if the hosted process is given an invalid pseudoconsole handle for startup. To the hosted process initialization code, the two circumstances are identical. The pop-up dialog from the hosted client application on failure will read 0xc0000142 with a localized message detailing failure to initialize.
It seems to work to kill the child process on parent termination with JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE (included in the #if 0 section 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.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
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 0
section 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))
Beta Was this translation helpful? Give feedback.
All reactions