crash if group doesn't exist (postgres 6.5, linux 2.2.10, rh 6.0)

From: David Sauer <davids(at)orfinet(dot)cz>
To: pgsql-hackers(at)postgresql(dot)org
Subject: crash if group doesn't exist (postgres 6.5, linux 2.2.10, rh 6.0)
Date: 1999-06-21 06:24:32
Message-ID: m2wvwyf4v3.fsf@orfinet.cz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hallo,

I think, that I found reproducible bug:

% sql template1
Welcome to the POSTGRESQL interactive sql monitor:
Please read the file COPYRIGHT for copyright terms of POSTGRESQL
[PostgreSQL 6.5.0 on i586-pc-linux-gnu, compiled by gcc egcs-2.91.66]

type \? for help on slash commands
type \q to quit
type \g or terminate with semicolon to execute query
You are currently connected to the database: template1

template1=> insert into pg_group values ('dummies', 501, '{503}');
INSERT 18784 1
template1=> select * from pg_user where usename = 'dummy';
usename|usesysid|usecreatedb|usetrace|usesuper|usecatupd|passwd |valuntil
-------+--------+-----------+--------+--------+---------+--------+--------
dummy | 503|f |t |f |t |********|
(1 row)

template1=> create table tab ( i int );
CREATE
template1=> \z tab
Database = template1
+----------+--------------------------+
| Relation | Grant/Revoke Permissions |
+----------+--------------------------+
| tab | |
+----------+--------------------------+
template1=> grant all on tab to group dummies;
CHANGE
template1=> \z tab
Database = template1
+----------+----------------------------+
| Relation | Grant/Revoke Permissions |
+----------+----------------------------+
| tab | {"=","group dummies=arwR"} |
+----------+----------------------------+
template1=> delete from pg_group;
DELETE 1
template1=> \z tab
NOTICE: get_groname: group 501 not found
pqReadData() -- backend closed the channel unexpectedly.
This probably means the backend terminated abnormally
before or while processing the request.

And in log is:
PGSQL: NOTICE: get_groname: group 501 not found
PGSQL: NOTICE: Message from PostgreSQL backend:
PGSQL: ^IThe Postmaster has informed me that some other backend died
abnormally and possibly corrupted shared memory.
PGSQL: ^II have rolled back the current transaction and am going to terminate your database system connection and exit.
PGSQL: ^IPlease reconnect to the database system and repeat your query.

This look like that \z causes (if group doesn't more exist) database crash
... and I hate crashes ...
--
* David Sauer, student of Czech Technical University
* electronic mail: davids(at)orfinet(dot)cz (mime compatible)

Browse pgsql-hackers by date

  From Date Subject
Next Message Zeugswetter Andreas IZ5 1999-06-21 07:46:51 AW: [HACKERS] tables > 1 gig
Previous Message Thomas Lockhart 1999-06-21 06:08:35 Building Postgres