Re: BUG #14668: BRIN open autosummarize=on , database will crash

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>
Cc: digoal(at)126(dot)com, PostgreSQL Bugs <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #14668: BRIN open autosummarize=on , database will crash
Date: 2017-05-30 22:19:55
Message-ID: 20170530221955.cdldd7bz77neabi5@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Thomas Munro wrote:

> I guess brin_free_tuple(lastPageTuple) should only be called if it's
> not NULL, so I guess brin.c lacks an "else" here:
>
> - brin_free_tuple(lastPageTuple);
> + else
> + brin_free_tuple(lastPageTuple);
>
> It doesn't crash for me with that change.

Pushed fix. Actually that's not correct either, because tuples returned
by brinGetTupleForHeapBlock are not supposed to be freed at all since
they are shared buffer items. The correct thing to do there was to
release the buffer lock ...

Thanks for the report and analysis.

--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Michael Paquier 2017-05-30 23:39:55 Re: [PATCH] Fixed malformed error message on malformed SCRAM message.
Previous Message Justin Muise 2017-05-30 17:09:51 Re: BUG #14662: 'has_table_privilege()' function fails with error, "invalid name syntax" when using Japanese symbols