Re: BUG #16190: The usage of NULL pointer in refint.c

From: Andres Freund <andres(at)anarazel(dot)de>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, starbugs(at)qq(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #16190: The usage of NULL pointer in refint.c
Date: 2020-01-07 02:26:54
Message-ID: 20200107022654.vgfwx7hactiokcsa@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On 2020-01-06 21:12:05 -0500, Tom Lane wrote:
> Michael Paquier <michael(at)paquier(dot)xyz> writes:
> > On Mon, Jan 06, 2020 at 09:44:43AM -0800, Andres Freund wrote:
> >> I think we should consider either moving this out of contrib, or fixing
> >> it up. test/example code is fine, but contrib gets installed by default
> >> for a lot of people... And yea, this isn't just about contrib/spi.
>
> > No idea about moving that out of contrib/, but here is a patch to fix
> > things that just moves the allocations to TopMemoryContext and removes
> > the system calls.
>
> WFM. There are probably more elegant ways to do it than to drop this
> stuff into TopMemoryContext, but this is surely better than unchecked
> malloc calls.

Yea, it's certainly better than the current situation. An incremental
improvement would be to do the allocations in a separate contect, for easier
debugging should there ever be a leak...

- Andres

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Michael Paquier 2020-01-07 06:39:07 Re: BUG #16122: segfault pg_detoast_datum (datum=0x0) at fmgr.c:1833 numrange query
Previous Message Tom Lane 2020-01-07 02:12:05 Re: BUG #16190: The usage of NULL pointer in refint.c