On 2016-11-14 13:12:28 -0500, Tom Lane wrote: > Andres Freund <and...@anarazel.de> writes: > > On 2016-11-14 12:32:53 -0500, Tom Lane wrote: > >> Basically my concern is that this restriction isn't documented anywhere > >> and I'm not entirely certain it's been adhered to everywhere. I'd feel > >> much better about it if there were some way we could verify that. > > > Would support for valgrind complaining about access to unpinned buffers > > suffice? > > I don't think it directly addresses the issue, but certainly it'd help.
Well, it detects situations where removed pins cause "unprotected access", but of course that doesn't protect against cases where independent pins hide that issue. > Do you think that's easily doable? I think so, yes. IIRC I discussed it with Noah and Peter G. at a conference recently. We'd basically mark the content of shared buffers inaccessible at backend startup, and mark it accessible whenever a PinBuffer() happens, and then inaccessible during unpinning. We probably have to exclude the page header though, as we intentionally access them unpinned in some cases IIRC. - Andres -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers