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
JIT: (bug) AV in CEEInfo::getObjectContent while compiling "ab".AsSpan(Idx[0], 2).ToArray() with an out-of-range constant index #137680
With an out-of-range constant index, assertion prop (optVNBasedFoldExpr_Call_Memmove) asks the VM for the content of the frozen string "ab" at a ~2GB offset. CEEInfo::getObjectContent does its bounds check in int, the check overflows and passes, and memcpy reads past the string. The process dies while JIT-compiling Test instead of throwing ArgumentOutOfRangeException.
Looks like a regression between 9.0 and 10.0 (not bisected).
Notes
The source address VN is frozen "ab" + 12 + 2 * 0x3FFFFFF8 = obj + 0x7FFFFFFC. It passes the byteOffset <= INT32_MAX check in GetImmutableDataFromAddress, so the JIT calls getObjectContent(obj, buffer, size = 4, offset = 0x7FFFFFFC) even though the copy block is dead (the range check folds into a throw).
CEEInfo::getObjectContent (jitinterface.cpp) checks bufferSize + valueOffset <= (int)objRef->GetSize()) in int: 4 + 0x7FFFFFFC wraps to INT_MIN and passes. The check should be overflow-free, e.g. valueOffset <= objSize && bufferSize <= objSize - valueOffset. getStaticFieldContent may have the same pattern.
Activity
dotnet-policy-service commentedon Nov 16, 2026
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.
Fix AV in CEEInfo::getObjectContent with out-of-range index (dotnet#1…