dotnet / sdk

Core functionality needed to create .NET Core projects, that is shared between Visual Studio and CLI
https://dot.net/core
MIT License
2.59k stars 1.03k forks source link

System.AccessViolationException in build process #41868

Open SebastianStehle opened 5 days ago

SebastianStehle commented 5 days ago

Describe the bug

A clear and concise description of what the bug is.

To Reproduce

When I build the following repository I get an AccessViolationException:

Repository: https://github.com/Squidex/squidex/tree/c7e08cb1ac83e2171db65fa1d185be44a2b08064

Exceptions (if any)

A typical error is like this, but it is not always the same:

C:\Program Files\dotnet\sdk\8.0.302\Roslyn\Microsoft.CSharp.Core.targets(85,5): error : Fatal error. System.AccessViola
tionException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. [
C:\Users\mail2\Downloads\squidex-master\squidex-master\backend\src\Migrations\Migrations.csproj]
C:\Program Files\dotnet\sdk\8.0.302\Roslyn\Microsoft.CSharp.Core.targets(85,5): error :    at Microsoft.CodeAnalysis.Di
agnostics.AnalyzerExecutor.ExecuteSyntaxNodeActions[[Microsoft.CodeAnalysis.CSharp.SyntaxKind, Microsoft.CodeAnalysis.C
Sharp, Version=4.10.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](System.Collections.Generic.IEnumerable`1<Mi
crosoft.CodeAnalysis.SyntaxNode>, Microsoft.CodeAnalysis.Collections.ImmutableSegmentedDictionary`2<Microsoft.CodeAnaly
sis.CSharp.SyntaxKind,System.Collections.Immutable.ImmutableArray`1<Microsoft.CodeAnalysis.Diagnostics.SyntaxNodeAnalyz
erAction`1<Microsoft.CodeAnalysis.CSharp.SyntaxKind>>>, Microsoft.CodeAnalysis.Diagnostics.DiagnosticAnalyzer, Microsof
t.CodeAnalysis.ISymbol, Microsoft.CodeAnalysis.SemanticModel, System.Func`2<Microsoft.CodeAnalysis.SyntaxNode,Microsoft
.CodeAnalysis.CSharp.SyntaxKind>, AnalyzerDiagnosticReporter, System.Func`3<Microsoft.CodeAnalysis.Diagnostic,System.Th
reading.CancellationToken,Boolean>, System.Nullable`1<Microsoft.CodeAnalysis.Text.TextSpan>, Boolean, Boolean, System.T
hreading.CancellationToken) [C:\Users\mail2\Downloads\squidex-master\squidex-master\backend\src\Migrations\Migrations.c
sproj]

Further technical details

  1. Test the disk with Samsung Magicion
  2. Test the disk with Windows chdsk
  3. Check the RAM with Windows MEmory Diagnoser
  4. Check the RAM with memtest86
  5. Reinstall Windows
  6. Replace the RAM
  7. Replace the Disk

Actually nothing helps. But it is really difficult these days to have a brand new Windows. Some settings are always transferred when you login with your Microsoft account-

baronfel commented 5 days ago

The call stack suggests an analyzer diagnostic reporting error - @jaredpar what would Roslyn need to investigate? Would a binlog/complog be enough?