Thread: Uninitialized Data in WAL records generated in heap_(insert|update|delete)

Uninitialized Data in WAL records generated in heap_(insert|update|delete)

From
Andres Freund
Date:
Hi,

While checking some other code I used valgrind and noticed, as I had before, 
that XLogInsert showed accesses to unitialized data.
After some searching and playing around I found the source of that:
heap_insert uses a struct xl_heap_insert which in turn has a xl_heaptid member 
- which is padded.
COMP_CRC32 will read most of xl_heap_insert (excluding its trailing padding) 
and thus generates valgrind warnings...

Questions:
* I don't actually see any real danger in that - correct?
* valgrind is quite usefull for investigating some issues, has a patch 
conditionally zeroing or annotating those structs any chances? 

Andres