Re: PG 12 beta 1 segfault during analyze

From: ilmari(at)ilmari(dot)org (Dagfinn Ilmari Mannsåker )
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Steve Singer <steve(at)ssinger(dot)info>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL-development Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: PG 12 beta 1 segfault during analyze
Date: 2019-06-19 10:19:39
Message-ID: d8j5zp1yj0k.fsf@dalvik.ping.uio.no
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Andres Freund <andres(at)anarazel(dot)de> writes:

> Hi,
>
> On 2019-06-17 21:46:02 -0400, Steve Singer wrote:
>> On 6/15/19 10:18 PM, Tom Lane wrote:
>> > Steve Singer <steve(at)ssinger(dot)info> writes:
>> > > I encountered the following segfault when running against a PG 12 beta1
>> > > during a analyze against a table.
>> > Nobody else has reported this, so you're going to have to work on
>> > producing a self-contained test case, or else debugging it yourself.
>> >
>> > regards, tom lane
>> >
>> >
>> >
>> The attached patch fixes the issue.
>
> Thanks for the bug report, diagnosis and patch. Pushed.

I was going to suggest trying to prevent similar bugs by declaring these
and other output parameters as `double *const foo` in tableam.h, but
doing that without adding the corresponding `const` in heapam_handler.c
doesn't even raise a warning.

Still, declaring them as *const in both places might serve as an
example/reminder for people writing their own table AMs.

- ilmari
--
"I use RMS as a guide in the same way that a boat captain would use
a lighthouse. It's good to know where it is, but you generally
don't want to find yourself in the same spot." - Tollef Fog Heen

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2019-06-19 10:44:15 Re: [PATCH] Stop ALTER SYSTEM from making bad assumptions
Previous Message Adrien Nayrat 2019-06-19 08:49:23 Re: idea: log_statement_sample_rate - bottom limit for sampling