dotnet / dotnet/runtime

System.IO.Strategies.BufferedFileStreamStrategy.Seek assertion running Roslyn replay

Open
#119,905 1 comment 0 reactions 0 assignees View on GitHub
area-System.IO help wanted
Dominant language
C#
Stars
18.3k
Forks
5.6k
PR merge metrics
PR metrics pending

Description

Build a testhost with checked runtime, eg
```
.\build.cmd -subset clr -c Checked
.\build.cmd -subset libs+libs.tests -c Release -rc Checked
```
Enlist in roslyn, and apply the following edits or otherwise fix it to build against 10.0 and not disable TC in VBCSCompiler.
```
diff --git a/eng/targets/TargetFrameworks.props b/eng/targets/TargetFrameworks.props
index f5501deb5e5..b99c4344dbf 100644
--- a/eng/targets/TargetFrameworks.props
+++ b/eng/targets/TargetFrameworks.props
@@ -13,7 +13,7 @@
-->

net9.0
- net8.0;net9.0
+ net8.0;net9.0;net10.0
net8.0
net9.0
net8.0
diff --git a/src/Compilers/Server/VBCSCompiler/AnyCpu/VBCSCompiler.csproj b/src/Compilers/Server/VBCSCompiler/AnyCpu/VBCSCompiler.csproj
index 63820995a72..d524936837b 100644
--- a/src/Compilers/Server/VBCSCompiler/AnyCpu/VBCSCompiler.csproj
+++ b/src/Compilers/Server/VBCSCompiler/AnyCpu/VBCSCompiler.csproj
@@ -5,7 +5,7 @@
Exe
$(NetRoslynSourceBuild);net472
true
- false
+



diff --git a/src/Tools/Replay/Replay.csproj b/src/Tools/Replay/Replay.csproj
index 219d34dfc76..762e6d4bebc 100644
--- a/src/Tools/Replay/Replay.csproj
+++ b/src/Tools/Replay/Replay.csproj
@@ -1,7 +1,7 @@


Exe
- $(NetRoslynSourceBuild);net472
+ net9.0;net10.0;$(NetRoslynSourceBuild);net472
true
false

```
build the [replay tool](https://github.com/dotnet/roslyn/tree/main/src/Tools/Replay) for net10.0

Enlist in OrchardCore, and build capturing the binlog. Other semi-complicated build binlogs may work too.

Replay this binlog using the replay tool and the testhost with checked SPC:
```
C:\repos\roslyn\src\Tools\Replay>c:\repos\runtime2\artifacts\bin\testhost\net10.0-windows-Release-x64\dotnet.exe exec C:\repos\roslyn\artifacts\bin\Replay\Release\net10.0\Replay.dll C:\bugs\roslyn-tc\orchard2.binlog -i 1
Binary Log: C:\bugs\roslyn-tc\orchard2.binlog
Client Directory: C:\repos\roslyn\artifacts\bin\Replay\Release\net10.0\
Output Directory: C:\Users\andya\AppData\Local\Temp\replay
Pipe Name: 7c478d65-edf1-4ed0-9797-733e0440795c
Parallel: 6
Iterations: 1
Compilation Events: 221

Iteration: 1

Starting server
VBCSCompiler Process Id: 42652
Process terminated.
Assertion failed.
newPos (=3621) == Position (=4079)
at System.IO.Strategies.BufferedFileStreamStrategy.Seek(Int64 offset, SeekOrigin origin) in C:\repos\runtime2\src\libraries\System.Private.CoreLib\src\System\IO\Strategies\BufferedFileStreamStrategy.cs:line 902
at Microsoft.CodeAnalysis.CommandLine.CompilerServerLogger.Log(String message) in C:\repos\roslyn\src\Compilers\Shared\CompilerServerLogger.cs:line 160
at Microsoft.CodeAnalysis.CommandLine.CompilerServerLoggerExtensions.Log(ICompilerServerLogger logger, String format, Object[] arguments) in C:\repos\roslyn\src\Compilers\Shared\CompilerServerLogger.cs:line 36
```

This seems to fail pretty reliably, though the numbers in the assert vary.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.