Triggers cause backend crash

From: "Andras Belokosztolszki" <beland1(at)hotmail(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Cc: beland1(at)hotmail(dot)com
Subject: Triggers cause backend crash
Date: 2001-10-30 13:47:12
Message-ID: F135wrblZz02H67yRLV000163ae@hotmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs




Hi, I have a problem (I wrote about it before, but here is a complete example). When I have two triggers with parameters the backend crashes after a certain sequence of invocations. Attached are two very simple triggers in C (they might contain some unnecessary lines, they are a stripped version of an application I'm working on), how to compile, how to bootstrap, ... how to crash the backend


Postgresql info:

PostgreSQL 7.1.3 on i686-pc-linux-gnu, compiled by GCC 2.95.3

A sample makefile (extract from mine)



SRC3 = t5_pred_general_trig

SRC4 = t5_template_trig

CC = gcc

CC_COMPILE = gcc

CC_INCLUDE = -I/homes/ab374/scratch/postgresql-7.1/include -I/homes/ab374/scratch/postgresql-7.1/src/include

.PHONY: 3 4

3:

$(CC_COMPILE) -c $(CC_INCLUDE) $(SRC3).c

$(CC) -shared -o $(SRC3).so $(SRC3).o

4:

$(CC_COMPILE) -c $(CC_INCLUDE) $(SRC4).c

$(CC) -shared -o $(SRC4).so $(SRC4).o




-- to bootstrap the database:

create table t5_predicate_type (

predname text primary key,

parameter text[],

templatetable text,

notify text[],

version text

);

create table t5tt_b1 (ev_upd boolean, ev_ins boolean, ev_del boolean,

p1 int4, f1 text, o1 int4, g1 text,

p2 int4, f2 text, o2 int4, g2 text,

p3 int4, f3 text, o3 int4, g3 text,

commtable text, commtemplate text, notify text, action text, version text);

create table b1 (a int4, b int4, c int4);

create function t5_pred_general_trig() returns opaque as

'/homes/ab374/scratch/devel/test5/t5_pred_general_trig.so' language 'c';

create function t5_template_trig() returns opaque as

'/homes/ab374/scratch/devel/test5/t5_template_trig.so' language 'c';

create trigger t5ptg1 after insert or delete or update on b1

for each row execute procedure t5_pred_general_trig('t5tt_b1');

create trigger t5t1 AFTER INSERT OR UPDATE on t5tt_b1

FOR EACH ROW EXECUTE PROCEDURE t5_template_trig('b1');


-- to reproduce the crash (enter it in a new psql session):

insert into t5tt_b1 values ('f', 't', 'f', 0,'int4ge', null, null,

2, 'int4eq', null, null, 2, 'int4eq' , null, null, 'temp1', 'p1;p2;p0;', 'andras','d', null);

insert into b1 values (1,2,2);

insert into b1 values (1,2,2);



The crash is deterministic on my machine (I've tried different c compilers, different linux distributions,...)


If you need additional info please write to beland1(at)hotmail(dot)com

Many thanks,

Andras



Get your FREE download of MSN Explorer at http://explorer.msn.com

Attachment Content-Type Size
unknown_filename text/html 5.1 KB
t5_pred_general_trig.c text/plain 1.9 KB
t5_template_trig.c text/plain 1.5 KB

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Bruno Wolff III 2001-10-30 15:06:50 Re: Porting issue with openssl and no /dev/random
Previous Message pgsql-bugs 2001-10-30 10:46:08 Bug #502: Duplicate values in field with type primary key.