Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Cannot call write after a stream was destroyed #961

Open
leoleoasd opened this issue Nov 14, 2023 · 6 comments
Open

Error: Cannot call write after a stream was destroyed #961

leoleoasd opened this issue Nov 14, 2023 · 6 comments
Labels
bug Something isn't working

Comments

@leoleoasd
Copy link

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)

@leoleoasd
Copy link
Author

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.

@leoleoasd
Copy link
Author

My bibtex file is exported from zotero and has an emoji in its keywords. Removing it seems to help....

@clason
Copy link
Contributor

clason commented Nov 15, 2023

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.

@pfoerster
Copy link
Member

@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: 99ed167

@pfoerster pfoerster added the bug Something isn't working label Nov 16, 2023
@clason
Copy link
Contributor

clason commented Nov 16, 2023

Yes, that is consistent with my bisecting tests.

@pfoerster
Copy link
Member

@leoleoasd Do you have a reproducing example that you can share? The LineIndex and this crash are two different problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants