segfault during SELECT using && ANY (ARRAY[NULL]::BOX2D).

From: Михаил Денисов <miha(dot)x56(at)gmail(dot)com>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: segfault during SELECT using && ANY (ARRAY[NULL]::BOX2D).
Date: 2019-06-21 06:00:56
Message-ID: CAAYA3GU5_4jufKUGxkTQpS8QvB=0HHP=uJoOUP9wsZVovgkOmg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hello.

i faced with pg crashing in case of use ANY && statement with array with
single null element for field of type BOX2D.

for tests i use postgres+postgis 'as-is' without any tuning after
installation by command:
apt-get install postgresql-9.5 postgresql-9.5-postgis-2.2
(also this error reproduced on production server with pg v11)

error is stable reproduced by following commands:

CREATE DATABASE test_pgcrash;
CREATE EXTENSION postgis;
CREATE TABLE pgcrash (box BOX2D);
INSERT INTO pgcrash (box) values ('BOX(0 0, 1 1)');
SELECT * FROM pgcrash WHERE box && ANY(ARRAY[NULL]::BOX2D[]);

and in postgresql log i see:

2019-06-21 12:45:30 +07 [2268-2] LOG: server process (PID 2311) was
terminated by signal 11: Segmentation fault
2019-06-21 12:45:30 +07 [2268-3] DETAIL: Failed process was running:
CREATE EXTENSION postgis;
CREATE TABLE pgcrash (box BOX2D);
INSERT INTO pgcrash (box) values ('BOX(0 0, 1 1)');
SELECT * FROM pgcrash WHERE box && ANY(ARRAY[NULL]::BOX2D[]);
2019-06-21 12:45:30 +07 [2268-4] LOG: terminating any other active server
processes
2019-06-21 12:45:30 +07 [2275-2] WARNING: terminating connection because
of crash of another server process

thanks,
best regards, mikhail.

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Rozboril, Robert 2019-06-21 06:13:14 RE: PostgreSQL v11.3 - Records are deleted from child table if partition key of parent table is changed
Previous Message Steve Komarov 2019-06-21 02:41:35 Function pg_database_size fails with "Permission denied" on a corrupted fsm file