haskell / haskell/lsp

Inifinite recursion in logger

Open
#447 7 comments 0 reactions 0 assignees View on GitHub
Dominant language
Haskell
Stars
423
Forks
105
PR merge metrics
No merged PRs in 30d

Description

This was originally found in https://github.com/haskell/haskell-language-server/pull/3072

In `lsp`, there is a debug log, printing response body:
https://github.com/haskell/lsp/blob/8b63438313828a31ba1065ea865e504d532d093e/lsp/src/Language/LSP/Server/Control.hs#L224-L234
And in HLS, our logger sends a copy of log to LSP client:
https://github.com/haskell/haskell-language-server/blob/347a7187f20242540926b9927c59a45b18798c67/exe/Main.hs#L72-L82

Then it goes into infinite recursion. A lot of logs like below are produced, and finally OOM on a machine with 64GB RAM.

![graph](https://user-images.githubusercontent.com/16440269/182581577-650b4a88-d314-40d6-af12-93f30761e5ca.png)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.