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

From: Andres Freund <andres(at)anarazel(dot)de>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Uninitialized Data in WAL records generated in heap_(insert|update|delete)
Date: 2009-11-07 12:32:52
Message-ID: 200911071332.52738.andres@anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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

Browse pgsql-hackers by date

  From Date Subject
Next Message Sergio A. Kessler 2009-11-07 17:29:54 Re: Specific names for plpgsql variable-resolution control options?
Previous Message Simon Riggs 2009-11-07 11:05:41 Re: Getting consistent snapshot in multiple backends, for parallel pg_dump