Re: PLTCL return_null crash...

Поиск
Список
Период
Сортировка
От Joe Conway
Тема Re: PLTCL return_null crash...
Дата
Msg-id 3DA273F2.9020203@joeconway.com
обсуждение исходный текст
Ответ на Re: PLTCL return_null crash...  ("Nigel J. Andrews" <nandrews@investsystems.co.uk>)
Ответы Re: PLTCL return_null crash...
Список pgsql-general
Tom Lane wrote:
> "Nigel J. Andrews" <nandrews@investsystems.co.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


В списке pgsql-general по дате отправления:

Предыдущее
От: Savita
Дата:
Сообщение: How to find out about index
Следующее
От: "Shridhar Daithankar"
Дата:
Сообщение: Re: How to find out about index