Repository navigation
JIT: Value-initialize regPtrDsc entries - #137506
Conversation
|
Azure Pipelines: Successfully started running 5 pipeline(s). 10 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
|
Tagging subscribers to this area: @agocke, @dotnet/ilc-contrib |
|
Does the out of bound read still happen with code in #137539 deleted? That code seems to be some relic from .NET Native times. If it still does something, it's probably papering over a bug (we'll see once the CI is done). |
`gcRegPtrAllocDsc` allocated `regPtrDsc` from the arena and only reset a few fields. Clang builds the bitfield byte from whatever was already in memory and sets `rpdArg` with `and; inc`, which memcheck models as an add that taints every bit above the lowest undefined input bit. As a result valgrind reported `rpdGCtype` as uninitialized and the noise propagated into the `StackSlotIdKey` hash table lookups and the GC slot sort in the GC info encoder (29 reports for a small ASP.NET app). Value-initialize the entry instead, which also covers the fields that were reset explicitly. Generated code and GC info are unchanged. Co-authored-by: Cursor <[email protected]>
|
Confirmed: with #137539 the out-of-bounds read is gone. On the same main base, I've dropped the fat function pointer change and repurposed this PR for the other valgrind finding: the uninitialized-value reports from the JIT's GC info encoding. |
|
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
|
Where is the uninitialized read reported in the JIT? This change will make it read 0, but that's is not necessarily the right fix - the value is still de-facto uninitialized. |
|
It's reported in |
|
/ba-g s dead-letter |
Value-initialize
regPtrDscinstead of resetting individual fields. This silences valgrind's uninitialized-value reports from the JIT's GC info encoding (CoreCLR app, Release, valgrind 3.26):