Re: [SQL] PostgreSQL server terminated by signal 11

From: "D'Arcy J(dot)M(dot) Cain" <darcy(at)druid(dot)net>
To: "Daniel Caune" <daniel(dot)caune(at)ubisoft(dot)com>
Cc: tgl(at)sss(dot)pgh(dot)pa(dot)us, pgsql-admin(at)postgresql(dot)org, pgsql-sql(at)postgresql(dot)org
Subject: Re: [SQL] PostgreSQL server terminated by signal 11
Date: 2006-07-27 23:49:21
Message-ID: 20060727194921.d6389185.darcy@druid.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-sql

On Thu, 27 Jul 2006 19:00:27 -0400
"Daniel Caune" <daniel(dot)caune(at)ubisoft(dot)com> wrote:
> I run the command responsible for creating the index and I entered "continue" in gdb for executing the command. After a while, the server crashes:
>
> Program received signal SIGSEGV, Segmentation fault.
> 0x08079e2a in slot_attisnull ()

That's a pretty small function. I don't see much room for error. This
diff in src/backend/access/common/heaptuple.c seems like the most
likely place to catch it.

RCS file: /cvsroot/pgsql/src/backend/access/common/heaptuple.c,v
retrieving revision 1.110
diff -u -p -u -r1.110 heaptuple.c
--- heaptuple.c 14 Jul 2006 14:52:16 -0000 1.110
+++ heaptuple.c 27 Jul 2006 23:37:54 -0000
@@ -1470,8 +1470,13 @@ slot_getsomeattrs(TupleTableSlot *slot,
bool
slot_attisnull(TupleTableSlot *slot, int attnum)
{
- HeapTuple tuple = slot->tts_tuple;
- TupleDesc tupleDesc = slot->tts_tupleDescriptor;
+ HeapTuple tuple;
+ TupleDesc tupleDesc;
+
+ assert(slot != NULL);
+
+ tuple = slot->tts_tuple;
+ tupleDesc = slot->tts_tupleDescriptor;

/*
* system attributes are handled by heap_attisnull

Of course, you still have to find out what's calling it with slot set
to NULL if that turns out to be the problem. It may also be that slot
is not NULL but set to garbage. You could also add a notice there.
Two, in fact. One to display the address of slot and one to display
the value of slot->tts_tuple or slot->tts_tupleDescriptor. If the
first shows a non NULL value and the second causes your crash that
tells you that the value of slot is probably trashed before
calling the function.

Do this in conjunction with Tom Lanes suggestion of "--enable-debug" for
more information.

--
D'Arcy J.M. Cain <darcy(at)druid(dot)net> | Democracy is three wolves
http://www.druid.net/darcy/ | and a sheep voting on
+1 416 425 1212 (DoD#0082) (eNTP) | what's for dinner.

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Mark Liberman 2006-07-28 01:55:28 Corrupted DB - Help
Previous Message Tom Lane 2006-07-27 23:26:06 Re: [SQL] PostgreSQL server terminated by signal 11

Browse pgsql-sql by date

  From Date Subject
Next Message Daniel CAUNE 2006-07-28 03:53:22 Re: [SQL] PostgreSQL server terminated by signal 11
Previous Message Tom Lane 2006-07-27 23:26:06 Re: [SQL] PostgreSQL server terminated by signal 11