Re: SRF memory mgmt patch (was [HACKERS] Concern about

From: Joe Conway <mail(at)joeconway(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL Patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: SRF memory mgmt patch (was [HACKERS] Concern about
Date: 2002-08-30 04:29:49
Message-ID: 3D6EF4BD.8060908@joeconway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Tom Lane wrote:
> First let's see if we can figure out why the code is failing to fail
> as it stands. The fact that it's not dumping core says there's
> something we don't understand yet ...

I'm not sure if the attached will help figure it out, but at the very
least it was eye-opening for me. I ran a test on
dblink_get_pkey('foobar') that returns 5 rows. I had a breakpoint set in
ExecClearTuple. I found that ExecClearTuple was called a total of 32
times for 5 returned rows!

Relevant to this discussion was that ExecClearTuple was called three
times, with the same slot pointer, for each function call to
dblink_get_pkey. Once in SRF_PERCALL_SETUP (per_MultiFuncCall), once in
TupleGetDatum (ExecStoreTuple), and once in FunctionNext in the loop
that builds the tuplestore.

Unfortunately I have not been able to get back to a point where I see a
coredump :(. But, that did seem to be related to calling the function
with an inappropriate declaration (now it just gives me garbage instead
of dumping core, even though I reverted the per_MultiFuncCall changes I
made earlier). I'll keep messing with this for a while, but I was hoping
the attached info would lead to some more suggestions of where to be
looking.

Thanks,

Joe

Attachment Content-Type Size
srf-cleartuple.dbg text/plain 13.4 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2002-08-30 04:42:00 Re: @(#)Mordred Labs advisory 0x0007: Remove DoS in PostgreSQL
Previous Message Tom Lane 2002-08-30 04:25:29 Re: [7.3devl] Using PGPASSWORDFILE with psql requires -U

Browse pgsql-patches by date

  From Date Subject
Next Message Neil Conway 2002-08-30 04:55:50 Re: revised patch for PL/PgSQL table functions
Previous Message Joe Conway 2002-08-30 01:29:45 Re: SRF memory mgmt patch