Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-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: srf-cleartuple.dbg
Description: text/plain (13.4 KB)

In response to

Responses

pgsql-hackers by date

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

pgsql-patches by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group