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

Shell task doesn't finish #37934

Closed
mickeypearce opened this issue Nov 9, 2017 · 19 comments
Closed

Shell task doesn't finish #37934

mickeypearce opened this issue Nov 9, 2017 · 19 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug candidate Issue identified as probable candidate for fixing in the next release important Issue identified as high-priority terminal Integrated terminal issues upstream Issue identified as 'upstream' component related (exists outside of VS Code) verified Verification succeeded windows VS Code on Windows issues

Comments

@mickeypearce
Copy link

Running background shell task (gulp task with params) doesn't finish.
Manual termination of task ends in "Assertion failed!" error by widpty.dll program.
Worked in previous version.

  • VSCode Version: 1.18.0
  • OS Version: Win 7 Enterprise

Steps to Reproduce:

Example tasks.json
{ "version": "2.0.0", "tasks": [ { "type": "shell", "label": "my gulp shell task", "command": "gulp --color exportFilesFromDb --env=DEV --file=${file}", "isBackground": false } ] }
image

task my gulp shell task

Tasks: Terminate task
image

@vscodebot vscodebot bot added the tasks Task system issues label Nov 9, 2017
@dbaeumer
Copy link
Member

dbaeumer commented Nov 9, 2017

I couldn't reproduce this using a simple gulp file.

@mickeypearce can you provide a GitHub repository that demos this
@Tyriar assigning to you since the crash happens in winpty.dll

@dbaeumer dbaeumer added terminal Integrated terminal issues and removed tasks Task system issues labels Nov 9, 2017
@dbaeumer dbaeumer assigned Tyriar and unassigned dbaeumer Nov 9, 2017
@mickeypearce
Copy link
Author

I made a simple demo repository (https://github.com/mickeypearce/vscode-taskproblem) that reproduces error on my machine. Please let me know if you can reproduce.

Screenshot after I run the task:
image

@tomblind
Copy link

tomblind commented Nov 10, 2017

Having the same issue with a simple task that runs a node script:

test.js:
console.log("foobar");

tasks.json:
tasks

It shows foobar in the terminal but the task never ends. Terminating gives the exact same assertion popup. It just started when upgrading to 1.18.0 (Windows 10).

@dbaeumer dbaeumer added the important Issue identified as high-priority label Nov 10, 2017
@dbaeumer
Copy link
Member

The problem is that the terminal crashes and doesn't send a final event onExit event hence the task system thinks the task is still running. Hence you can't rerun the task.

@Tyriar since more people are seeing this can you please investigate. This might be a candidate for a recovery build.

@dbaeumer
Copy link
Member

Tried to reproduce this using the examples provided but was not able to do so.

@kieferrm kieferrm added the candidate Issue identified as probable candidate for fixing in the next release label Nov 10, 2017
@mickeypearce mickeypearce changed the title Background shell task doesn't finish Shell task doesn't finish Nov 10, 2017
@dbaeumer
Copy link
Member

@Tyriar to mitigate this it would help if the terminal service sends and event when the terminal process crashes / dies. Then the task service could at least clean up its state and the user could try to run the task again.

@Tyriar
Copy link
Member

Tyriar commented Nov 10, 2017

I think the not finishing is this #31301

As for the assertion, I would guess it's a race condition related to the process leak fix microsoft/node-pty#122

https://github.com/Tyriar/node-pty/blob/01f79cfd3a222aaee2977fefde35ef798a921b38/src/windowsPtyAgent.ts#L99

@Tyriar
Copy link
Member

Tyriar commented Nov 10, 2017

@Tyriar
Copy link
Member

Tyriar commented Nov 10, 2017

The error occurs when querying winpty_get_console_process_list when the pty handle has already been evicted from ptyHandles.

@Tyriar
Copy link
Member

Tyriar commented Nov 10, 2017

Upstream issue: microsoft/node-pty#158

@Tyriar Tyriar added bug Issue identified by VS Code Team member as probable bug upstream Issue identified as 'upstream' component related (exists outside of VS Code) windows VS Code on Windows issues labels Nov 10, 2017
@Tyriar Tyriar added this to the October Recovery 2017 milestone Nov 10, 2017
@Tyriar
Copy link
Member

Tyriar commented Nov 10, 2017

PR is out microsoft/node-pty#160

@Tyriar
Copy link
Member

Tyriar commented Nov 12, 2017

Since the team had difficulty reproducing the issue, it would be great if someone that can repro could test this build to see if it still occurs: https://az764295.vo.msecnd.net/insider/5676c71a4c02632e14c97aefc049e339848552e6/VSCodeSetup-x64-1.18.0-insider.exe

@tomblind
Copy link

That build fixed it for me. Tasks are finishing normally again.

@alex-smtv
Copy link

I had a similar issue and that build also fixed it for me.

@mickeypearce
Copy link
Author

Same here. It works.

@ericksonivanowski
Copy link

Same here. It works too.

@kieferrm kieferrm added the verified Verification succeeded label Nov 16, 2017
@mikes-gh
Copy link

October Recovery 1.18.1 fixes it for me thanks

@ericksonivanowski
Copy link

to me too

@Tyriar
Copy link
Member

Tyriar commented Nov 17, 2017

Thanks a lot for helping with verification 🙂

@vscodebot vscodebot bot locked and limited conversation to collaborators Dec 26, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug candidate Issue identified as probable candidate for fixing in the next release important Issue identified as high-priority terminal Integrated terminal issues upstream Issue identified as 'upstream' component related (exists outside of VS Code) verified Verification succeeded windows VS Code on Windows issues
Projects
None yet
Development

No branches or pull requests

8 participants