Segmentation fault when creating a BRIN, 10beta1

Started by Alexander Sosnaalmost 9 years ago7 messageshackers
Jump to latest
#1Alexander Sosna
alexander.sosna@credativ.de

Hi,

I can reproduce a segmentation fault when creating a BRIN concurrently
with set pages_per_range and autosummarize.

# Reproduce
CREATE TABLE brin_test AS
SELECT
series AS id,
MD5(series::TEXT) AS VALUE,
'2015-10-31 13:37:00.313370+01'::TIMESTAMP + (series::TEXT || '
Minute')::INTERVAL AS TIME
FROM
GENERATE_SERIES(0,10000) AS series;

CREATE INDEX CONCURRENTLY brin_test_time_abrin_8 ON brin_test USING brin
(TIME) WITH (pages_per_range=8, autosummarize=true);

2017-05-30 16:08:59.451 CEST [20689] LOG: server process (PID 20881)
was terminated by signal 11: Segmentation fault
2017-05-30 16:08:59.451 CEST [20689] DETAIL: Failed process was
running: CREATE INDEX CONCURRENTLY brin_test_time_abrin_8 ON brin_test
USING brin (TIME) WITH (pages_per_range=8, autosummarize=true);
2017-05-30 16:08:59.451 CEST [20689] LOG: terminating any other active
server processes
2017-05-30 16:08:59.451 CEST [20806] WARNING: terminating connection
because of crash of another server process
2017-05-30 16:08:59.451 CEST [20806] DETAIL: The postmaster has
commanded this server process to roll back the current transaction and
exit, because another server process exited abnormally and possibly
corrupted shared memory.
2017-05-30 16:08:59.451 CEST [20806] HINT: In a moment you should be
able to reconnect to the database and repeat your command.
2017-05-30 16:08:59.452 CEST [21204] postgres@postgres FATAL: the
database system is in recovery mode

The debian packages where used, version "PostgreSQL 10beta1 on
x86_64-pc-linux-gnu, compiled by gcc (Debian 6.3.0-18) 6.3.0 20170516,
64-bit".
I also tested the latest git commit
d5cb3bab564e0927ffac7c8729eacf181a12dd40 with the same result.
A more detailed log (debug5) can be found attached.

Kind regards,
Alexander Sosna

Attachments:

brin-segfault.logtext/x-log; name=brin-segfault.logDownload
#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Alexander Sosna (#1)
Re: Segmentation fault when creating a BRIN, 10beta1

Alexander Sosna <alexander.sosna@credativ.de> writes:

I can reproduce a segmentation fault when creating a BRIN concurrently
with set pages_per_range and autosummarize.

I wonder if this isn't the same issue reported in
/messages/by-id/20170524063323.29941.46339@wrigleys.postgresql.org

Could you try the patch suggested there?

regards, tom lane

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

#3Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Tom Lane (#2)
Re: Segmentation fault when creating a BRIN, 10beta1

Tom Lane wrote:

Alexander Sosna <alexander.sosna@credativ.de> writes:

I can reproduce a segmentation fault when creating a BRIN concurrently
with set pages_per_range and autosummarize.

I wonder if this isn't the same issue reported in
/messages/by-id/20170524063323.29941.46339@wrigleys.postgresql.org

Could you try the patch suggested there?

With the patch, it crashes immediately for me. Looking into it now.

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

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

#4Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Alexander Sosna (#1)
Re: Segmentation fault when creating a BRIN, 10beta1

Alexander Sosna wrote:

Hi,

I can reproduce a segmentation fault when creating a BRIN concurrently
with set pages_per_range and autosummarize.

Pushed fix just now. Please give it a try. Thanks for testing and
reporting,

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

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

#5Andres Freund
andres@anarazel.de
In reply to: Alvaro Herrera (#4)
Re: Segmentation fault when creating a BRIN, 10beta1

On 2017-05-30 18:21:10 -0400, Alvaro Herrera wrote:

Alexander Sosna wrote:

Hi,

I can reproduce a segmentation fault when creating a BRIN concurrently
with set pages_per_range and autosummarize.

Pushed fix just now. Please give it a try. Thanks for testing and
reporting,

Shouldn't this have been uncovered by a regression test? In other words,
do I understand correctly that the new summarization stuff is largely
not tested by regression tests?

- Andres

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

#6Alexander Sosna
alexander.sosna@credativ.de
In reply to: Alvaro Herrera (#4)
Re: Segmentation fault when creating a BRIN, 10beta1

Alvaro Herrera writes:

I can reproduce a segmentation fault when creating a BRIN concurrently
with set pages_per_range and autosummarize.

Pushed fix just now. Please give it a try. Thanks for testing and
reporting,

Thank you for fixing, works for me.

Regards,
Alexander Sosna

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

#7Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Andres Freund (#5)
Re: Segmentation fault when creating a BRIN, 10beta1

Andres Freund wrote:

On 2017-05-30 18:21:10 -0400, Alvaro Herrera wrote:

Alexander Sosna wrote:

Hi,

I can reproduce a segmentation fault when creating a BRIN concurrently
with set pages_per_range and autosummarize.

Pushed fix just now. Please give it a try. Thanks for testing and
reporting,

Shouldn't this have been uncovered by a regression test? In other words,
do I understand correctly that the new summarization stuff is largely
not tested by regression tests?

You understand correctly and I had the same concern myself upon finding
about the bug. I cannot promise to create one right now but I can do so
after June 12th.

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

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