ROCKTAKEY / lsp-latex

Emacs lsp-mode client for LaTeX, on texlab.
GNU General Public License v3.0
69 stars 4 forks source link

CPU at 100% - max-lisp-eval-depth #41

Open tigerjack opened 1 year ago

tigerjack commented 1 year ago

This bug was first reported here. I use the same template for the bug report, with the addition of package-specific info.

Description :octocat:

Emacs freezes with error "Lisp nesting exceeds ‘max-lisp-eval-depth’", CPU usage goes up to 100%, texlab usage stays at a normal percentage. This only happens when the lsp mode is on.

Reproduction guide :beetle:

With the log file enabled, after opening a single tex file and giving a few fill-paragraph command, emacs became unasable. I obtained a log file of ~50 MiB. I do not understand if the problem is related to the specific content of the file or to the size of the project, but I tried with other big projects and I could not reproduce the issue.

Expected behaviour: :heart: :smile: Fluent experience, low CPU usage.

System Info :computer:

Backtrace :paw_prints:

Debugger entered--Lisp error: (error "Lisp nesting exceeds ‘max-lisp-eval-depth’")
  window-normalize-window(#<window 72 on expres.tex> t)
  unrecord-window-buffer(#<window 72 on expres.tex> #<buffer  *temp*-381604>)
  replace-buffer-in-windows(#<buffer  *temp*-381604>)
  kill-buffer(#<buffer  *temp*-381604>)
  #f(compiled-function () #<bytecode -0x1c8cb86db3d79fa3>)()
  url-generic-parse-url("file:///mnt/internal/LinuxData/vc/papers_reports/2...")
  lsp--uri-to-path-1("file:///mnt/internal/LinuxData/vc/papers_reports/2...")
  lsp--uri-to-path("file:///mnt/internal/LinuxData/vc/papers_reports/2...")
  lsp--on-diagnostics-update-stats(#s(lsp--workspace :ewoc nil :server-capabilities #<hash-table equal 14/14 0x1588ecee7593> :registered-server-capabilities nil :root "/mnt/internal/LinuxData/vc/papers_reports/2021_TQu..." :client #s(lsp--client :language-id nil :add-on? nil :new-connection (:connect #f(compiled-function (filter sentinel name environment-fn workspace) #<bytecode -0x25620c0

Additional info

Profiler

cpu_report.txt mem_report.txt

Texlab logs

texlab.zip Please note that I removed sensitive information from the log, replacing the line containing the content of the tex file with the string EDITED 1300 words.