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

texlab takes 100% CPU when many acronyms #212

Closed
symphorien opened this issue Apr 21, 2020 · 5 comments
Closed

texlab takes 100% CPU when many acronyms #212

symphorien opened this issue Apr 21, 2020 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@symphorien
Copy link

Setup: neovim 0.4.3 with LanguageClientNeovim LanguageClient 0.1.156
configuration (in .vim/settings.json):

{
  "latex.build.onSave": true
}

steps to reproduce:
open this file:

\documentclass[letterpaper,twocolumn,10pt]{article}
\pagestyle{empty}

% acronyms
\usepackage[%
  acronym,
  automake,
  nogroupskip,
  nopostdot,
  nonumberlist,
  toc,
  ]{glossaries}

\newacronym{AEAD}{AEAD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD3}{AEA2D}{Authenticated Encryption with Associated Data}
\newacronym{AEAD4}{AEA3D}{Authenticated Encryption with Associated Data}
\newacronym{AEAD5}{AEA4D}{Authenticated Encryption with Associated Data}
\newacronym{AEAD6}{AEA5D}{Authenticated Encryption with Associated Data}
\newacronym{AEAD7}{AEA6D}{Authenticated Encryption with Associated Data}
\newacronym{AEAD8}{AEA7D}{Authenticated Encryption with Associated Data}
\newacronym{AEAD9}{AEA8D}{Authenticated Encryption with Associated Data}
\newacronym{AEAD10}{AE9AD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD11}{AE10AD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD12}{AE11AD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD13}{AE12AD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD14}{AE13AD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD15}{AE14AD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD16}{AE15AD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD17}{AE16AD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD18}{AE17AD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD19}{AE18AD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD20}{AE19AD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD21}{AE20AD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD22}{AE21AD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD23}{AE22AD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD24}{AE23AD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD25}{AE24AD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD26}{AE25AD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD27}{AE26AD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD28}{AE27AD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD29}{AE28AD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD30}{AE29AD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD31}{AE30AD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD32}{AE31AD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD33}{AE32AD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD34}{AE33AD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD35}{AE34AD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD36}{AE35AD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD37}{AE36AD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD38}{AE37AD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD39}{AE38AD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD40}{AE39AD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD41}{AE40AD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD42}{AE41AD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD43}{AE42AD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD44}{AE43AD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD45}{AE44AD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD46}{AE45AD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD47}{AE46AD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD48}{AE47AD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD49}{AE48AD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD50}{AE49AD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD51}{AE50AD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD52}{AE51AD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD53}{AE52AD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD54}{AE53AD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD55}{AE54AD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD56}{AE55AD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD57}{AE56AD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD58}{AE57AD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD59}{AE58AD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD60}{AE59AD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD61}{AE60AD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD62}{AE61AD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD63}{AE62AD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD64}{AE63AD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD65}{AE64AD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD66}{AE65AD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD67}{AE66AD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD68}{AE67AD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD69}{AE68AD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD70}{AE69AD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD71}{AE70AD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD72}{AE71AD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD73}{AE72AD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD74}{AE73AD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD75}{AE74AD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD76}{AE75AD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD77}{AE76AD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD78}{AE77AD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD79}{AE78AD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD80}{AE79AD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD81}{AE80AD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD82}{AE81AD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD83}{AE82AD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD84}{AE83AD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD85}{AE84AD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD86}{AE85AD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD87}{AE86AD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD88}{AE87AD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD89}{AE88AD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD90}{AE89AD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD91}{AE90AD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD92}{AE91AD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD93}{AE92AD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD94}{AE93AD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD95}{AE94AD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD96}{AE95AD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD97}{AE96AD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD98}{AE97AD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD99}{AE98AD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD100}{A99EAD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD101}{A100EAD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD102}{A101EAD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD103}{A102EAD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD104}{A103EAD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD105}{A104EAD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD106}{A105EAD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD107}{A106EAD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD108}{A107EAD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD109}{A108EAD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD110}{A109EAD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD111}{A110EAD}{Authenticated Encryption with Associated Data}
\newacronym{AEAD112}{A111EAD}{Authenticated Encryption with Associated Data}

%% MSC
\makeglossaries{}

\begin{document}

  Some text.
\printglossary
\end{document}

Modify "Some text" and save.
Observed behavior:
Texlab starts taking 100% CPU (seemingly for ever) and the document is not built.

Expected behavior:
Texlab builds the document and takes a reasonable amount of cpu.

Texlab version: reproduced with release build of 2.0 and debug build of current master.

@pfoerster pfoerster self-assigned this Apr 23, 2020
@pfoerster pfoerster added the bug Something isn't working label Apr 23, 2020
@pfoerster
Copy link
Member

I have trouble reproducing this one. On my machine, parsing and semantic analysis takes about 600 µs and building this document does not cause texlab to hang. Perhaps, this may be related to #196. Can you try creating a log file using texlab -vvvv, please? Maybe, there is some request/response loop going on.

@pfoerster pfoerster added the help wanted Extra attention is needed label May 1, 2020
@symphorien
Copy link
Author

ERROR - Error { code: MethodNotFound, message: "Method not found", data: None }
ERROR - Error { code: MethodNotFound, message: "Method not found", data: None }
ERROR - Error { code: MethodNotFound, message: "Method not found", data: None }
ERROR - Error { code: MethodNotFound, message: "Method not found", data: None }
ERROR - Error { code: MethodNotFound, message: "Method not found", data: None }
ERROR - Error { code: MethodNotFound, message: "Method not found", data: None }
ERROR - Error { code: MethodNotFound, message: "Method not found", data: None }
ERROR - Error { code: MethodNotFound, message: "Method not found", data: None }
ERROR - Error { code: MethodNotFound, message: "Method not found", data: None }
ERROR - Error { code: MethodNotFound, message: "Method not found", data: None }
ERROR - Error { code: MethodNotFound, message: "Method not found", data: None }
ERROR - Error { code: MethodNotFound, message: "Method not found", data: None }
ERROR - Error { code: MethodNotFound, message: "Method not found", data: None }
ERROR - Error { code: MethodNotFound, message: "Method not found", data: None }
ERROR - Error { code: MethodNotFound, message: "Method not found", data: None }

I am very sorry, but I have a process texlab -vvvv with /run/user/1000/LanguageServer.log in the output of lsof and this is the only content of the file...

@symphorien
Copy link
Author

Here is a flamegraph of texlab when it uses all the cpu:

flamegraph.zip

flamegraph

@efoerster efoerster self-assigned this May 2, 2020
@efoerster
Copy link
Member

Thanks for the detailed report. I managed to reproduce this on my machine. This should be fixed now with 558b7fb.

@efoerster efoerster removed the help wanted Extra attention is needed label May 2, 2020
@efoerster efoerster mentioned this issue May 2, 2020
@symphorien
Copy link
Author

I confirm this is fixed on master. Many thanks!

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

3 participants