You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[mono][android-arm64] System.Threading.Volatile.ReadBarrier() never returns (hangs; or StackOverflow/SIGSEGV in deeper call chains) #130265
net10.0-android36.1, RID android-arm64 (arm64-v8a), Debug, Mono JIT/interpreter (no AOT).
The [Intrinsic] is not recognized on this target; the self-referential managed
fallback executes:
simple/direct call -> tail-call-optimized into an infinite loop -> HANGS forever
deep call chain (e.g. Roslyn CSharpCompilation.Emit) -> stack grows ->
StackOverflowException / native SIGSEGV (SEGV_ACCERR, fault addr 16 bytes
below a 4 KB page boundary, e.g. 0x...ff0; observed on Thread-18).
Output target is irrelevant: MemoryStream vs temp FileStream makes no difference.
Real-world trigger / version boundary:
Microsoft.CodeAnalysis.CSharp 5.3.0 -> OK
Microsoft.CodeAnalysis.CSharp 5.6.0 -> crash (calls ReadBarrier() during Emit)
Ruled out (all reproduce unchanged):
concurrentBuild:false; 16 MB thread stack; CreateFromStream; DOTNET_EnableHWIntrinsic=0;
all ~80 reference assemblies validated intact via PEReader.
Reproduction Steps
Simply execute in net10.0-android36.1:
Minimal repro (no Roslyn, no stream):
System.Threading.Volatile.ReadBarrier(); // never returns
ReadBarrier() hangs and finally generates a stack overflow
Expected behavior
System.Threading.Volatile.ReadBarrier();
should not crash.
Actual behavior
ReadBarrier() hangs and finally generates a stack overflow
Regression?
The problem occurs in combination with Microsoft.CodeAnalysis.CSharp.Scripting 5.6.0, because only this version uses ReadBarrier().
With Microsoft.CodeAnalysis.CSharp.Scripting 5.3.0 there is no problem.
Known Workarounds
Use Microsoft.CodeAnalysis.CSharp.Scripting 5.3.0 to avoid calling ReadBarrier().
Do not use Microsoft.CodeAnalysis.CSharp.Scripting 5.6.0 in net10.0-android36.1
Will this be fixed also in NET10?
Basically this is a severe bug that also prevents usage of Microsoft.CodeAnalysis.CSharp.Scripting 5.6.0 in net10.0-android
Activity
jkotas commentedon Jul 7, 2026
Fixed by #124538
dotnet-policy-service commentedon Jul 7, 2026
Tagging subscribers to this area: @vitek-karas, @BrzVlad, @kotlarmilos
See info in area-owners.md if you want to be subscribed.
uholeschak commentedon Jul 7, 2026
Will this be fixed also in NET10?
Basically this is a severe bug that also prevents usage of Microsoft.CodeAnalysis.CSharp.Scripting 5.6.0 in net10.0-android
BrzVlad commentedon Jul 13, 2026
This will be included in the 10.0.11 release, so it will take about a month for the fix to be available.
fix: Script run failed on Android due to a known bug.