emacs-lsp / lsp-mode

Emacs client/library for the Language Server Protocol
https://emacs-lsp.github.io/lsp-mode
GNU General Public License v3.0
4.76k stars 875 forks source link

LSP does incorrect traversal of root folder causing high cpu usage and emacs freeze #2343

Closed 0xekez closed 3 years ago

0xekez commented 3 years ago

I'm currently attempting to debug an Emacs freeze that occurs when I attempt to open a new Rust project that lives in a particular folder using rust-analyzer. When I open one of these projects, my Emacs hangs using 100% CPU.

Following the the advice here about debugging a frozen Emacs and using lldb I am able to get a stack trace from Emacs and Emacs lisp which I have pasted below in the dropdowns.

It looks to me (and I could very well be completely wrong) that the problem is that lsp--directory-files-recursively is doing an incorrect traversal of the root folder that has been chosen. The part from the stack trace that makes me think that is this:

  lsp--directory-files-recursively("/Users/zekemedley/Desktop" ".*" t)
  lsp--directory-files-recursively("/Users/zekemedley" ".*" t)
  lsp--directory-files-recursively("/Users/zekemedley/Desktop/projects/imageEncoding/calhacks6.0" ".*" t)
  lsp--directory-files-recursively("/Users/zekemedley/Desktop/projects/imageEncoding" ".*" t)
  lsp--directory-files-recursively("/Users/zekemedley/Desktop/projects" ".*" t)
  lsp-watch-root-folder("/Users/zekemedley/Desktop/projects" #f(compiled-function (&rest args2) #<bytecode -0xbf5a18c7620cbfb>) #s(lsp-watch :descriptors #<hash-table equal 0/65 0x405acfeb> :root-directory "/Users/zekemedley/Desktop/projects") t)

Notice how it starts in the zekemedley/projects folder and then ends up traversing zekemedley/Desktop. My guess is that this is what is causing the high cpu usage and hang. Note that lsp also appears to be choosing the wrong root folder as the file being opened is in projects/emacstest/src/main.rs.

I'm wondering if anyone has thoughts on if this behavior is actually incorrect and any tips on debugging these. I'm happy to look into this more myself if it seems like I'm correctly identifying the problem.

Emacs Lisp stack trace
Debugger entered--entering a function:
* substitute-command-keys("Quit")
  file-symlink-p("/Users/zekemedley/.npm/_cacache/index-v5/ba/87")
  lsp--directory-files-recursively("/Users/zekemedley/.npm/_cacache/index-v5/ba" ".*" t)
  lsp--directory-files-recursively("/Users/zekemedley/.npm/_cacache/index-v5" ".*" t)
  lsp--directory-files-recursively("/Users/zekemedley/.npm/_cacache" ".*" t)
  lsp--directory-files-recursively("/Users/zekemedley/.npm" ".*" t)
  lsp--directory-files-recursively("/Users/zekemedley" ".*" t)
  lsp--directory-files-recursively("/Users/zekemedley/Desktop/projects/imageEncoding/c..." ".*" t)
  lsp--directory-files-recursively("/Users/zekemedley/Desktop/projects/imageEncoding" ".*" t)
  lsp--directory-files-recursively("/Users/zekemedley/Desktop/projects" ".*" t)
  lsp--directory-files-recursively("/Users/zekemedley/Desktop" ".*" t)
  lsp--directory-files-recursively("/Users/zekemedley" ".*" t)
  lsp--directory-files-recursively("/Users/zekemedley/Desktop/projects/imageEncoding/c..." ".*" t)
  lsp--directory-files-recursively("/Users/zekemedley/Desktop/projects/imageEncoding" ".*" t)
  lsp--directory-files-recursively("/Users/zekemedley/Desktop/projects" ".*" t)
  lsp--directory-files-recursively("/Users/zekemedley/Desktop" ".*" t)
  lsp--directory-files-recursively("/Users/zekemedley" ".*" t)
  lsp--directory-files-recursively("/Users/zekemedley/Desktop/projects/imageEncoding/c..." ".*" t)
  lsp--directory-files-recursively("/Users/zekemedley/Desktop/projects/imageEncoding" ".*" t)
  lsp--directory-files-recursively("/Users/zekemedley/Desktop/projects" ".*" t)
  lsp--directory-files-recursively("/Users/zekemedley/Desktop" ".*" t)
  lsp--directory-files-recursively("/Users/zekemedley" ".*" t)
  lsp--directory-files-recursively("/Users/zekemedley/Desktop/projects/imageEncoding/c..." ".*" t)
  lsp--directory-files-recursively("/Users/zekemedley/Desktop/projects/imageEncoding" ".*" t)
  lsp--directory-files-recursively("/Users/zekemedley/Desktop/projects" ".*" t)
  lsp--directory-files-recursively("/Users/zekemedley/Desktop" ".*" t)
  lsp--directory-files-recursively("/Users/zekemedley" ".*" t)
  lsp--directory-files-recursively("/Users/zekemedley/Desktop/projects/imageEncoding/c..." ".*" t)
  lsp--directory-files-recursively("/Users/zekemedley/Desktop/projects/imageEncoding" ".*" t)
  lsp--directory-files-recursively("/Users/zekemedley/Desktop/projects" ".*" t)
  lsp--directory-files-recursively("/Users/zekemedley/Desktop" ".*" t)
  lsp--directory-files-recursively("/Users/zekemedley" ".*" t)
  lsp--directory-files-recursively("/Users/zekemedley/Desktop/projects/imageEncoding/c..." ".*" t)
  lsp--directory-files-recursively("/Users/zekemedley/Desktop/projects/imageEncoding" ".*" t)
  lsp--directory-files-recursively("/Users/zekemedley/Desktop/projects" ".*" t)
  lsp--directory-files-recursively("/Users/zekemedley/Desktop" ".*" t)
  lsp--directory-files-recursively("/Users/zekemedley" ".*" t)
  lsp--directory-files-recursively("/Users/zekemedley/Desktop/projects/imageEncoding/c..." ".*" t)
  lsp--directory-files-recursively("/Users/zekemedley/Desktop/projects/imageEncoding" ".*" t)
  lsp--directory-files-recursively("/Users/zekemedley/Desktop/projects" ".*" t)
  lsp--directory-files-recursively("/Users/zekemedley/Desktop" ".*" t)
  lsp--directory-files-recursively("/Users/zekemedley" ".*" t)
  lsp--directory-files-recursively("/Users/zekemedley/Desktop/projects/imageEncoding/c..." ".*" t)
  lsp--directory-files-recursively("/Users/zekemedley/Desktop/projects/imageEncoding" ".*" t)
  lsp--directory-files-recursively("/Users/zekemedley/Desktop/projects" ".*" t)
  lsp--directory-files-recursively("/Users/zekemedley/Desktop" ".*" t)
  lsp--directory-files-recursively("/Users/zekemedley" ".*" t)
  lsp--directory-files-recursively("/Users/zekemedley/Desktop/projects/imageEncoding/c..." ".*" t)
  lsp--directory-files-recursively("/Users/zekemedley/Desktop/projects/imageEncoding" ".*" t)
  lsp--directory-files-recursively("/Users/zekemedley/Desktop/projects" ".*" t)
  lsp--directory-files-recursively("/Users/zekemedley/Desktop" ".*" t)
  lsp--directory-files-recursively("/Users/zekemedley" ".*" t)
  lsp--directory-files-recursively("/Users/zekemedley/Desktop/projects/imageEncoding/c..." ".*" t)
  lsp--directory-files-recursively("/Users/zekemedley/Desktop/projects/imageEncoding" ".*" t)
  lsp--directory-files-recursively("/Users/zekemedley/Desktop/projects" ".*" t)
  lsp--directory-files-recursively("/Users/zekemedley/Desktop" ".*" t)
  lsp--directory-files-recursively("/Users/zekemedley" ".*" t)
  lsp--directory-files-recursively("/Users/zekemedley/Desktop/projects/imageEncoding/calhacks6.0" ".*" t)
  lsp--directory-files-recursively("/Users/zekemedley/Desktop/projects/imageEncoding" ".*" t)
  lsp--directory-files-recursively("/Users/zekemedley/Desktop/projects" ".*" t)
  lsp-watch-root-folder("/Users/zekemedley/Desktop/projects" #f(compiled-function (&rest args2) #<bytecode -0xbf5a18c7620cbfb>) #s(lsp-watch :descriptors #<hash-table equal 0/65 0x405acfeb> :root-directory "/Users/zekemedley/Desktop/projects") t)
  lsp--server-register-capability(#<hash-table equal 3/3 0x43e9046d>)
  mapc(lsp--server-register-capability [#<hash-table equal 3/3 0x43e9046d>])
  lsp--on-request(#s(lsp--workspace :ewoc nil :server-capabilities #<hash-table equal 21/21 0x41632939> :registered-server-capabilities (#s(lsp--registered-capability :id "textDocument/didSave" :method "textDocument/didSave" :options #<hash-table equal 2/2 0x417f1bb5>)) :root "/Users/zekemedley/Desktop/projects" :client #s(lsp--client :language-id nil :add-on? nil :new-connection (:connect #f(compiled-function (filter sentinel name environment-fn) #<bytecode 0x19c5e83d01cdca71>) :test\? #f(compiled-function () #<bytecode 0x1c66a3f856ca6ccc>)) :ignore-regexps nil :ignore-messages nil :notification-handlers #<hash-table equal 1/65 0x417724c7> :request-handlers #<hash-table equal 0/65 0x417727bd> :response-handlers #<hash-table eql 0/65 0x41772bbd> :prefix-function nil :uri-handlers #<hash-table equal 0/65 0x41772fbf> :action-handlers #<hash-table equal 1/65 0x4177279d> :major-modes (rust-mode rustic-mode) :activation-fn nil :priority 1 :server-id rust-analyzer :multi-root nil :initialization-options lsp-rust-analyzer--make-init-options :custom-capabilities ((experimental (snippetTextEdit . t))) :library-folders-fn #f(compiled-function (workspace) #<bytecode 0x622359be6537ef6>) :before-file-open-fn nil :initialized-fn nil :remote? nil :completion-in-comments? nil :path->uri-fn nil :uri->path-fn nil :environment-fn nil :after-open-fn #f(compiled-function () #<bytecode 0x1e102e41d375>) :async-request-handlers #<hash-table equal 0/65 0x41772fdf> :download-server-fn #f(compiled-function (client callback error-callback update\?) #<bytecode 0x194950851e26afb3>) :download-in-progress? nil :buffers nil) :host-root nil :proc #<process rust-analyzer> :cmd-proc #<process rust-analyzer> :buffers (#<buffer lib.rs>) :semantic-highlighting-faces nil :semantic-highlighting-modifier-faces nil :extra-client-capabilities nil :status initialized :metadata #<hash-table equal 0/65 0x43c12dd9> :watches #<hash-table equal 0/65 0x43c12f83> :workspace-folders nil :last-id 0 :status-string nil :shutdown-action nil :diagnostics #<hash-table equal 0/65 0x43c12fa3> :work-done-tokens #<hash-table equal 0/65 0x43c12fc3>) #<hash-table equal 4/4 0x43e903dd>)
  lsp--parser-on-message(#<hash-table equal 4/4 0x43e903dd> #s(lsp--workspace :ewoc nil :server-capabilities #<hash-table equal 21/21 0x41632939> :registered-server-capabilities (#s(lsp--registered-capability :id "textDocument/didSave" :method "textDocument/didSave" :options #<hash-table equal 2/2 0x417f1bb5>)) :root "/Users/zekemedley/Desktop/projects" :client #s(lsp--client :language-id nil :add-on? nil :new-connection (:connect #f(compiled-function (filter sentinel name environment-fn) #<bytecode 0x19c5e83d01cdca71>) :test\? #f(compiled-function () #<bytecode 0x1c66a3f856ca6ccc>)) :ignore-regexps nil :ignore-messages nil :notification-handlers #<hash-table equal 1/65 0x417724c7> :request-handlers #<hash-table equal 0/65 0x417727bd> :response-handlers #<hash-table eql 0/65 0x41772bbd> :prefix-function nil :uri-handlers #<hash-table equal 0/65 0x41772fbf> :action-handlers #<hash-table equal 1/65 0x4177279d> :major-modes (rust-mode rustic-mode) :activation-fn nil :priority 1 :server-id rust-analyzer :multi-root nil :initialization-options lsp-rust-analyzer--make-init-options :custom-capabilities ((experimental (snippetTextEdit . t))) :library-folders-fn #f(compiled-function (workspace) #<bytecode 0x622359be6537ef6>) :before-file-open-fn nil :initialized-fn nil :remote? nil :completion-in-comments? nil :path->uri-fn nil :uri->path-fn nil :environment-fn nil :after-open-fn #f(compiled-function () #<bytecode 0x1e102e41d375>) :async-request-handlers #<hash-table equal 0/65 0x41772fdf> :download-server-fn #f(compiled-function (client callback error-callback update\?) #<bytecode 0x194950851e26afb3>) :download-in-progress? nil :buffers nil) :host-root nil :proc #<process rust-analyzer> :cmd-proc #<process rust-analyzer> :buffers (#<buffer lib.rs>) :semantic-highlighting-faces nil :semantic-highlighting-modifier-faces nil :extra-client-capabilities nil :status initialized :metadata #<hash-table equal 0/65 0x43c12dd9> :watches #<hash-table equal 0/65 0x43c12f83> :workspace-folders nil :last-id 0 :status-string nil :shutdown-action nil :diagnostics #<hash-table equal 0/65 0x43c12fa3> :work-done-tokens #<hash-table equal 0/65 0x43c12fc3>))
  #f(compiled-function (proc input) #<bytecode -0xbd05c88c5779c13>)(#<process rust-analyzer> "Content-Length: 888\15\n\15\n{\"jsonrpc\":\"2.0\",\"id\":1,\"me...")
lldb stack trace
  * frame #0: 0x0000000100135980 emacs`Fcdr(list=0x0000000119525f43) at data.c:612 [opt]
    frame #1: 0x0000000100158df8 emacs`merge(org_l1=, org_l2=, pred=0x00000000022b7a18) at fns.c:2139:9 [opt]
    frame #2: 0x0000000100158bab emacs`Fsort [inlined] sort_list at fns.c:1990:10 [opt] [artificial]
    frame #3: 0x0000000100158b94 emacs`Fsort [inlined] sort_list at fns.c:1990:42 [opt]
    frame #4: 0x0000000100158af8 emacs`Fsort(seq=, predicate=0x00000000022b7a18) at fns.c:2102 [opt]
    frame #5: 0x0000000100158b86 emacs`Fsort [inlined] sort_list at fns.c:1990:17 [opt]
    frame #6: 0x0000000100158af8 emacs`Fsort(seq=, predicate=0x00000000022b7a18) at fns.c:2102 [opt]
    frame #7: 0x0000000100158b86 emacs`Fsort [inlined] sort_list at fns.c:1990:17 [opt]
    frame #8: 0x0000000100158af8 emacs`Fsort(seq=, predicate=0x00000000022b7a18) at fns.c:2102 [opt]
    frame #9: 0x000000010014f811 emacs`funcall_subr(subr=0x000000010026df38, numargs=2, args=) at eval.c:2884:19 [opt]
    frame #10: 0x000000010014edf1 emacs`Ffuncall(nargs=, args=) at eval.c:2809:11 [opt]
    frame #11: 0x0000000100192950 emacs`exec_byte_code(bytestr=, vector=0x00000001012b79f5, maxdepth=, args_template=, nargs=, args=) at bytecode.c:632:12 [opt]
    frame #12: 0x000000010014fd74 emacs`funcall_lambda [inlined] fetch_and_exec_byte_code(fun=, syms_left=, nargs=, args=) at eval.c:2931:10 [opt] [artificial]
    frame #13: 0x000000010014ed8f emacs`Ffuncall(nargs=, args=) at eval.c:0:4 [opt]
    frame #14: 0x0000000100192950 emacs`exec_byte_code(bytestr=, vector=0x00000001012b79f5, maxdepth=, args_template=, nargs=, args=) at bytecode.c:632:12 [opt]
    frame #15: 0x000000010014fd74 emacs`funcall_lambda [inlined] fetch_and_exec_byte_code(fun=, syms_left=, nargs=, args=) at eval.c:2931:10 [opt] [artificial]
    frame #16: 0x000000010014ed8f emacs`Ffuncall(nargs=, args=) at eval.c:0:4 [opt]
    frame #17: 0x0000000100192950 emacs`exec_byte_code(bytestr=, vector=0x00000001012b79f5, maxdepth=, args_template=, nargs=, args=) at bytecode.c:632:12 [opt]
    frame #18: 0x000000010014fd74 emacs`funcall_lambda [inlined] fetch_and_exec_byte_code(fun=, syms_left=, nargs=, args=) at eval.c:2931:10 [opt] [artificial]
    frame #19: 0x000000010014ed8f emacs`Ffuncall(nargs=, args=) at eval.c:0:4 [opt]
    frame #20: 0x0000000100192950 emacs`exec_byte_code(bytestr=, vector=0x00000001012b79f5, maxdepth=, args_template=, nargs=, args=) at bytecode.c:632:12 [opt]
    frame #21: 0x000000010014fd74 emacs`funcall_lambda [inlined] fetch_and_exec_byte_code(fun=, syms_left=, nargs=, args=) at eval.c:2931:10 [opt] [artificial]
    frame #22: 0x000000010014ed8f emacs`Ffuncall(nargs=, args=) at eval.c:0:4 [opt]
    frame #23: 0x0000000100192950 emacs`exec_byte_code(bytestr=, vector=0x00000001012b79f5, maxdepth=, args_template=, nargs=, args=) at bytecode.c:632:12 [opt]
    frame #24: 0x000000010014fd74 emacs`funcall_lambda [inlined] fetch_and_exec_byte_code(fun=, syms_left=, nargs=, args=) at eval.c:2931:10 [opt] [artificial]
    frame #25: 0x000000010014ed8f emacs`Ffuncall(nargs=, args=) at eval.c:0:4 [opt]
    frame #26: 0x0000000100192950 emacs`exec_byte_code(bytestr=, vector=0x00000001012b79f5, maxdepth=, args_template=, nargs=, args=) at bytecode.c:632:12 [opt]
    frame #27: 0x000000010014fd74 emacs`funcall_lambda [inlined] fetch_and_exec_byte_code(fun=, syms_left=, nargs=, args=) at eval.c:2931:10 [opt] [artificial]
    frame #28: 0x000000010014ed8f emacs`Ffuncall(nargs=, args=) at eval.c:0:4 [opt]
    frame #29: 0x0000000100192950 emacs`exec_byte_code(bytestr=, vector=0x00000001012b79f5, maxdepth=, args_template=, nargs=, args=) at bytecode.c:632:12 [opt]
    frame #30: 0x000000010014fd74 emacs`funcall_lambda [inlined] fetch_and_exec_byte_code(fun=, syms_left=, nargs=, args=) at eval.c:2931:10 [opt] [artificial]
    frame #31: 0x000000010014ed8f emacs`Ffuncall(nargs=, args=) at eval.c:0:4 [opt]
    frame #32: 0x0000000100192950 emacs`exec_byte_code(bytestr=, vector=0x00000001012b79f5, maxdepth=, args_template=, nargs=, args=) at bytecode.c:632:12 [opt]
    frame #33: 0x000000010014fd74 emacs`funcall_lambda [inlined] fetch_and_exec_byte_code(fun=, syms_left=, nargs=, args=) at eval.c:2931:10 [opt] [artificial]
    frame #34: 0x000000010014ed8f emacs`Ffuncall(nargs=, args=) at eval.c:0:4 [opt]
    frame #35: 0x0000000100192950 emacs`exec_byte_code(bytestr=, vector=0x00000001012b79f5, maxdepth=, args_template=, nargs=, args=) at bytecode.c:632:12 [opt]
    frame #36: 0x000000010014fd74 emacs`funcall_lambda [inlined] fetch_and_exec_byte_code(fun=, syms_left=, nargs=, args=) at eval.c:2931:10 [opt] [artificial]
    frame #37: 0x000000010014ed8f emacs`Ffuncall(nargs=, args=) at eval.c:0:4 [opt]
    frame #38: 0x0000000100192950 emacs`exec_byte_code(bytestr=, vector=0x00000001012b79f5, maxdepth=, args_template=, nargs=, args=) at bytecode.c:632:12 [opt]
    frame #39: 0x000000010014fd74 emacs`funcall_lambda [inlined] fetch_and_exec_byte_code(fun=, syms_left=, nargs=, args=) at eval.c:2931:10 [opt] [artificial]
    frame #40: 0x000000010014ed8f emacs`Ffuncall(nargs=, args=) at eval.c:0:4 [opt]
    frame #41: 0x0000000100192950 emacs`exec_byte_code(bytestr=, vector=0x00000001012b79f5, maxdepth=, args_template=, nargs=, args=) at bytecode.c:632:12 [opt]
    frame #42: 0x000000010014fd74 emacs`funcall_lambda [inlined] fetch_and_exec_byte_code(fun=, syms_left=, nargs=, args=) at eval.c:2931:10 [opt] [artificial]
    frame #43: 0x000000010014ed8f emacs`Ffuncall(nargs=, args=) at eval.c:0:4 [opt]
    frame #44: 0x0000000100192950 emacs`exec_byte_code(bytestr=, vector=0x00000001012b79f5, maxdepth=, args_template=, nargs=, args=) at bytecode.c:632:12 [opt]
    frame #45: 0x000000010014fd74 emacs`funcall_lambda [inlined] fetch_and_exec_byte_code(fun=, syms_left=, nargs=, args=) at eval.c:2931:10 [opt] [artificial]
    frame #46: 0x000000010014ed8f emacs`Ffuncall(nargs=, args=) at eval.c:0:4 [opt]
    frame #47: 0x0000000100192950 emacs`exec_byte_code(bytestr=, vector=0x00000001012b79f5, maxdepth=, args_template=, nargs=, args=) at bytecode.c:632:12 [opt]
    frame #48: 0x000000010014fd74 emacs`funcall_lambda [inlined] fetch_and_exec_byte_code(fun=, syms_left=, nargs=, args=) at eval.c:2931:10 [opt] [artificial]
    frame #49: 0x000000010014ed8f emacs`Ffuncall(nargs=, args=) at eval.c:0:4 [opt]
    frame #50: 0x0000000100192950 emacs`exec_byte_code(bytestr=, vector=0x00000001012b79f5, maxdepth=, args_template=, nargs=, args=) at bytecode.c:632:12 [opt]
    frame #51: 0x000000010014fd74 emacs`funcall_lambda [inlined] fetch_and_exec_byte_code(fun=, syms_left=, nargs=, args=) at eval.c:2931:10 [opt] [artificial]
    frame #52: 0x000000010014ed8f emacs`Ffuncall(nargs=, args=) at eval.c:0:4 [opt]
    frame #53: 0x0000000100192950 emacs`exec_byte_code(bytestr=, vector=0x00000001012b79f5, maxdepth=, args_template=, nargs=, args=) at bytecode.c:632:12 [opt]
    frame #54: 0x000000010014fd74 emacs`funcall_lambda [inlined] fetch_and_exec_byte_code(fun=, syms_left=, nargs=, args=) at eval.c:2931:10 [opt] [artificial]
    frame #55: 0x000000010014ed8f emacs`Ffuncall(nargs=, args=) at eval.c:0:4 [opt]
    frame #56: 0x0000000100192950 emacs`exec_byte_code(bytestr=, vector=0x00000001012b79f5, maxdepth=, args_template=, nargs=, args=) at bytecode.c:632:12 [opt]
    frame #57: 0x000000010014fd74 emacs`funcall_lambda [inlined] fetch_and_exec_byte_code(fun=, syms_left=, nargs=, args=) at eval.c:2931:10 [opt] [artificial]
    frame #58: 0x000000010014ed8f emacs`Ffuncall(nargs=, args=) at eval.c:0:4 [opt]
    frame #59: 0x0000000100192950 emacs`exec_byte_code(bytestr=, vector=0x00000001012b79f5, maxdepth=, args_template=, nargs=, args=) at bytecode.c:632:12 [opt]
    frame #60: 0x000000010014fd74 emacs`funcall_lambda [inlined] fetch_and_exec_byte_code(fun=, syms_left=, nargs=, args=) at eval.c:2931:10 [opt] [artificial]
    frame #61: 0x000000010014ed8f emacs`Ffuncall(nargs=, args=) at eval.c:0:4 [opt]
    frame #62: 0x0000000100192950 emacs`exec_byte_code(bytestr=, vector=0x00000001012b79f5, maxdepth=, args_template=, nargs=, args=) at bytecode.c:632:12 [opt]
    frame #63: 0x000000010014fd74 emacs`funcall_lambda [inlined] fetch_and_exec_byte_code(fun=, syms_left=, nargs=, args=) at eval.c:2931:10 [opt] [artificial]
    frame #64: 0x000000010014ed8f emacs`Ffuncall(nargs=, args=) at eval.c:0:4 [opt]
    frame #65: 0x0000000100192950 emacs`exec_byte_code(bytestr=, vector=0x00000001012b79f5, maxdepth=, args_template=, nargs=, args=) at bytecode.c:632:12 [opt]
    frame #66: 0x000000010014fd74 emacs`funcall_lambda [inlined] fetch_and_exec_byte_code(fun=, syms_left=, nargs=, args=) at eval.c:2931:10 [opt] [artificial]
    frame #67: 0x000000010014ed8f emacs`Ffuncall(nargs=, args=) at eval.c:0:4 [opt]
    frame #68: 0x0000000100192950 emacs`exec_byte_code(bytestr=, vector=0x00000001012b79f5, maxdepth=, args_template=, nargs=, args=) at bytecode.c:632:12 [opt]
    frame #69: 0x000000010014fd74 emacs`funcall_lambda [inlined] fetch_and_exec_byte_code(fun=, syms_left=, nargs=, args=) at eval.c:2931:10 [opt] [artificial]
    frame #70: 0x000000010014ed8f emacs`Ffuncall(nargs=, args=) at eval.c:0:4 [opt]
    frame #71: 0x0000000100192950 emacs`exec_byte_code(bytestr=, vector=0x00000001012b79f5, maxdepth=, args_template=, nargs=, args=) at bytecode.c:632:12 [opt]
    frame #72: 0x000000010014fd74 emacs`funcall_lambda [inlined] fetch_and_exec_byte_code(fun=, syms_left=, nargs=, args=) at eval.c:2931:10 [opt] [artificial]
    frame #73: 0x000000010014ed8f emacs`Ffuncall(nargs=, args=) at eval.c:0:4 [opt]
    frame #74: 0x0000000100192950 emacs`exec_byte_code(bytestr=, vector=0x00000001012b79f5, maxdepth=, args_template=, nargs=, args=) at bytecode.c:632:12 [opt]
    frame #75: 0x000000010014fd74 emacs`funcall_lambda [inlined] fetch_and_exec_byte_code(fun=, syms_left=, nargs=, args=) at eval.c:2931:10 [opt] [artificial]
    frame #76: 0x000000010014ed8f emacs`Ffuncall(nargs=, args=) at eval.c:0:4 [opt]
    frame #77: 0x0000000100192950 emacs`exec_byte_code(bytestr=, vector=0x00000001012b79f5, maxdepth=, args_template=, nargs=, args=) at bytecode.c:632:12 [opt]
    frame #78: 0x000000010014fd74 emacs`funcall_lambda [inlined] fetch_and_exec_byte_code(fun=, syms_left=, nargs=, args=) at eval.c:2931:10 [opt] [artificial]
    frame #79: 0x000000010014ed8f emacs`Ffuncall(nargs=, args=) at eval.c:0:4 [opt]
    frame #80: 0x0000000100192950 emacs`exec_byte_code(bytestr=, vector=0x00000001012b79f5, maxdepth=, args_template=, nargs=, args=) at bytecode.c:632:12 [opt]
    frame #81: 0x000000010014fd74 emacs`funcall_lambda [inlined] fetch_and_exec_byte_code(fun=, syms_left=, nargs=, args=) at eval.c:2931:10 [opt] [artificial]
    frame #82: 0x000000010014ed8f emacs`Ffuncall(nargs=, args=) at eval.c:0:4 [opt]
    frame #83: 0x0000000100192950 emacs`exec_byte_code(bytestr=, vector=0x00000001012b79f5, maxdepth=, args_template=, nargs=, args=) at bytecode.c:632:12 [opt]
    frame #84: 0x000000010014fd74 emacs`funcall_lambda [inlined] fetch_and_exec_byte_code(fun=, syms_left=, nargs=, args=) at eval.c:2931:10 [opt] [artificial]
    frame #85: 0x000000010014ed8f emacs`Ffuncall(nargs=, args=) at eval.c:0:4 [opt]
    frame #86: 0x0000000100192950 emacs`exec_byte_code(bytestr=, vector=0x00000001012b79f5, maxdepth=, args_template=, nargs=, args=) at bytecode.c:632:12 [opt]
    frame #87: 0x000000010014fd74 emacs`funcall_lambda [inlined] fetch_and_exec_byte_code(fun=, syms_left=, nargs=, args=) at eval.c:2931:10 [opt] [artificial]
    frame #88: 0x000000010014ed8f emacs`Ffuncall(nargs=, args=) at eval.c:0:4 [opt]
    frame #89: 0x0000000100192950 emacs`exec_byte_code(bytestr=, vector=0x00000001012b79f5, maxdepth=, args_template=, nargs=, args=) at bytecode.c:632:12 [opt]
    frame #90: 0x000000010014fd74 emacs`funcall_lambda [inlined] fetch_and_exec_byte_code(fun=, syms_left=, nargs=, args=) at eval.c:2931:10 [opt] [artificial]
    frame #91: 0x000000010014ed8f emacs`Ffuncall(nargs=, args=) at eval.c:0:4 [opt]
    frame #92: 0x0000000100192950 emacs`exec_byte_code(bytestr=, vector=0x00000001012b79f5, maxdepth=, args_template=, nargs=, args=) at bytecode.c:632:12 [opt]
    frame #93: 0x000000010014fd74 emacs`funcall_lambda [inlined] fetch_and_exec_byte_code(fun=, syms_left=, nargs=, args=) at eval.c:2931:10 [opt] [artificial]
    frame #94: 0x000000010014ed8f emacs`Ffuncall(nargs=, args=) at eval.c:0:4 [opt]
    frame #95: 0x0000000100192950 emacs`exec_byte_code(bytestr=, vector=0x00000001012b79f5, maxdepth=, args_template=, nargs=, args=) at bytecode.c:632:12 [opt]
    frame #96: 0x000000010014fd74 emacs`funcall_lambda [inlined] fetch_and_exec_byte_code(fun=, syms_left=, nargs=, args=) at eval.c:2931:10 [opt] [artificial]
    frame #97: 0x000000010014ed8f emacs`Ffuncall(nargs=, args=) at eval.c:0:4 [opt]
    frame #98: 0x0000000100192950 emacs`exec_byte_code(bytestr=, vector=0x00000001012b79f5, maxdepth=, args_template=, nargs=, args=) at bytecode.c:632:12 [opt]
    frame #99: 0x000000010014fd74 emacs`funcall_lambda [inlined] fetch_and_exec_byte_code(fun=, syms_left=, nargs=, args=) at eval.c:2931:10 [opt] [artificial]
    frame #100: 0x000000010014ed8f emacs`Ffuncall(nargs=, args=) at eval.c:0:4 [opt]
    frame #101: 0x0000000100192950 emacs`exec_byte_code(bytestr=, vector=0x00000001012b79f5, maxdepth=, args_template=, nargs=, args=) at bytecode.c:632:12 [opt]
    frame #102: 0x000000010014fd74 emacs`funcall_lambda [inlined] fetch_and_exec_byte_code(fun=, syms_left=, nargs=, args=) at eval.c:2931:10 [opt] [artificial]
    frame #103: 0x000000010014ed8f emacs`Ffuncall(nargs=, args=) at eval.c:0:4 [opt]
    frame #104: 0x0000000100192950 emacs`exec_byte_code(bytestr=, vector=0x00000001012b79f5, maxdepth=, args_template=, nargs=, args=) at bytecode.c:632:12 [opt]
    frame #105: 0x000000010014fd74 emacs`funcall_lambda [inlined] fetch_and_exec_byte_code(fun=, syms_left=, nargs=, args=) at eval.c:2931:10 [opt] [artificial]
    frame #106: 0x000000010014ed8f emacs`Ffuncall(nargs=, args=) at eval.c:0:4 [opt]
    frame #107: 0x0000000100192950 emacs`exec_byte_code(bytestr=, vector=0x00000001012b7bbd, maxdepth=, args_template=, nargs=, args=) at bytecode.c:632:12 [opt]
    frame #108: 0x000000010014fd74 emacs`funcall_lambda [inlined] fetch_and_exec_byte_code(fun=, syms_left=, nargs=, args=) at eval.c:2931:10 [opt] [artificial]
    frame #109: 0x000000010014ed8f emacs`Ffuncall(nargs=, args=) at eval.c:0:4 [opt]
    frame #110: 0x0000000100192950 emacs`exec_byte_code(bytestr=, vector=0x00000001012cbb95, maxdepth=, args_template=, nargs=, args=) at bytecode.c:632:12 [opt]
    frame #111: 0x000000010014fd74 emacs`funcall_lambda [inlined] fetch_and_exec_byte_code(fun=, syms_left=, nargs=, args=) at eval.c:2931:10 [opt] [artificial]
    frame #112: 0x000000010014ed8f emacs`Ffuncall(nargs=, args=) at eval.c:0:4 [opt]
    frame #113: 0x000000010014f46c emacs`call1(fn=0x0000000000c693a0, arg1=) at eval.c:2669:10 [opt]
    frame #114: 0x000000010015a519 emacs`mapcar1(leni=1, vals=0x0000000000000000, fn=0x0000000000c693a0, seq=0x000000010fa411a5) at fns.c:2634:24 [opt]
    frame #115: 0x000000010015a88b emacs`Fmapc(function=0x0000000000c693a0, sequence=0x000000010fa411a5) at fns.c:2741:3 [opt]
    frame #116: 0x000000010014f811 emacs`funcall_subr(subr=0x000000010026e1d8, numargs=2, args=) at eval.c:2884:19 [opt]
    frame #117: 0x000000010014edf1 emacs`Ffuncall(nargs=, args=) at eval.c:2809:11 [opt]
    frame #118: 0x0000000100192950 emacs`exec_byte_code(bytestr=, vector=0x00000001012f725d, maxdepth=, args_template=, nargs=, args=) at bytecode.c:632:12 [opt]
    frame #119: 0x000000010014fd74 emacs`funcall_lambda [inlined] fetch_and_exec_byte_code(fun=, syms_left=, nargs=, args=) at eval.c:2931:10 [opt] [artificial]
    frame #120: 0x000000010014ed8f emacs`Ffuncall(nargs=, args=) at eval.c:0:4 [opt]
    frame #121: 0x0000000100192950 emacs`exec_byte_code(bytestr=, vector=0x00000001012f791d, maxdepth=, args_template=, nargs=, args=) at bytecode.c:632:12 [opt]
    frame #122: 0x000000010014fd74 emacs`funcall_lambda [inlined] fetch_and_exec_byte_code(fun=, syms_left=, nargs=, args=) at eval.c:2931:10 [opt] [artificial]
    frame #123: 0x000000010014ed8f emacs`Ffuncall(nargs=, args=) at eval.c:0:4 [opt]
    frame #124: 0x0000000100192950 emacs`exec_byte_code(bytestr=, vector=0x000000010f050cc5, maxdepth=, args_template=, nargs=, args=) at bytecode.c:632:12 [opt]
    frame #125: 0x000000010014fd74 emacs`funcall_lambda [inlined] fetch_and_exec_byte_code(fun=, syms_left=, nargs=, args=) at eval.c:2931:10 [opt] [artificial]
    frame #126: 0x000000010014ed8f emacs`Ffuncall(nargs=, args=) at eval.c:0:4 [opt]
    frame #127: 0x000000010014e940 emacs`Fapply(nargs=2, args=0x00007ffeefbfe588) at eval.c:2439:24 [opt]
    frame #128: 0x000000010014a6c5 emacs`apply1(fn=, arg=) at eval.c:2655:43 [opt]
    frame #129: 0x000000010014d53f emacs`internal_condition_case_1(bfun=(emacs`read_process_output_call at process.c:5982), arg=0x0000000105feaa43, handlers=0x0000000000000090, hfun=(emacs`read_process_output_error_handler at process.c:5988)) at eval.c:1383:25 [opt]
    frame #130: 0x000000010019d58e emacs`read_process_output [inlined] read_and_dispose_of_process_output(p=, chars="Content-Length: 888\r\n\r\n{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"client/registerCapability\",\"params\":{\"registrations\":[{\"id\":\"workspace/didChangeWatchedFiles\",\"method\":\"workspace/didChangeWatchedFiles\",\"registerOptions\":{\"watchers\":[{\"globPattern\":\"/Users/zekemedley/Desktop/projects/blog_os/**/*.rs\"},{\"globPattern\":\"/Users/zekemedley/Desktop/projects/cloudflare-systems/**/*.rs\"},{\"globPattern\":\"/Users/zekemedley/Desktop/projects/element-wise-weighted-um/**/*.rs\"},{\"globPattern\":\"/Users/zekemedley/Desktop/projects/jvm-assembler/**/*.rs\"},{\"globPattern\":\"/Users/zekemedley/Desktop/projects/lust/**/*.rs\"},{\"globPattern\":\"/Users/zekemedley/Desktop/projects/ray_tracing/**/*.rs\"},{\"globPattern\":\"/Users/zekemedley/Desktop/projects/rustc_codegen_cranelift/**/*.rs\"},{\"globPattern\":\"/Users/zekemedley/Desktop/projects/simplejit-demo/**/*.rs\"},{\"globPattern\":\"/Users/zekemedley/Desktop/projects/testemacs/**/*.rs\"}]}}]}}d\":{\"tokenModifiers\":[\"documentation\",\"declaration\",\"definition\",\"static\",\"abstract\",\"deprecated\",\"readonly\",\"con"..., nbytes=, coding=0x000000010ed21510) at process.c:6204:5 [opt]
    frame #131: 0x000000010019d3d9 emacs`read_process_output(proc=0x000000010f0519e5, channel=) at process.c:6115 [opt]
    frame #132: 0x000000010019bf2a emacs`wait_reading_process_output(time_limit=, nsecs=, read_kbd=-1, do_display=true, wait_for_cell=0x0000000000000000, wait_proc=, just_wait_proc=0) at process.c:5802:16 [opt]
    frame #133: 0x000000010000a679 emacs`sit_for(timeout=, reading=, display_option=1) at dispnew.c:6111:3 [opt]
    frame #134: 0x00000001000cc5dd emacs`read_char(commandflag=1, map=0x0000000105feb443, prev_event=0x0000000000000000, used_mouse_menu=0x00007ffeefbff0df, end_time=0x0000000000000000) at keyboard.c:2742:11 [opt]
    frame #135: 0x00000001000c96e2 emacs`read_key_sequence(keybuf=, prompt=0x0000000000000000, dont_downcase_last=false, can_return_switch_frame=true, fix_current_buffer=true, prevent_redisplay=) at keyboard.c:9546:12 [opt]
    frame #136: 0x00000001000c7f6c emacs`command_loop_1 at keyboard.c:1354:15 [opt]
    frame #137: 0x000000010014d407 emacs`internal_condition_case(bfun=(emacs`command_loop_1 at keyboard.c:1240), handlers=0x0000000000000090, hfun=(emacs`cmd_error at keyboard.c:923)) at eval.c:1359:25 [opt]
    frame #138: 0x00000001000d7e80 emacs`command_loop_2(ignore=) at keyboard.c:1095:11 [opt]
    frame #139: 0x000000010014cbfb emacs`internal_catch(tag=0x000000000000c9c0, func=(emacs`command_loop_2 at keyboard.c:1091), arg=0x0000000000000000) at eval.c:1120:25 [opt]
    frame #140: 0x000000010020f195 emacs`recursive_edit_1.cold.1 at keyboard.c:1074:2 [opt]
    frame #141: 0x00000001000c7039 emacs`recursive_edit_1 [inlined] command_loop at keyboard.c:1071:5 [opt]
    frame #142: 0x00000001000c7034 emacs`recursive_edit_1 at keyboard.c:718 [opt]
    frame #143: 0x00000001000c71cb emacs`Frecursive_edit at keyboard.c:790:3 [opt]
    frame #144: 0x00000001000c6249 emacs`main(argc=, argv=) at emacs.c:2047:3 [opt]
    frame #145: 0x00007fff6c068cc9 libdyld.dylib`start + 1
    frame #146: 0x00007fff6c068cc9 libdyld.dylib`start + 1
yyoncho commented 3 years ago

Use M-x lsp-workspace-folders-remove and remove the projects you don't want to be opened and make sure you are selecting the proper roots when you are asked initially. Note that rust-analyzer supports multi root project so once you have opened a rust project it will be opened to the same server in the next session. I am closing the bug but you can use it for further questions.

0xekez commented 3 years ago

That fixed it :) Thanks so much for the help. I had a feeling that the issue was something on my end.