Re: PLTCL return_null crash...

From: Joe Conway <mail(at)joeconway(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Nigel J(dot) Andrews" <nandrews(at)investsystems(dot)co(dot)uk>, pgsql-general(at)postgresql(dot)org
Subject: Re: PLTCL return_null crash...
Date: 2002-10-08 05:58:10
Message-ID: 3DA273F2.9020203@joeconway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Tom Lane wrote:
> "Nigel J. Andrews" <nandrews(at)investsystems(dot)co(dot)uk> writes:
>
>>Presumably the fault was removed between 1.48 and 1.49 of src/pl/tcl/pltcl.c
>
>
> But 1.49 is in 7.2.1, which you said you're using?
>

It crashes for me under 7.2.2 and 7.2.3 (but not in 7.3b2). The odd thing is,
even though I compiled --enable-debug, pltcl.so still seems to lack debug symbols:

#0 0x08166774 in pfree (pointer=0x8397450) at mcxt.c:448
#1 0x40028033 in pltcl_func_handler () from /usr/lib/pgsql/pltcl.so
#2 0x40027b8b in pltcl_call_handler () from /usr/lib/pgsql/pltcl.so
#3 0x080c96e0 in ExecMakeFunctionResult (fcache=0x8384728, arguments=0x0,
econtext=0x8384470, isNull=0xbfffebaf "",
isDone=0xbfffebb0) at execQual.c:825

I tried putting a break in pltcl_func_handler, but here's what I get:

Breakpoint 1, 0x40027bea in pltcl_func_handler () from /usr/lib/pgsql/pltcl.so
(gdb) step
Single stepping until exit from function pltcl_func_handler,
which has no line number information.

Any idea wht I can't step through this? In any case, the problem seems to be
in this section of code:

<snip>
if (SPI_finish() != SPI_OK_FINISH)
elog(ERROR, "pltcl: SPI_finish() failed");

UTF_BEGIN;
if (fcinfo->isnull)
retval = (Datum) 0;
else
retval = FunctionCall3(&prodesc->result_in_func,
PointerGetDatum(UTF_U2E(interp->result)),
ObjectIdGetDatum(prodesc->result_in_elem),
Int32GetDatum(-1));
UTF_END;
</snip>

where:

#define UTF_BEGIN do { \
unsigned char *_pltcl_utf_src; \
unsigned char *_pltcl_utf_dst

#define UTF_END if (_pltcl_utf_src!=_pltcl_utf_dst) \
pfree(_pltcl_utf_dst); } while (0)

I was able to step into, and out of, SPI_finish(). The pfree(_pltcl_utf_dst)
seems to be where it is failing.

Joe

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Shridhar Daithankar 2002-10-08 06:02:34 Re: How to find out about index
Previous Message Savita 2002-10-08 05:51:35 How to find out about index