James-Yu / LaTeX-Workshop

Boost LaTeX typesetting efficiency with preview, compile, autocomplete, colorize, and more.
MIT License
10.43k stars 519 forks source link

Compilation process hangs #2921

Closed jonas-frey closed 2 years ago

jonas-frey commented 2 years ago

Preliminary questions [Required]

Disable all the other extensions except for LaTeX Workshop, restart VS Code, and check that you still see this issue. [Required]

You still see this issue?: Yes

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?: I cannot, but at least I get an error message and it doesn't hang.

Describe the bug [Required]

When I compile a file, the little wheel in the bottom bar keeps turning instead of compilation exiting with an error. When I stop the compilation with kill latex compiler process the wheel stops turning, but there's remains a pdflatex process in the background eating CPU.

To Reproduce

Compile file with the content

\documentclass{article}
\usepackage{mathtools}
\mathtoolsset{centercolon}
\usepackage{tikz-cd}

\begin{document}
\begin{tikzcd}\ar[r,","] &\end{tikzcd}$:$
\end{document}

with the standard recipe (latexmk).

The compilation should exit with an error, but hangs and cannot be properly terminated through vscode as described above.

Expected behavior

Compilation should fail and give error message.

Desktop [Required]

Please write exact version numbers. Please don't write latest instead of exact numbers.

Additional questions

Are you using VSCodium?

/No

Are you using the Snap or Flatpack versions of VS Code?

No

Are you using LaTeX Workshop with VS Code Remote?

No

tamuratak commented 2 years ago

スクリーンショット 2020-02-14 20 41 25

When all of the above is done, we will reopen this issue if needed.

jonas-frey commented 2 years ago

I don't want to paste the log, it contains lots of personal information.

Anyway, I think I've narrowed it down to the command pdflatex -interaction=nonstopmode file.tex hanging, which is probably a bug in pdflatex?

Edit: According to this stackexchange reply it's not a bug in pdflatex. So where does this leave us? Do we have to live with compilation occasionally hanging, and requiring commandline interference to kill?

tamuratak commented 2 years ago

I don't want to paste the log, it contains lots of personal information.

Then, we can do nothing on our side.

You can create a new account with a fake name on your PC and can reproduce the issue. Then, the log cannot include your private information.

Do we have to live with compilation occasionally hanging, and requiring commandline interference to kill?

On my Mac, the kill button works well with your example.

Please execute pdflatex directly without latexmk. It would be a workaround.

tamuratak commented 2 years ago

Another workaround is calling commands with -halt-on-error, not -interaction=nonstopmode.