On Tue, Mar 9, 2021 at 1:54 PM Peter Geoghegan <p...@bowt.ie> wrote: > It occurs to me that we should also mark the hole in the middle of the > page (which includes the would-be LP_UNUSED line pointers at the end > of the original line pointer array space) as undefined to Valgrind > within PageRepairFragmentation().
It would probably also make sense to memset() the space in question to a sequence of 0x7F bytes in CLOBBER_FREED_MEMORY builds. That isn't quite as good as what Valgrind will do in some ways, but it has a major advantage: it will usually visibly break code where the PageRepairFragmentation() calls made by VACUUM happen to take place inside another backend. Valgrind instrumentation of PageRepairFragmentation() along the lines I've described won't recognize the "hole in the middle of the page" area as undefined when it was marked undefined in another backend. It's as if shared memory is private to each process as far as the memory poisoning/undefined-to-Valgrind stuff is concerned. In other words, it deals with memory mappings, not memory. -- Peter Geoghegan