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
[wasm] Volatile intrinsics not implemented #124477
don't seem to be implemented on WebAssembly, leading to failures when referenced libraries call them.
Reproduction Steps
Create a minimal blazor wasm app, call Volatile.ReadBarrier() in it, run it.
Expected behavior
Runs. I think the runtime could simply use Interlocked.MemoryBarrier for correct (albeit perhaps suboptimal) behavior for Volatile.ReadBarrier and Volatile.WriteBarrier.
Actual behavior
Crashes with stack overflow (since the default implementation seems to be that the method is just calling itself).
Regression?
Probably not, these seem to be new APIs in .NET 10.
Known Workarounds
Don't use Volatile.ReadBarrier/WriteBarrier but that's difficult if it's used by referenced libraries whose source code I don't control.
Maybe just adding a test that checks the call succeeds for now would suffice? I can add one if wanted, or someone else could (probably wouldn't take long / be hard - the potentially more difficult part would be implementing it on places without it).
Activity
dotnet-policy-service commentedon Feb 16, 2026
Tagging subscribers to 'arch-wasm': @lewing, @pavelsavara
See info in area-owners.md if you want to be subscribed.
jkotas commentedon Feb 16, 2026
#107843 that introduced these APIs did not come with any tests.
@hamarb123 @VSadov
dotnet-policy-service commentedon Feb 16, 2026
Tagging subscribers to this area: @agocke, @VSadov
See info in area-owners.md if you want to be subscribed.
hamarb123 commentedon Feb 16, 2026
Context: #107843 (comment)
Maybe just adding a test that checks the call succeeds for now would suffice? I can add one if wanted, or someone else could (probably wouldn't take long / be hard - the potentially more difficult part would be implementing it on places without it).
VSadov commentedon Feb 16, 2026
If wasm is single-threaded, then
ReadBarrier()could have a noop implementation.jkotas commentedon Feb 18, 2026
Fixed by #124538. We still need to add some tests.