LanguageServer.jl
LanguageServer.jl copied to clipboard
ArgumentError: embedded NULs are not allowed in C strings
From crash reporting.
More info in the link.
Stack trace:
ArgumentError:
at unsafe_convert (c.jl216)
at stat(::String) (stat.jl67)
at isfile (stat.jl311)
at process(::LanguageServer.JSONRPC.Request{Val{Symbol("textDocument/definition")},LanguageServer.TextDocumentPositionParams}, ::LanguageServerInstance) (.\scripts\languageserver\packages\LanguageServer\src\requests\features.jl116)
at run(::LanguageServerInstance) (.\scripts\languageserver\packages\LanguageServer\src\languageserverinstance.jl233)
at top-level scope (.\scripts\languageserver\main.jl28)
at include (boot.jl328)
at include_relative(::Module, ::String) (loading.jl1105)
at include(::Module, ::String) (Base.jl31)
at exec_options(::Base.JLOptions) (client.jl287)
at _start() (client.jl460)
Bump, we still get these, for example here. But note that the error in that latest crash report is in a different place.
What I don't understand is whether there is a NULL character in the input file, or whether the NULL char appears somewhere along the parsing line, i.e. is introduced in error? If it is in the input file, presumably that is not a valid Julia file then?
What exactly is a NULL character in this sense? Either way would validating strings before calls to stat
(e..g dirname
, etc) be one way forward?
Presumably just \u0
? Maybe we should just bail on that if it occurs anywhere in code, presumably that is invalid? Maybe worth asking the core team how they handle that?
I see a similar error in Neovim when a multiline snippet is returned as a completion candidate and inserted before it is expanded; in this case the newlines in the snippet are sent to Neovim as \0
, which is then sent back to the server as a textDocument/didChange
.