server process segfaulting - Mailing list pgsql-general

From James Gregory
Subject server process segfaulting
Date
Msg-id 1052902703.6429.50.camel@pirate.bridge.anchor.net.au
Whole thread Raw
Responses Re: server process segfaulting  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
Hi all,

I have a bit of a problem I need some help with. I have a piece of
software (a web thing) that uses postgresql, and there is a particular
piece of code in it which seems to crash the postgres server with
SIGSEGV. The logs are below.

So first of all, are there any common gotchas that make postgres crash
that I'm not aware of?

The logs from the point where it is dying are below. The last queries
before the segfault are coming from a trigger I wrote in plpython to do
referential integrity checking for inherited tables (I posted about it
before writing said code).

Which leads me to believe that this is probably a problem with plpython.
So does anyone know anything about plpython and segfaults?

Next qn. I found this:


http://snaga.org/pgsql/cvsweb.cgi/pgsql/src/pl/plpython/TODO?rev=1.1.1.1&content-type=text/x-cvsweb-markup&hideattic=0&only_with_tag=DT0_0

In point 3 it seems to suggest that if the schema of any of the tables
change, then the plpython functions will need to be recreated. It
doesn't actually say whether or not "making postgres unhappy" ==
segfault. I would like to try this and see if it will fix my problem,
but I'm more than a little concerned about postgres removing all my
triggers if I drop the function. Will postgres drop the triggers? If it
does is there an easy way to what that document is suggesting and
rebuild the triggers as I go?

And ultimately, if plpython can't be made to work for this task, what's
the best way forward? I had a quick look at the plpython source and I
don't think it's something I'll be able to hack on in the short term. Am
I better off writing a C module to do what I need to do?

Any feedback much appreciated.

oh, and

 PostgreSQL 7.3.2 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 3.2.2
(Mandrake Linux 9.1 3.2.2-3mdk)

from

$ rpm -q postgresql postgresql-server postgresql-contrib
postgresql-7.3.2-5mdk
postgresql-server-7.3.2-5mdk
postgresql-contrib-7.3.2-5mdk

Thanks,

James.


The log:

May 14 18:11:31 pirate postgres[11599]: [43] NOTICE:  ('running foreign
key check',)
May 14 18:11:31 pirate postgres[11599]: [44] LOG:  query: select * from
referential_constraint where foreign_key ilike $1
May 14 18:11:31 pirate postgres[11599]: [45] LOG:  query: select
count(*) as count from "domain" where "id" = $1
May 14 18:11:31 pirate postgres[11421]: [7] LOG:  server process (pid
11599) was terminated by signal 11
May 14 18:11:31 pirate postgres[11421]: [8] LOG:  terminating any other
active server processes
May 14 18:11:31 pirate postgres[11421]: [9] LOG:  all server processes
terminated; reinitializing shared memory and semaphores
May 14 18:11:31 pirate postgres[11600]: [10] LOG:  database system was
interrupted at 2003-05-14 18:02:23 EST
May 14 18:11:31 pirate postgres[11600]: [11] LOG:  checkpoint record is
at 0/345728C
May 14 18:11:31 pirate postgres[11600]: [12] LOG:  redo record is at
0/345728C; undo record is at 0/0; shutdown TRUE
May 14 18:11:31 pirate postgres[11600]: [13] LOG:  next transaction id:
55444; next oid: 157552
May 14 18:11:31 pirate postgres[11600]: [14] LOG:  database system was
not properly shut down; automatic recovery in progress
May 14 18:11:32 pirate postgres[11600]: [15] LOG:  redo starts at
0/34572CC
May 14 18:11:32 pirate postgres[11600]: [16] LOG:  ReadRecord: record
with zero length at 0/345F590
May 14 18:11:32 pirate postgres[11600]: [17] LOG:  redo done at
0/345F4DC
May 14 18:11:34 pirate postgres[11600]: [18] LOG:  database system is
ready



pgsql-general by date:

Previous
From: Joseph Shraibman
Date:
Subject: Re: fomatting an interval (resend)
Next
From: Manfred Koizar
Date:
Subject: Re: Serialization, Locking...implement processing Queue with a table