Skip site navigation (1) Skip section navigation (2)

Ways to crash the backend

From: Michael Bussmann <bus(at)fgan(dot)de>
To: hackers(at)postgreSQL(dot)org
Subject: Ways to crash the backend
Date: 1998-03-28 12:02:33
Message-ID: 19980328130233.41661@goliath.mb.priv (view raw or flat)
Thread:
Lists: pgsql-hackers
Hi there!

Please forgive my affords in making the backend crash (this time postgres
6.3.1), seems I've got too much spare time :-)

a)

SELECT DISTINCT * from x2 UNION SELECT * FROM x2;

crashes the backend and corrupts shmem, so that other connections break
too, if x2 is a view returning NULL values

E.g.:
postgres=> create table x (i int4, j int4);
CREATE
postgres=> create view x2 as select j from x;
CREATE
postgres=> insert into x values (1,2);
INSERT 144128 1
postgres=> insert into x values (3);
INSERT 144129 1
postgres=> insert into x values (NULL,4);
INSERT 144130 1
postgres=> select * from x;
i|j
-+-
1|2
3|
 |4
(3 rows)

postgres=> select distinct * from x2 union select * from x2;
PQexec() -- Request was sent to backend, but backend closed the channel
before responding.
        This probably means the backend terminated abnormally before or
while processing the request.            
(The second x2 can also be other table)


b)
Another way is to remove the table a view is based upon, e.g.

postgres=> create table x (i int);
CREATE
postgres=> create view x2 as select * from x;
CREATE
postgres=> drop table x;
DROP
postgres=> select * from x2;
PQexec() -- Request was sent to backend, but b...

Best regards,
MB

-- 
Michael Bussmann <bus(at)fgan(dot)de> [Tel.: +49 228 9435 211; Fax: +49 228 348953]
"It's still the same old story, a fight for love and glory,
A case of do or die, The world will always welcome lovers, as time goes by."

Responses

pgsql-hackers by date

Next:From: Mattias KregertDate: 1998-03-28 13:05:11
Subject: Modules
Previous:From: Bruce MomjianDate: 1998-03-28 02:13:09
Subject: pgindent on odbc

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group