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

Freezes since version 2.0 on Windows #284

Closed
technician77 opened this issue Jul 25, 2020 · 8 comments
Closed

Freezes since version 2.0 on Windows #284

technician77 opened this issue Jul 25, 2020 · 8 comments
Assignees
Labels
bug Something isn't working

Comments

@technician77
Copy link

Could you check if something broke the windows built since 2.0?

As soon as I edit a tex file emacs freezes and texlab takes 100% cpu forever when using the current 2.2 version. My intuition told me try lower than 2.0 and bingo it was working. Tried 2.0 and 2.1, same as 2.2.

TexDistro is Miktex, latest version. Emacs is GNU Emacs 27.0.91 (build 1, x86_64-w64-mingw32) of 2020-04-20 on latest Win10,
this config:

  (use-package flycheck
    :init (global-flycheck-mode))
  (use-package lsp-mode
    :hook (lsp-mode . lsp-enable-which-key-integration)
    :commands lsp
    :custom
    (lsp-print-io t))
  (use-package lsp-ui
    :hook (lsp-mode . lsp-ui-mode)
    :commands lsp-ui-mode)
  (use-package lsp-latex
    :hook
    (LaTeX-mode . lsp)
    (tex-mode . lsp))

and this test document:

\documentclass{article}
\title{This is my first document}
\author{Test}
\date{Test}
\begin{document}
\maketitle
Hello!
\end{document}
@pfoerster pfoerster added the bug Something isn't working label Jul 30, 2020
@efoerster
Copy link
Member

efoerster commented Jul 31, 2020

Thanks for the report. I could not reproduce this issue on my machine. Can you provide a log file (you need to pass the -vvvv flag to texlab)?

@technician77
Copy link
Author

technician77 commented Aug 4, 2020

Below is the output using texlab 2.2 with -vvvv option. The last message is generate approximately at a rate of 30000 messages per 30 seconds. Please note that the file opened is a different latex file than in the original post mentioned.

The output of version 1.10 is normal and texlab works as expected unsing this version.

TRACE - Received message:
{"jsonrpc":"2.0","method":"initialize","params":{"processId":null,"rootPath":"c:/!Data/home/myuser/tex","clientInfo":{"name":"emacs","version":"GNU Emacs 27.0.91 (build 1, x86_64-w64-mingw32)\n of 2020-04-20"},"rootUri":"file:///c%3A/%21Data/home/myuser/tex","capabilities":{"workspace":{"workspaceEdit":{"documentChanges":true,"resourceOperations":["create","rename","delete"]},"applyEdit":true,"symbol":{"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]}},"executeCommand":{"dynamicRegistration":false},"didChangeWatchedFiles":{"dynamicRegistration":true},"workspaceFolders":true,"configuration":true},"textDocument":{"declaration":{"linkSupport":true},"definition":{"linkSupport":true},"implementation":{"linkSupport":true},"typeDefinition":{"linkSupport":true},"synchronization":{"willSave":true,"didSave":true,"willSaveWaitUntil":true},"documentSymbol":{"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]},"hierarchicalDocumentSymbolSupport":true},"formatting":{"dynamicRegistration":true},"rangeFormatting":{"dynamicRegistration":true},"rename":{"dynamicRegistration":true,"prepareSupport":true},"codeAction":{"dynamicRegistration":true,"isPreferredSupport":true,"codeActionLiteralSupport":{"codeActionKind":{"valueSet":["","quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"]}}},"completion":{"completionItem":{"snippetSupport":true,"documentationFormat":["markdown"],"resolveAdditionalTextEditsSupport":true},"contextSupport":true},"signatureHelp":{"signatureInformation":{"parameterInformation":{"labelOffsetSupport":true}}},"documentLink":{"dynamicRegistration":true,"tooltipSupport":true},"hover":{"contentFormat":["markdown","plaintext"]},"foldingRange":{"dynamicRegistration":true},"callHierarchy":{"dynamicRegistration":false},"publishDiagnostics":{"relatedInformation":true,"tagSupport":{"valueSet":[1,2]},"versionSupport":true}},"window":{"workDoneProgress":true}},"initializationOptions":null,"workDoneToken":"1"},"id":1}


TRACE - Sent message:
Content-Length: 592

{"jsonrpc":"2.0","result":{"capabilities":{"completionProvider":{"resolveProvider":true,"triggerCharacters":["\\","{","}","@","/"," "]},"definitionProvider":true,"documentFormattingProvider":true,"documentHighlightProvider":true,"documentLinkProvider":{"resolveProvider":false},"documentSymbolProvider":true,"foldingRangeProvider":true,"hoverProvider":true,"referencesProvider":true,"renameProvider":{"prepareProvider":true},"textDocumentSync":{"change":1,"openClose":true,"save":{"includeText":false}},"workspaceSymbolProvider":true},"serverInfo":{"name":"TexLab","version":"2.2.0"}},"id":1}

