Re: XLogInsert() of dangling pointer while logging replica identity - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: XLogInsert() of dangling pointer while logging replica identity
Date
Msg-id 20190201013849.GB2179@paquier.xyz
Whole thread Raw
In response to XLogInsert() of dangling pointer while logging replica identity  (Stas Kelvich <s.kelvich@postgrespro.ru>)
Responses Re: XLogInsert() of dangling pointer while logging replica identity
List pgsql-hackers
On Thu, Jan 31, 2019 at 11:51:36PM +0300, Stas Kelvich wrote:
>   It seems that heapam.c:3082 calls XLogRegisterData() with an argument
> allocated on stack, but following call to XLogInsert() happens after
> end of context for that variable.
>   Issue spotted by clang's AddressSanitizer. Fix attached.

Oh, good catch.  Committed and back-patched down to 9.4.
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: David Rowley
Date:
Subject: Re: Delay locking partitions during query execution
Next
From: Michael Paquier
Date:
Subject: Re: Don't wake up to check trigger file if none is configured