Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JIT: Unchecked write barriers are emitted for stack allocated arrays #112709

Closed
jakobbotsch opened this issue Feb 19, 2025 · 4 comments · Fixed by #112711
Closed

JIT: Unchecked write barriers are emitted for stack allocated arrays #112709

jakobbotsch opened this issue Feb 19, 2025 · 4 comments · Fixed by #112711
Assignees
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI in-pr There is an active PR which will close this issue when it is merged
Milestone

Comments

@jakobbotsch
Copy link
Member

// Generated by Fuzzlyn v2.4 on 2025-02-19 20:47:50
// Run on X64 Windows
// Seed: 12432040051036532696-vectort,vector128,vector256,x86aes,x86avx,x86avx2,x86avx512bw,x86avx512bwvl,x86avx512cd,x86avx512cdvl,x86avx512dq,x86avx512dqvl,x86avx512f,x86avx512fvl,x86avx512fx64,x86bmi1,x86bmi1x64,x86bmi2,x86bmi2x64,x86fma,x86lzcnt,x86lzcntx64,x86pclmulqdq,x86popcnt,x86popcntx64,x86sse,x86ssex64,x86sse2,x86sse2x64,x86sse3,x86sse41,x86sse41x64,x86sse42,x86sse42x64,x86ssse3,x86x86base
// Reduced from 62.0 KiB to 0.5 KiB in 00:06:15
// Exits with error:
// Fatal error. System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
//    at Program.Main(Fuzzlyn.ExecutionServer.IRuntime)
//    at Fuzzlyn.ExecutionServer.Program.<RunPairAsync>g__RunAndGetResultAsync|1_0(Byte[], <>c__DisplayClass1_0 ByRef)
//    at Fuzzlyn.ExecutionServer.Program.RunPairAsync(System.Runtime.Loader.AssemblyLoadContext, Fuzzlyn.ExecutionServer.ProgramPair)
//    at Fuzzlyn.ExecutionServer.Program+<>c__DisplayClass0_0.<Main>b__0()
//    at System.Threading.Thread+StartHelper.RunWorker()
//
using System;
using System.Numerics;
using System.Runtime.Intrinsics;
using System.Runtime.Intrinsics.X86;

public class Program
{
    public static void Main()
    {
        Vector256<byte>[][][] vr0 = default(Vector256<byte>[][][]);
        vr0 = new Vector256<byte>[][][]
        {
            new Vector256<byte>[][]
            {
                new Vector256<byte>[]
                {
                    Vector256.Create<byte>(0)
                }
            }
        };
        vr0[0] = vr0[0];
    }
}

Looks introduced by #112527, cc @AndyAyersMS

@dotnet-issue-labeler dotnet-issue-labeler bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Feb 19, 2025
@dotnet-policy-service dotnet-policy-service bot added the untriaged New issue has not been triaged by the area owner label Feb 19, 2025
Copy link
Contributor

Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.

@EgorBo
Copy link
Member

EgorBo commented Feb 19, 2025

Likely set by this one.
(not sure if should be just removed, or can take arrayObjVN and check whether it's stack-alloc or not)

@dotnet-policy-service dotnet-policy-service bot added the in-pr There is an active PR which will close this issue when it is merged label Feb 19, 2025
@AndyAyersMS
Copy link
Member

Odd that it wasn't caught by other tests.

@EgorBo EgorBo self-assigned this Feb 19, 2025
@EgorBo EgorBo added this to the 10.0.0 milestone Feb 19, 2025
@EgorBo EgorBo removed the untriaged New issue has not been triaged by the area owner label Feb 19, 2025
@EgorBo
Copy link
Member

EgorBo commented Feb 19, 2025

Odd that it wasn't caught by other tests.

My fix seems to found 0 text diffs (at least in a few collections I tried) so that'd explain why

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI in-pr There is an active PR which will close this issue when it is merged
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants