Re: C Function causes backend to die in 7.4.3 - Mailing list pgsql-general

From Tom Lane
Subject Re: C Function causes backend to die in 7.4.3
Date
Msg-id 19560.1094135202@sss.pgh.pa.us
Whole thread Raw
In response to C Function causes backend to die in 7.4.3  (Graeme Hinchliffe <graeme.hinchliffe@zeninternet.co.uk>)
List pgsql-general
Graeme Hinchliffe <graeme.hinchliffe@zeninternet.co.uk> writes:

>   HeapTuple rettuple;

>   // Commented out code is here

>   return PointerGetDatum(rettuple);

It surprises you that returning an uninitialized pointer value will
crash the code that tries to use the pointer?

I strongly recommend using a compiler that will warn about uninitialized
values.  If using gcc, you should use -O1 (at least).

I dunno what the original problem was, but maybe you just neglected to
recompile the function against 7.4 headers?  We don't generally
guarantee binary compatibility of user-defined functions across major
releases.

            regards, tom lane

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: zombie primary key lurches out of database to devour the brains of the unwary
Next
From: Jeff Boes
Date:
Subject: Re: Join efficiency