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

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: (view raw, whole thread or download thread mbox)
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_INCLUDE = -I/homes/ab374/scratch/postgresql-7.1/include

.PHONY: 3 4



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



$(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

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/' language

create function t5_template_trig() returns opaque as

'/homes/ab374/scratch/devel/test5/' language

create trigger t5ptg1 after insert or delete or update on b1

for each row execute procedure

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,


Get your FREE download of MSN Explorer at

Attachment: unknown_filename
Description: text/html (5.1 KB)
Attachment: t5_pred_general_trig.c
Description: text/plain (1.9 KB)
Attachment: t5_template_trig.c
Description: text/plain (1.5 KB)


pgsql-bugs by date

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

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