texlab
texlab copied to clipboard
Error: Cannot call write after a stream was destroyed
TexLab Language Server output:
[Error - 02:19:30] Stopping server failed
Message: Cannot call write after a stream was destroyed
Code: -32099
"Extension Host" output:
2023-11-14 02:19:30.324 [error] [efoerster.texlab] provider FAILED
2023-11-14 02:19:30.324 [error] Error: write EPIPE
at /home/leo/.vscode-server/extensions/efoerster.texlab-5.11.0-linux-x64/dist/extension.js:1:48611
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at runNextTicks (node:internal/process/task_queues:64:3)
at processImmediate (node:internal/timers:447:9)
2023-11-14 02:19:30.325 [error] [efoerster.texlab] provider FAILED
2023-11-14 02:19:30.325 [error] Error: Cannot call write after a stream was destroyed
at /home/leo/.vscode-server/extensions/efoerster.texlab-5.11.0-linux-x64/dist/extension.js:1:48611
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at runNextTicks (node:internal/process/task_queues:64:3)
at processImmediate (node:internal/timers:447:9)
2023-11-14 02:19:30.325 [error] [efoerster.texlab] provider FAILED
2023-11-14 02:19:30.325 [error] Error: Cannot call write after a stream was destroyed
at /home/leo/.vscode-server/extensions/efoerster.texlab-5.11.0-linux-x64/dist/extension.js:1:48611
at processTicksAndRejections (node:internal/process/task_queues:95:5)
2023-11-14 02:19:31.455 [error] Error: write EPIPE
at afterWriteDispatched (node:internal/stream_base_commons:160:15)
at writeGeneric (node:internal/stream_base_commons:151:3)
at Socket._writeGeneric (node:net:930:11)
at Socket._write (node:net:942:8)
at writeOrBuffer (node:internal/streams/writable:392:12)
at _write (node:internal/streams/writable:333:10)
at Socket.Writable.write (node:internal/streams/writable:337:10)
at /home/leo/.vscode-server/extensions/efoerster.texlab-5.11.0-linux-x64/dist/extension.js:1:76919
at new Promise (<anonymous>)
at a.write (/home/leo/.vscode-server/extensions/efoerster.texlab-5.11.0-linux-x64/dist/extension.js:1:76837)
at y.doWrite (/home/leo/.vscode-server/extensions/efoerster.texlab-5.11.0-linux-x64/dist/extension.js:1:64453)
at /home/leo/.vscode-server/extensions/efoerster.texlab-5.11.0-linux-x64/dist/extension.js:1:64348
at runNextTicks (node:internal/process/task_queues:60:5)
at processImmediate (node:internal/timers:447:9)
2023-11-14 02:19:31.456 [error] Error: Cannot call write after a stream was destroyed
at new NodeError (node:internal/errors:399:5)
at _write (node:internal/streams/writable:324:11)
at Socket.Writable.write (node:internal/streams/writable:337:10)
at /home/leo/.vscode-server/extensions/efoerster.texlab-5.11.0-linux-x64/dist/extension.js:1:76919
at new Promise (<anonymous>)
at a.write (/home/leo/.vscode-server/extensions/efoerster.texlab-5.11.0-linux-x64/dist/extension.js:1:76837)
at y.doWrite (/home/leo/.vscode-server/extensions/efoerster.texlab-5.11.0-linux-x64/dist/extension.js:1:64453)
at /home/leo/.vscode-server/extensions/efoerster.texlab-5.11.0-linux-x64/dist/extension.js:1:64348
at runNextTicks (node:internal/process/task_queues:60:5)
at processImmediate (node:internal/timers:447:9)
2023-11-14 02:19:31.456 [error] Error: Cannot call write after a stream was destroyed
at new NodeError (node:internal/errors:399:5)
at _write (node:internal/streams/writable:324:11)
at Socket.Writable.write (node:internal/streams/writable:337:10)
at /home/leo/.vscode-server/extensions/efoerster.texlab-5.11.0-linux-x64/dist/extension.js:1:76919
at new Promise (<anonymous>)
at a.write (/home/leo/.vscode-server/extensions/efoerster.texlab-5.11.0-linux-x64/dist/extension.js:1:76837)
at y.doWrite (/home/leo/.vscode-server/extensions/efoerster.texlab-5.11.0-linux-x64/dist/extension.js:1:64453)
at /home/leo/.vscode-server/extensions/efoerster.texlab-5.11.0-linux-x64/dist/extension.js:1:64348
2023-11-14 02:19:31.456 [error] Error: Cannot call write after a stream was destroyed
at new NodeError (node:internal/errors:399:5)
at _write (node:internal/streams/writable:324:11)
at Socket.Writable.write (node:internal/streams/writable:337:10)
at /home/leo/.vscode-server/extensions/efoerster.texlab-5.11.0-linux-x64/dist/extension.js:1:76919
at new Promise (<anonymous>)
at a.write (/home/leo/.vscode-server/extensions/efoerster.texlab-5.11.0-linux-x64/dist/extension.js:1:76837)
at y.doWrite (/home/leo/.vscode-server/extensions/efoerster.texlab-5.11.0-linux-x64/dist/extension.js:1:64453)
at /home/leo/.vscode-server/extensions/efoerster.texlab-5.11.0-linux-x64/dist/extension.js:1:64348
at runNextTicks (node:internal/process/task_queues:60:5)
at processImmediate (node:internal/timers:447:9)
DEBUG - Opening document custom.bib...
thread 'main' panicked at crates/parser/src/bibtex.rs:255:43:
called `Result::unwrap()` on an `Err` value: ()
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread '<unnamed>' panicked at /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/lsp-server-0.7.4/src/stdio.rs:29:37:
receiver was dropped, failed to send a message: "SendError(..)"
[Error - 02:32:57] The texlab server crashed 5 times in the last 3 minutes. The server will not be restarted. See the output for more information.
My bibtex file is exported from zotero and has an emoji in its keywords. Removing it seems to help....
I'm not sure if this is related, but it might be: I've been getting consistent and frequent crashes of the texlab server with Neovim since the recent crate refactor (just after 5.11.0); I believe they are related to entering non-ASCII characters.
Typical errors that show up in my log are of the form
[ERROR][2023-11-15 15:07:53] .../vim/lsp/rpc.lua:675 "rpc" "/Users/clason/.local/share/nvim/lsp/texlab" "stderr" "thread 'main' panicked at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/alloc/src/string.rs:1766:29:\nassertion failed: self.is_char_boundary(n)\nnote: run with `RUST_BACKTRACE=1` environment variable to display a backtrace\n"
I'll investigate more.
@clason It seems to be caused by switching to the latest version of the LineIndex struct instead of vendoring line-index like we used to do before it was available on crates.io.
This commit should be the culprit: https://github.com/latex-lsp/texlab/commit/99ed167dd4b08c8ac151f01cf9bc3f4443605812
Yes, that is consistent with my bisecting tests.
@leoleoasd Do you have a reproducing example that you can share? The LineIndex and this crash are two different problems.