runtime: Span CopyTo Span - Crashes .Net

There appears to be some sort of threading issue in the System.Memory 4.5.3 running on .Net Framework for the following code:

Memory<byte> memory = new byte[100]; ReadOnlySpan<byte> temp = new byte[30]; temp.CopyTo(memory.Span);

attached is a sample program that will crash the error:

The process was terminated due to an internal error in the .NET Runtime at IP 00007FFE09357BFD (00007FFE091A0000) with exit code 80131506.

category:correctness theme:gc-info skill-level:expert cost:medium

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 21 (17 by maintainers)

Commits related to this issue

Most upvoted comments

I have checked in the fix for this issue into the Desktop .Net runtime for 4.8 and 4.7

The fix is expected to ship in the latter part of September as part of that month’s non security release. (barring any unexpected issues)

Thanks, I have a repro case and have tested the fix. It looks good

It can be worked around in System.Memory by avoiding the code pattern that hits the JIT bug.

https://github.com/dotnet/coreclr/issues/27924 is the root cause of this crash.