TRACE - Received message:
{"jsonrpc":"2.0","method":"initialized","params":{}}


TRACE - Sent message:
Content-Length: 100

{"jsonrpc":"2.0","method":"workspace/configuration","params":{"items":[{"section":"latex"}]},"id":0}

TRACE - Received message:
{"jsonrpc":"2.0","method":"workspace/didChangeConfiguration","params":{"settings":{"latex":{"lint":{"onSave":false,"onChange":false},"forwardSearch":{"args":[]},"build":{"forwardSearchAfter":false,"outputDirectory":".","onSave":false,"args":["-pdf","-interaction=nonstopmode","-synctex=1","%f"],"executable":"latexmk"},"rootDirectory":"."}}}}


TRACE - Received message:
{"jsonrpc":"2.0","method":"workspace/didChangeConfiguration","params":{"settings":{"bibtex":{"formatting":{"formatter":"texlab","lineLength":120}}}}}


TRACE - Received message:
{"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"uri":"file:///c%3A/%21Data/home/myuser/tex/samplefile.tex","languageId":"latex","version":0,"text":"\\documentclass{article}\n\n\\begin{document}\n\n\n\n\\centerline{\\sc \\large A Simple Sample \\LaTeX\\ File}\n\\vspace{.5pc}\n\\centerline{\\sc Stupid Stuff I Wish Someone Had Told Me Four Years Ago}\n\\centerline{\\it (Read the .tex file along with this or it won't \n            make much sense)}\n\\vspace{2pc}\n\nThe first thing to realize about \\LaTeX\\ is that it is not ``WYSIWYG''. \nIn other words, it isn't a word processor; what you type into your \n.tex file is not what you'll see in your .dvi file.  For example, \n\\LaTeX\\ will      completely     ignore               extra\nspaces    within                             a line of your .tex file.\nPressing return\nin \nthe \nmiddle \nof\na\nline\nwill not register in your .dvi file. However, a double carriage-return\nis read as a paragraph break.\n\nLike this.  But any carriage-returns after the first two will be \ncompletely ignored; in other words, you \n\n\ncan't \n\nadd\n\n\n\n\n\n\nmore \n\n\n\n\nspace \n\n\nbetween \n\n\n\n\nlines, no matter how many times you press return in your .tex file.\n\nIn order to add vertical space you have to use ``vspace''; for example, \nyou could add an inch of space by typing \\verb|\\vspace{1in}|, like this:\n\\vspace{1in}\n\nTo get three lines of space you would type \\verb|\\vspace{3pc}|\n(``pc'' stands for ``pica'', a font-relative size), like this:\n\\vspace{3pc}\n\nNotice that \\LaTeX\\ commands are always preceeded by a backslash.  \nSome commands, like \\verb|\\vspace|, take arguments (here, a length) in\ncurly brackets.  \n\nThe second important thing to notice about \\LaTeX\\ is that you type \nin various ``environments''...so far we've just been typing regular \ntext (except for a few inescapable usages of \\verb|\\verb| and the\ncentered, smallcaps, large title).  There are basically two ways that \nyou can enter and/or exit an environment;\n\\vspace{1pc}\n\n\\centerline{this is the first way...}\n\n\\begin{center}\nthis is the second way.\n\\end{center}\n\n\\noindent Actually there is one more way, used above; for example, \n{\\sc this way}.  The way that you get in and out of environment varies\ndepending on which kind of environment you want; for example, you use \n\\verb|\\underline| ``outside'', but \\verb|\\it| ``inside''; \nnotice \\underline{this} versus {\\it this}.\n\nThe real power of \\LaTeX\\ (for us) is in the math environment. You \npush and pop out of the math environment by typing \\verb|$|. For \nexample, $2x^3 - 1 = 5$ is typed between dollar signs as\n\\verb|$2x^3 - 1 = 5$|. Perhaps a more interesting example is\n$\\lim_{N \\to \\infty} \\sum_{k=1}^N f(t_k) \\Delta t$.\n\nYou can get a fancier, display-style math \nenvironment by enclosing your equation with double dollar signs.  \nThis will center your equation, and display sub- and super-scripts in \na more readable fashion:\n\n$$\\lim_{N \\to \\infty} \\sum_{k=1}^N f(t_k) \\Delta t.$$\n\nIf you don't want your equation to be centered, but you want the nice \nindicies and all that, you can use \\verb|\\displaystyle| and get your \nformula ``in-line''; using our example this is \n$\\displaystyle \\lim_{N \\to \\infty} \\sum_{k=1}^N f(t_k) \\Delta t.$  Of \ncourse this can screw up your line spacing a little bit.\n\nThere are many more things to know about \\LaTeX\\ and we can't \npossibly talk about them all here.\nYou can use \\LaTeX\\ to get tables, commutative diagrams, figures, \naligned equations, cross-references, labels, matrices, and all manner \nof strange things into your documents.  You can control margins, \nspacing, alignment, {\\it et cetera} to higher degrees of accuracy than \nthe human eye can percieve.  You can waste entire days typesetting \ndocuments to be ``just so''.  In short, \\LaTeX\\ rules.\n\nThe best way to learn \\LaTeX\\ is by example. Get yourself a bunch\nof .tex files, see what kind of output they produce, and figure out how\nto modify them to do what you want.  There are many template and \nsample files on the department \\LaTeX\\ page and in real life in the \nbig binder that should be in the computer lab somewhere.  Good luck!\n\n\\centerline{\\sc Bla Bla}\n\\centerline\n\n\n\\end{document}\n%%% Local Variables:\n%%% TeX-master: t\n%%% End:\n"}}}


DEBUG - Adding document: file:///c%3A/%21Data/home/myuser/tex/samplefile.tex
TRACE - Received message:
{"jsonrpc":"2.0","method":"textDocument/documentLink","params":{"textDocument":{"uri":"file:///c%3A/%21Data/home/myuser/tex/samplefile.tex"}},"id":2}


DEBUG - Loading document: file:///C:/!Data/home/myuser/tex/samplefile.aux
TRACE - Sent message:
Content-Length: 148

{"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"diagnostics":[],"uri":"file:///c%3A/%21Data/home/myuser/tex/samplefile.tex"}}

DEBUG - Loading document: file:///C:/!Data/home/myuser/tex/samplefile.aux
TRACE - Sent message:
Content-Length: 144

{"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"diagnostics":[],"uri":"file:///C:/!Data/home/myuser/tex/samplefile.aux"}}

TRACE - Sent message:
Content-Length: 148

{"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"diagnostics":[],"uri":"file:///c%3A/%21Data/home/myuser/tex/samplefile.tex"}}

TRACE - Sent message:
Content-Length: 144

{"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"diagnostics":[],"uri":"file:///C:/!Data/home/myuser/tex/samplefile.aux"}}

DEBUG - Loading document: file:///C:/!Data/home/myuser/tex/samplefile.aux
DEBUG - Loading document: file:///C:/!Data/home/myuser/tex/samplefile.aux
DEBUG - Loading document: file:///C:/!Data/home/myuser/tex/samplefile.aux
DEBUG - Loading document: file:///C:/!Data/home/myuser/tex/samplefile.aux
DEBUG - Loading document: file:///C:/!Data/home/myuser/tex/samplefile.aux
DEBUG - Loading document: file:///C:/!Data/home/myuser/tex/samplefile.aux
DEBUG - Loading document: file:///C:/!Data/home/myuser/tex/samplefile.aux
DEBUG - Loading document: file:///C:/!Data/home/myuser/tex/samplefile.aux
DEBUG - Loading document: file:///C:/!Data/home/myuser/tex/samplefile.aux
DEBUG - Loading document: file:///C:/!Data/home/myuser/tex/samplefile.aux
DEBUG - Loading document: file:///C:/!Data/home/myuser/tex/samplefile.aux
DEBUG - Loading document: file:///C:/!Data/home/myuser/tex/samplefile.aux
DEBUG - Loading document: file:///C:/!Data/home/myuser/tex/samplefile.aux
DEBUG - Loading document: file:///C:/!Data/home/myuser/tex/samplefile.aux
DEBUG - Loading document: file:///C:/!Data/home/myuser/tex/samplefile.aux
DEBUG - Loading document: file:///C:/!Data/home/myuser/tex/samplefile.aux
DEBUG - Loading document: file:///C:/!Data/home/myuser/tex/samplefile.aux
DEBUG - Loading document: file:///C:/!Data/home/myuser/tex/samplefile.aux
DEBUG - Loading document: file:///C:/!Data/home/myuser/tex/samplefile.aux
DEBUG - Loading document: file:///C:/!Data/home/myuser/tex/samplefile.aux
DEBUG - Loading document: file:///C:/!Data/home/myuser/tex/samplefile.aux
DEBUG - Loading document: file:///C:/!Data/home/myuser/tex/samplefile.aux
DEBUG - Loading document: file:///C:/!Data/home/myuser/tex/samplefile.aux
DEBUG - Loading document: file:///C:/!Data/home/myuser/tex/samplefile.aux
DEBUG - Loading document: file:///C:/!Data/home/myuser/tex/samplefile.aux
DEBUG - Loading document: file:///C:/!Data/home/myuser/tex/samplefile.aux
DEBUG - Loading document: file:///C:/!Data/home/myuser/tex/samplefile.aux
DEBUG - Loading document: file:///C:/!Data/home/myuser/tex/samplefile.aux
DEBUG - Loading document: file:///C:/!Data/home/myuser/tex/samplefile.aux
DEBUG - Loading document: file:///C:/!Data/home/myuser/tex/samplefile.aux
DEBUG - Loading document: file:///C:/!Data/home/myuser/tex/samplefile.aux
DEBUG - Loading document: file:///C:/!Data/home/myuser/tex/samplefile.aux
DEBUG - Loading document: file:///C:/!Data/home/myuser/tex/samplefile.aux
DEBUG - Loading document: file:///C:/!Data/home/myuser/tex/samplefile.aux
DEBUG - Loading document: file:///C:/!Data/home/myuser/tex/samplefile.aux
DEBUG - Loading document: file:///C:/!Data/home/myuser/tex/samplefile.aux
DEBUG - Loading document: file:///C:/!Data/home/myuser/tex/samplefile.aux
DEBUG - Loading document: file:///C:/!Data/home/myuser/tex/samplefile.aux
DEBUG - Loading document: file:///C:/!Data/home/myuser/tex/samplefile.aux
DEBUG - Loading document: file:///C:/!Data/home/myuser/tex/samplefile.aux
DEBUG - Loading document: file:///C:/!Data/home/myuser/tex/samplefile.aux
DEBUG - Loading document: file:///C:/!Data/home/myuser/tex/samplefile.aux
DEBUG - Loading document: file:///C:/!Data/home/myuser/tex/samplefile.aux

@pfoerster
Copy link
Member

Thanks for the log file. Can you try removing the exclamation mark from the path and see if it works? There seems to be an error related with URL encoding on our side. Removing special characters from the path should be a workaround for now.

@technician77
Copy link
Author

technician77 commented Aug 6, 2020

I moved the .tex and the .aux to C:\Temp\tex\ but texlab 2.2 remained it's 100% CPU behaviour. Or were you talking about texlab.exe? Practically everything, including emacs and texlab.exe, is in "exclamation mark folders".

@technician77
Copy link
Author

Your information implied to me that the exclamation mark in a folder could be a problem in general. I changed that so these folders , including emacs, texlab and the texfile, now start with an underscore, I hope this is better. But even with that change and a reboot the problem remains. I'll stay on 1.10 until the problem is resolved.

@h-mikisato
Copy link

I have run into the same bug.

Windows version: Windows 10 Home 2004 (19041.630)
Emacs version: GNU Emacs 27.1 (build 1, x86_64-w64-mingw32) of 2020-08-12

lsp-mode and flycheck Config:

(use-package lsp-mode
  :commands (lsp lsp-deferred)
  :init
  (setq lsp-keymap-prefix "C-c l")
  :custom
  (lsp-enable-snippet nil)
  )

(use-package lsp-ivy :commands lsp-ivy-workspace-symbol)

(use-package lsp-ui
  :custom
  (lsp-ui-sideline-show-diagnostics nil)
  :hook
  (lsp-mode . lsp-ui-mode))

(use-package flycheck)

(use-package flycheck-posframe
  :hook (flycheck-mode . flycheck-posframe-mode))

(use-package auctex
  :mode
  ("\\.tex$" . LaTeX-mode)
  :hook
  (LaTeX-mode . (lambda ()
                  (turn-on-reftex)
                  (LaTeX-math-mode)
                  (flycheck-mode)
                  (lsp-deferred)))
  :custom
  (font-latex-fontify-sectioning 1.0)
  (font-latex-fontify-script nil)
  (reftex-plug-into-AUCTeX t)
  (reftex-enable-partial-scans t))

And the path to .tex file does not contain any special characters (like "C:\Users\hmikisato\Projects\some-document\some-docukent.tex")

@pfoerster
Copy link
Member

Sorry for the long delay. Can you try the latest version of texlab (3.1.0), please? In the meantime, we updated the workspace analysis algorithm, which (hopefully) resolves this issue. For some people, it seems to reduce the CPU usage: #400 (comment).

@technician77
Copy link
Author

Yes, it works with 3.1 for me, just like 1.10 did until now. Thanks for tracking down the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants