Re: [BUGS] BUG #14668: BRIN open autosummarize=on , database willcrash - Mailing list pgsql-bugs

From Alvaro Herrera
Subject Re: [BUGS] BUG #14668: BRIN open autosummarize=on , database willcrash
Date
Msg-id 20170530221955.cdldd7bz77neabi5@alvherre.pgsql
Whole thread Raw
In response to Re: [BUGS] BUG #14668: BRIN open autosummarize=on , database will crash  (Thomas Munro <thomas.munro@enterprisedb.com>)
Responses Re: [BUGS] BUG #14668: BRIN open autosummarize=on , database will crash  (Thomas Munro <thomas.munro@enterprisedb.com>)
List 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


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

pgsql-bugs by date:

Previous
From: Justin Muise
Date:
Subject: Re: [BUGS] BUG #14662: 'has_table_privilege()' function fails witherror, "invalid name syntax" when using Japanese symbols
Next
From: Michael Paquier
Date:
Subject: Re: [BUGS] [PATCH] Fixed malformed error message on malformed SCRAM message.