-
Notifications
You must be signed in to change notification settings - Fork 158
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
Fails to startup on raspberrypi 4 running raspbian 64bit #871
Comments
To further, what I'm running on currently is:
|
That message implies that your client sent the |
I actually see the same behaviour on my laptop (Arch, x86_64), even when just running with It happens to both locally built FSAC as well as downloaded one. |
Okay, so after some lightweight debugging and @baronfel's help, apparently FSAC tries to read headers (even first 2 bytes), and fails: System.ArgumentException: The output byte buffer is too small to contain the encoded data, encoding 'Unicode (UTF-8)' fallback 'System.Text.EncoderReplacementFallback'. (Parameter 'bytes')
at System.Text.Encoding.ThrowBytesOverflow()
at System.Text.Encoding.ThrowBytesOverflow(EncoderNLS encoder, Boolean nothingEncoded)
at System.Text.Encoding.GetBytesWithFallback(ReadOnlySpan`1 chars, Int32 originalCharsLength, Span`1 bytes, Int32 originalBytesLength, EncoderNLS encoder)
at System.Text.Encoding.GetBytesWithFallback(Char* pOriginalChars, Int32 originalCharCount, Byte* pOriginalBytes, Int32 originalByteCount, Int32 charsConsumedSoFar, Int32 bytesWrittenSoFar, EncoderNLS encoder)
at System.Text.Encoding.GetBytes(Char* pChars, Int32 charCount, Byte* pBytes, Int32 byteCount, EncoderNLS encoder)
at System.Text.EncoderNLS.Convert(Char* chars, Int32 charCount, Byte* bytes, Int32 byteCount, Boolean flush, Int32& charsUsed, Int32& bytesUsed, Boolean& completed)
at System.Text.Encoder.Convert(ReadOnlySpan`1 chars, Span`1 bytes, Boolean flush, Int32& charsUsed, Int32& bytesUsed, Boolean& completed)
at System.IO.StdInReader.ReadLine(Byte[] buffer, Int32 offset, Int32 count)
at System.ConsolePal.UnixConsoleStream.Read(Byte[] buffer, Int32 offset, Int32 count)
at LanguageServerProtocol.LowLevel.readLine(Stream stream) in /home/u/code/fsac/src/LanguageServerProtocol/LanguageServerProtocol.fs:line 2023
at LanguageServerProtocol.LowLevel.readHeaders(Stream stream) in /home/u/code/fsac/src/LanguageServerProtocol/LanguageServerProtocol.fs:line 2040
at LanguageServerProtocol.LowLevel.read(Stream stream) in /home/u/code/fsac/src/LanguageServerProtocol/LanguageServerProtocol.fs:line 2056
at LanguageServerProtocol.Server.start[a,b](FSharpMap`2 requestHandlings, Stream input, Stream output, FSharpFunc`2 clientCreator, FSharpFunc`2 serverCreator) in /home/u/code/fsac/src/LanguageServerProtocol/LanguageServerProtocol.fs:line 2835 This was when I'm sending However |
Okay, it is very weird. I can't reproduce it on the same machine but with different kernel. |
I could reproduce it in WSL on my windows machine too now. I can try fixing it, or shall I wait for streamjsonrpc to be merged first and see if it fixes it? @baronfel @Krzysztof-Cieslak |
@vzarytovskii there's a C# LSP made by @razzmatazz on top of a shared LSP protocol implementation called |
I've tried to repro it on |
Now that im thinking about this there is a somewhat curiously related issue with emacs-29 (but not with emacs-28): One suspicion I have is that we have to set some options on stdin/stdout on startup. |
I've seen it first in emacs too with fsac, however it reproduces outside just in console (no matter what she'll or locale settings). It also does not reproduce on a simple console app which just reads a line from the Console.GetStandardInput() (the stream csharp-ls uses). |
I was googling a bit and this rings bells to me: https://stackoverflow.com/questions/6081946/why-does-console-readline-have-a-limit-on-the-length-of-text-it-allows/6081967#6081967 I have released a new version of csharp-ls -- lets see if that fixes things for you, @vzarytovskii .FSAC does the same thing in @baronfel also note, that I could not find max JSON RPC message size, so currently I am using 64KB in csharp-ls.. but not sure what safe/correct value of this param should be.. |
emacs@master problems looks to be something else, self inflicted pain :).. there is a follow-up on my investigation here |
Alright, it seems to be all the same for me on the 0.2.1 - it just hangs on any input. It seems to be independent on shell, locale or user. It is interesting that FSAC kinda continues reading if the initial string (e.g. header) is shorter than 16 characters. Update: and FSAC still throws:
|
Okay, after some more debugging and investigation, it for some reason tries to read a UTF8-sized character from ASCII stream. I could reproduce it on one more project. Same exception - fail to read more votes than there is in the stream. I'm not sure what exactly is causing it to fallback to the utf8 stream. Edit: the project i've tested it on: https://github.com/faldor20/fsharp-language-server Exception in read thread System.ArgumentException: The output byte buffer is too small to contain the encoded data, encoding 'Unicode (UTF-8)' fallback 'System.Text.EncoderReplacementFallback'. (Parameter 'bytes')
at System.Text.Encoding.ThrowBytesOverflow()
at System.Text.Encoding.ThrowBytesOverflow(EncoderNLS encoder, Boolean nothingEncoded)
at System.Text.Encoding.GetBytesWithFallback(ReadOnlySpan`1 chars, Int32 originalCharsLength, Span`1 bytes, Int32 originalBytesLength, EncoderNLS encoder)
at System.Text.Encoding.GetBytesWithFallback(Char* pOriginalChars, Int32 originalCharCount, Byte* pOriginalBytes, Int32 originalByteCount, Int32 charsConsumedSoFar, Int32 bytesWrittenSoFar, EncoderNLS encoder)
at System.Text.Encoding.GetBytes(Char* pChars, Int32 charCount, Byte* pBytes, Int32 byteCount, EncoderNLS encoder)
at System.Text.EncoderNLS.Convert(Char* chars, Int32 charCount, Byte* bytes, Int32 byteCount, Boolean flush, Int32& charsUsed, Int32& bytesUsed, Boolean& completed)
at System.Text.Encoder.Convert(ReadOnlySpan`1 chars, Span`1 bytes, Boolean flush, Int32& charsUsed, Int32& bytesUsed, Boolean& completed)
at System.IO.StdInReader.ReadLine(Span`1 buffer)
at System.ConsolePal.UnixConsoleStream.Read(Span`1 buffer)
at System.IO.ConsoleStream.ReadByte()
at System.IO.BinaryReader.Read()
at System.IO.BinaryReader.ReadChar()
at LSP.Tokenizer.readLine(BinaryReader client) in /home/u/code/fsharp-language-server/src/LSP/Tokenizer.fs:line 38
at LSP.Tokenizer.tokenize@56.GenerateNext(IEnumerable`1& next) in /home/u/code/fsharp-language-server/src/LSP/Tokenizer.fs:line 59
at Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase`1.MoveNextImpl() in D:\a\_work\1\s\src\fsharp\FSharp.Core\seqcore.fs:line 372
at Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase`1.System.Collections.IEnumerator.MoveNext() in D:\a\_work\1\s\src\fsharp\FSharp.Core\seqcore.fs:line 404
at Microsoft.FSharp.Collections.Internal.IEnumerator.map@75.DoMoveNext(b& curr) in D:\a\_work\1\s\src\fsharp\FSharp.Core\seq.fs:line 77
at Microsoft.FSharp.Collections.Internal.IEnumerator.MapEnumerator`1.System.Collections.IEnumerator.MoveNext() in D:\a\_work\1\s\src\fsharp\FSharp.Core\seq.fs:line 64
at Microsoft.FSharp.Collections.SeqModule.TakeWhile@1308.GenerateNext(IEnumerable`1& next) in D:\a\_work\1\s\src\fsharp\FSharp.Core\seq.fs:line 1310
at Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase`1.MoveNextImpl() in D:\a\_work\1\s\src\fsharp\FSharp.Core\seqcore.fs:line 372
at Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase`1.System.Collections.IEnumerator.MoveNext() in D:\a\_work\1\s\src\fsharp\FSharp.Core\seqcore.fs:line 404
at LSP.LanguageServer.connect@195.Invoke() in /home/u/code/fsharp-language-server/src/LSP/LanguageServer.fs:line 198 |
Hey @vzarytovskii I think you are onto something. I am not sure, but this sounds like environment variable issue... can you somehow force Otherwise we might just need to set |
Yeah, that's the first thing I did (although I have
I will try doing that. |
Ok, setting System.ArgumentException: The output byte buffer is too small to contain the encoded data, encoding 'US-ASCII' fallback 'System.Text.EncoderReplacementFallback'. (Parameter 'bytes')
at System.Text.Encoding.ThrowBytesOverflow()
at System.Text.Encoding.ThrowBytesOverflow(EncoderNLS encoder, Boolean nothingEncoded)
at System.Text.Encoding.GetBytesWithFallback(ReadOnlySpan`1 chars, Int32 originalCharsLength, Span`1 bytes, Int32 originalBytesLength, EncoderNLS encoder)
at System.Text.ASCIIEncoding.GetBytesWithFallback(ReadOnlySpan`1 chars, Int32 originalCharsLength, Span`1 bytes, Int32 originalBytesLength, EncoderNLS encoder)
at System.Text.Encoding.GetBytesWithFallback(Char* pOriginalChars, Int32 originalCharCount, Byte* pOriginalBytes, Int32 originalByteCount, Int32 charsConsumedSoFar, Int32 bytesWrittenSoFar, EncoderNLS encoder)
at System.Text.Encoding.GetBytes(Char* pChars, Int32 charCount, Byte* pBytes, Int32 byteCount, EncoderNLS encoder)
at System.Text.EncoderNLS.Convert(Char* chars, Int32 charCount, Byte* bytes, Int32 byteCount, Boolean flush, Int32& charsUsed, Int32& bytesUsed, Boolean& completed)
at System.Text.Encoder.Convert(ReadOnlySpan`1 chars, Span`1 bytes, Boolean flush, Int32& charsUsed, Int32& bytesUsed, Boolean& completed)
at System.IO.StdInReader.ReadLine(Span`1 buffer)
at System.ConsolePal.UnixConsoleStream.Read(Span`1 buffer)
at System.IO.ConsoleStream.ReadByte()
at System.IO.BinaryReader.Read()
at System.IO.BinaryReader.ReadChar()
at LSP.Tokenizer.readLine(BinaryReader client) in /home/u/code/fsharp-language-server/src/LSP/Tokenizer.fs:line 38
at LSP.Tokenizer.tokenize@56.GenerateNext(IEnumerable`1& next) in /home/u/code/fsharp-language-server/src/LSP/Tokenizer.fs:line 59
at Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase`1.MoveNextImpl() in D:\a\_work\1\s\src\fsharp\FSharp.Core\seqcore.fs:line 372
at Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase`1.System.Collections.IEnumerator.MoveNext() in D:\a\_work\1\s\src\fsharp\FSharp.Core\seqcore.fs:line 404
at Microsoft.FSharp.Collections.Internal.IEnumerator.map@75.DoMoveNext(b& curr) in D:\a\_work\1\s\src\fsharp\FSharp.Core\seq.fs:line 77
at Microsoft.FSharp.Collections.Internal.IEnumerator.MapEnumerator`1.System.Collections.IEnumerator.MoveNext() in D:\a\_work\1\s\src\fsharp\FSharp.Core\seq.fs:line 64
at Microsoft.FSharp.Collections.SeqModule.TakeWhile@1308.GenerateNext(IEnumerable`1& next) in D:\a\_work\1\s\src\fsharp\FSharp.Core\seq.fs:line 1310
at Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase`1.MoveNextImpl() in D:\a\_work\1\s\src\fsharp\FSharp.Core\seqcore.fs:line 372
at Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase`1.System.Collections.IEnumerator.MoveNext() in D:\a\_work\1\s\src\fsharp\FSharp.Core\seqcore.fs:line 404
at LSP.LanguageServer.connect@195.Invoke() in /home/u/code/fsharp-language-server/src/LSP/LanguageServer.fs:line 198 Edit: as mentioned above, now I can reproduce it on both full linux installation and WSL2 from both my work laptop and home PC. |
Sourced precompiled version from vim-lsp-settings, not sure which version it is.
Fails to start with very little diagnostic message.
Same used to work fine with Manjaro 64bit running on raspberry pi4.
Anything further I can do to debug?
The text was updated successfully, but these errors were encountered: