Giter VIP home page Giter VIP logo

Comments (5)

TrieBr avatar TrieBr commented on June 18, 2024

I confirmed it works in 2.10.28, 2.15.30, 2.18.16, 2.23.15. Broken in 2.28.11.

I've reverted 2.23.15. Razor syntax highlighting still doesn't work at all, but at least the whole LSP server doesn't crash and break regular .cs files too.

from vscode-csharp.

dibarbet avatar dibarbet commented on June 18, 2024

Formatting the exception from the logs

[stderr] Fatal error.
[stderr] System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
[stderr] at System.Buffer.Memmove(Byte ByRef, Byte ByRef, UIntPtr)
[stderr] at System.IO.UnmanagedMemoryStream.WriteCore(System.ReadOnlySpan`1)
[stderr] at System.IO.UnmanagedMemoryStream.Write(Byte[], Int32, Int32)
[stderr] at System.IO.Stream.Write(System.ReadOnlySpan`1)
[stderr] at System.IO.StreamWriter.Flush(Boolean, Boolean)
[stderr] at System.IO.StreamWriter.Write(Char[], Int32, Int32)
[stderr] at Microsoft.CodeAnalysis.Text.LargeText.Write(System.IO.TextWriter, Microsoft.CodeAnalysis.Text.TextSpan, System.Threading.CancellationToken)
[stderr] at Microsoft.CodeAnalysis.Host.TemporaryStorageService.g__WriteToMemoryMappedFile|12_0(<>c__DisplayClass12_0 ByRef) 
at Microsoft.CodeAnalysis.Host.TemporaryStorageService+d__13.MoveNext()
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[Microsoft.CodeAnalysis.Host.TemporaryStorageService+d__13, Microsoft.CodeAnalysis.Workspaces, Version=4.11.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](d__13 ByRef) 
at Microsoft.CodeAnalysis.Host.TemporaryStorageService+d__11.MoveNext() 
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[Microsoft.CodeAnalysis.Host.TemporaryStorageService+d__11, Microsoft.CodeAnalysis.Workspaces, Version=4.11.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](d__11 ByRef) 
at Microsoft.CodeAnalysis.RecoverableTextAndVersion+RecoverableText+d__12.MoveNext() 
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[Microsoft.CodeAnalysis.RecoverableTextAndVersion+RecoverableText+d__12, Microsoft.CodeAnalysis.Workspaces, Version=4.11.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](d__12 ByRef) 
at Microsoft.CodeAnalysis.RecoverableTextAndVersion+RecoverableText+d__27.MoveNext() 
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[Microsoft.CodeAnalysis.RecoverableTextAndVersion+RecoverableText+d__27, Microsoft.CodeAnalysis.Workspaces, Version=4.11.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](d__27 ByRef) 
at Microsoft.CodeAnalysis.RecoverableTextAndVersion+RecoverableText.SaveAllAsync(Microsoft.CodeAnalysis.Collections.ImmutableSegmentedList`1>, System.Threading.CancellationToken) 
at Roslyn.Utilities.AsyncBatchingWorkQueue`1+<>c__DisplayClass2_0+<b__0>d[[System.ValueTuple`2[[System.__Canon, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].MoveNext() 
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[Roslyn.Utilities.AsyncBatchingWorkQueue`1+<>c__DisplayClass2_0+<b__0>d[[System.ValueTuple`2[[System.__Canon, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], Microsoft.CodeAnalysis.Workspaces, Version=4.11.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d> ByRef) [stderr]
at Roslyn.Utilities.AsyncBatchingWorkQueue`1+<>c__DisplayClass2_0[[System.ValueTuple`2[[System.__Canon, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].b__0(Microsoft.CodeAnalysis.Collections.ImmutableSegmentedList`1>, System.Threading.CancellationToken) 
at Roslyn.Utilities.AsyncBatchingWorkQueue`2+d__17[[System.ValueTuple`2[[System.__Canon, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[Roslyn.Utilities.VoidResult, Microsoft.CodeAnalysis.Workspaces, Version=4.11.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]].MoveNext() 
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[Roslyn.Utilities.AsyncBatchingWorkQueue`2+d__17[[System.ValueTuple`2[[System.__Canon, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[Roslyn.Utilities.VoidResult, Microsoft.CodeAnalysis.Workspaces, Version=4.11.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]], Microsoft.CodeAnalysis.Workspaces, Version=4.11.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](d__17,Roslyn.Utilities.VoidResult> ByRef) 
at Roslyn.Utilities.AsyncBatchingWorkQueue`2[[System.ValueTuple`2[[System.__Canon, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[Roslyn.Utilities.VoidResult, Microsoft.CodeAnalysis.Workspaces, Version=4.11.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]].ProcessNextBatchAsync() [stderr]
at Roslyn.Utilities.AsyncBatchingWorkQueue`2+<g__ContinueAfterDelayAsync|15_1>d[[System.ValueTuple`2[[System.__Canon, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[Roslyn.Utilities.VoidResult, Microsoft.CodeAnalysis.Workspaces, Version=4.11.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]].MoveNext() 
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object) 
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1+AsyncStateMachineBox`1[[Roslyn.Utilities.VoidResult, Microsoft.CodeAnalysis.Workspaces, Version=4.11.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35],[Roslyn.Utilities.AsyncBatchingWorkQueue`2+<g__ContinueAfterDelayAsync|15_1>d[[System.ValueTuple`2[[System.__Canon, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[Roslyn.Utilities.VoidResult, Microsoft.CodeAnalysis.Workspaces, Version=4.11.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]], Microsoft.CodeAnalysis.Workspaces, Version=4.11.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]].MoveNext(System.Threading.Thread) 
at System.Threading.ThreadPoolWorkQueue.Dispatch() 
at System.Threading.PortableThreadPool+WorkerThread.WorkerThreadStart()
[Error - 2:35:01 AM] Client Microsoft.CodeAnalysis.LanguageServer: connection to server is erroring. Shutting down server.

@TrieBr would you be able to enable crash dump collection by setting dotnet.server.crashDumpPath to a user writeable folder in vscode settings? That should hopefully create a crash dump. You can email the dump to me directly if you don't want to share publicly ([email protected])
image

from vscode-csharp.

gabynevada avatar gabynevada commented on June 18, 2024

@dibarbet Did you receive the crash dump? I'm having the same issue, can generate the crash dump if needed.

from vscode-csharp.

dibarbet avatar dibarbet commented on June 18, 2024

@dibarbet Did you receive the crash dump? I'm having the same issue, can generate the crash dump if needed.

@gabynevada I haven't, if you have one please send it

from vscode-csharp.

dibarbet avatar dibarbet commented on June 18, 2024

Was able to reproduce today on a devcontainer, and figured out the issue thanks to dotnet/runtime#79832

Issue appears to be our usage of memory mapped files - these files are getting stored in /dev/shm in the docker container which by default is given a max size of 64MB. We quickly exceed this value. Can view this in realtime via the command watch --interval=1 df --human-readable /dev/shm to see the usage of /dev/shm slowly go up to 100%, at which point the server crashes.

Currently exploring a fix for the issue, but in the meantime you can start the container with a larger /dev/shm size by passing --shm-size=4G to docker run (or adding "runArgs": ["--shm-size=4G"] to your devcontainer.json

from vscode-csharp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.