Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Program does not stop when windows terminal is closed. #13586

Closed
kotenok2000 opened this issue Jul 24, 2022 · 8 comments
Closed

Program does not stop when windows terminal is closed. #13586

kotenok2000 opened this issue Jul 24, 2022 · 8 comments
Labels
Area-Remoting Communication layer between windows. Often for windowing behavior, quake mode, etc. Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Tag-Fix Doesn't match tag requirements Product-Terminal The new Windows Terminal.

Comments

@kotenok2000
Copy link

Windows Terminal version

1.14.1963.0

Windows build number

10.0.22000.795

Other Software

doecm 1.10
https://mklasson.com/factors/index.php
https://mklasson.com/doecm_110_win.zip

Steps to reproduce

Unpack doecm_110_win.zip
run run.bat
close windows terminal window
ecm.exe gets killed. Doecm process doesn't get killed and tries to spawn ecm.exe
each time doecm tries to spawn ecm.exe cmd.exe fails with 0xc0000142 error

Expected Behavior

No response

Actual Behavior

When i close windows terminal window ecm.exe gets killed, but doecm.exe process doesn't get killed and tries to spawn ecm.exe
each time doecm tries to spawn ecm.exe cmd.exe fails with 0xc0000142 error

@kotenok2000 kotenok2000 added the Issue-Bug It either shouldn't be doing this or needs an investigation. label Jul 24, 2022
@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Jul 24, 2022
@DHowett
Copy link
Member

DHowett commented Jul 25, 2022

Does this happen outside of Windows Terminal?

@DHowett DHowett added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Jul 25, 2022
@kotenok2000
Copy link
Author

kotenok2000 commented Jul 25, 2022

It doesn't happen when i run it in conhost

@ghost ghost added Needs-Attention The core contributors need to come back around and look at this ASAP. and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something labels Jul 25, 2022
@zadjii-msft
Copy link
Member

run.bat

start /B /LOW /WAIT doecm.exe %1 %2 %3 %4 %5 %6 %7 %8 %9

There's a int main( int argc, char ** argv ) { in the doecm.cc file, which makes me think this is a console subsystem application, not a windows subsystem one.

From the included README:

One quirk of the "start" program used to set priority in run.bat is that it
disables ctrl-c. Ctrl-break still works though.

start /?

Starts a separate window to run a specified program or command.

START ["title"] [/D path] [/I] [/MIN] [/MAX] [/SEPARATE | /SHARED]
      [/LOW | /NORMAL | /HIGH | /REALTIME | /ABOVENORMAL | /BELOWNORMAL]
      [/NODE <NUMA node>] [/AFFINITY <hex affinity mask>] [/WAIT] [/B]
      [/MACHINE <x86|amd64|arm|arm64>][command/program] [parameters]
...
    B           Start application without creating a new window. The
                application has ^C handling ignored. Unless the application
                enables ^C processing, ^Break is the only way to interrupt
                the application.

So, doecm.exe gets a copy of the current console handles, not a new set of handles.

Unfortunately, there's not a lot of other source there to go off of. Seems like the Terminal is closing out the console handle, but for whatever reason, doecm.exe doesn't have anything to check if the console handle is still open and close itself. So it goes on, tries to spawn an ecm.exe, and that can't inherit the console (because there is no console), and that throws the 0xc0000142. That's mostly conjecture, based off the little bit of source code included.

We may need the maintainer to hop in here to help ID what's going on...

@ghost ghost added Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something No-Recent-Activity This issue/PR is going stale and may be auto-closed without further activity. and removed Needs-Attention The core contributors need to come back around and look at this ASAP. labels Jul 26, 2022
@ghost
Copy link

ghost commented Jul 30, 2022

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

@kotenok2000
Copy link
Author

Bump.
I think the bot is buggy. it says that the issue "Needs-Author-Feedback" but in actuality it "Needs-Attention"

@ghost ghost added Needs-Attention The core contributors need to come back around and look at this ASAP. and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something No-Recent-Activity This issue/PR is going stale and may be auto-closed without further activity. labels Jul 30, 2022
@zadjii-msft
Copy link
Member

You know, yea that's a bit of a bug. This: image triggered the bot's "we need the author's feedback" routine accidentally.

That being said, we still do need direct insight from the maintainer of doecm here. From what I can see of the source, I would expect closing the terminal (and thereby closing the console) to close this process. It kinda feels like something that needs to be reported to doecm.

I'll give the bot another week, but there's not much more we can investigate here...

@zadjii-msft zadjii-msft added Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something and removed Needs-Attention The core contributors need to come back around and look at this ASAP. labels Aug 10, 2022
@kotenok2000
Copy link
Author

kotenok2000 commented Aug 10, 2022

why does conhost close the process, but windows terminal doesn't?

@ghost ghost added Needs-Attention The core contributors need to come back around and look at this ASAP. and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something labels Aug 10, 2022
@lhecker
Copy link
Member

lhecker commented Dec 13, 2022

This was fixed by #14282. Thank you again for your report! It was quite helpful during later testing.

@lhecker lhecker closed this as completed Dec 13, 2022
@lhecker lhecker added Product-Terminal The new Windows Terminal. Area-Remoting Communication layer between windows. Often for windowing behavior, quake mode, etc. and removed Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Attention The core contributors need to come back around and look at this ASAP. Needs-Tag-Fix Doesn't match tag requirements labels Dec 13, 2022
@ghost ghost added the Needs-Tag-Fix Doesn't match tag requirements label Dec 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Remoting Communication layer between windows. Often for windowing behavior, quake mode, etc. Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Tag-Fix Doesn't match tag requirements Product-Terminal The new Windows Terminal.
Projects
None yet
Development

No branches or pull requests

4 participants