Repository navigation
Commit 0081ba6
committed
fix(spill): declare the parked result image defined to Valgrind Memcheck
The result spill writes each parked result as an opaque image: the record
header (a struct copy) and the compacted arena block. Both contain struct
padding that no code writes, and the image is read back whole, never
interpreted byte by byte. MemorySanitizer builds already declare the image
defined before the fwrite. Valgrind Memcheck flags the same bytes at
write(2) ("Syscall param write(buf) points to uninitialised byte(s)"),
with origins in stack-built records such as CBMReadWrite in
handle_readwrites and the import record in py_ns_import. Zeroing those
records one at a time only moves the report to the next record type.
When <valgrind/memcheck.h> is available (non-Windows, __has_include),
SPILL_IMAGE_DEFINED now issues VALGRIND_MAKE_MEM_DEFINED. Outside Valgrind
that is a few no-op instructions. Builds without the header compile it to
nothing as before.
Verified: extraction:extract_spill_round_trip_keeps_every_field under
Memcheck went from 1 error context to 0. The extraction suite passes
(470), and the -Werror build and lint pass.1 parent 3dada7c commit 0081ba6
1 file changed
Lines changed: 10 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
33 | 35 | | |
34 | 36 | | |
35 | 37 | | |
36 | 38 | | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
37 | 46 | | |
38 | 47 | | |
39 | 48 | | |
| |||
0 commit comments