elixir-lsp/elixir_sense

Infinite loop with increasing memory

axelson opened this issue · 0 comments

Okay, was finally able to capture detailed info about the loop/memory issue mentioned in elixir-lsp/elixir-ls#82

Here are the screenshots that I captured

memory-processinfo

memory-stacktrace

We can see that there is an infinite loop of lines 700, 712, 710 (this is on commit 2dc70af):

https://github.com/elixir-lsp/elixir_sense/blob/2dc70afe9880ab8dc1/lib/elixir_sense/core/introspection.ex#L700

What is happening appears to be that find_metadata_function is currently operating on a nil module and then it recursively calls itself. So a solution would probably involve adding a case to the Enum.find/2 call that handles a nil module non-recursively.

While I ran into this on commit 2dc70af, the same issue appears to still exist on the master branch.