LaTeX-Workshop: Killing the build process makes vscode crash when pkill is provided by proctools
Preliminary questions [Required]
Disable all the other extensions except for LaTeX Workshop, restart VS Code, and check that you still see this issue.
You still see this issue?: Yes (sporadically)
Make sure to visit the wiki FAQ before filling an issue.
You visited the wiki?: Yes
If your issue is with compiling a document (not having to do with finding the root file of a project), check first that you can compile manually.
You can compile a TeX document manually?: No, but this is precisely the point
Describe the bug [Required]
Sometimes a build hangs, but when I do “Kill LaTeX Compiler Process”, it crashes VS Code.
To Reproduce
Steps to reproduce the behavior:
- Create a TeX document that hangs.
- Observe never-ending build-in-progress status in bottom-right of window:
. - Perform command “Kill LaTeX Compiler Process”.
- Observe VS Code crash (immediate, no dialog or information screen).
Expected behavior
Simply a peaceful termination of the LaTeX compiler process – not a crash of the entire VS Code app, naturally.
Logs [Required]
LaTeX Workshop Output [Required]
https://gist.github.com/0052a9d49640b2082303d4402df4640f
LaTeX Compiler Output
https://gist.github.com/53d6e54ebc347f2bdcb82297bd547299
Output from manually running latexmk command in terminal
https://gist.github.com/285257e52d062373d4f46327744041d1
Developer Tools Console [Required]
https://gist.github.com/abf948c0194689c6e8426a916746170f
Screenshots
See above.
Desktop [Required]
- OS: macOS 11.1
- VS Code version: 1.52.1
- Extension version: 8.15.0
- TeX distribution version: TeX Live 2020
Additional questions
Are you using VSCodium?
No
Are you using LaTeX Workshop with VS Code Remote?
No
Additional context
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 24 (7 by maintainers)
Commits related to this issue
- Use a synchronous kill process Related to #2484. — committed to James-Yu/LaTeX-Workshop by jlelong 3 years ago
I think I have the kill issue. In the
killfunction, we first kill all processes with parent pid equal the pid oflatexmkand then killlatexmkitselfhttps://github.com/James-Yu/LaTeX-Workshop/blob/afa3d71e8610db036087a11e03a0555664954f8f/src/components/builder.ts#L54-L62
Yet, the killing of child processes is done asynchronously. I suspect the parent process gets killed before the children (which are not killed because they are detached) and then they become orphans and are not killed by the
pkill -Pcommand. Usingcp.execSyncfixes the issue.@alexreg Could you try the code from the
masterbranch on Big Sur? See https://github.com/James-Yu/LaTeX-Workshop/blob/master/CONTRIBUTING.md if you do not know how to do this. Thanks for your help.#2491
https://gist.github.com/alexreg/3774664b1f8a8675b4f74edb1cd449d6