Re: [HACKERS] freefuncs.c is never called from anywhere!? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] freefuncs.c is never called from anywhere!?
Date
Msg-id 18901.949213971@sss.pgh.pa.us
Whole thread Raw
In response to RE: [HACKERS] freefuncs.c is never called from anywhere!?  ("Hiroshi Inoue" <Inoue@tpf.co.jp>)
Responses RE: [HACKERS] freefuncs.c is never called from anywhere!?
List pgsql-hackers
"Hiroshi Inoue" <Inoue@tpf.co.jp> writes:
> As far as I see,freeObject() has a fundamental problem.
> Probably it couldn't free multiple references safely.

Yes, that code will have a problem with node trees that have
circular references or multiple links to the same node.
Both of which are cases that we can currently generate :-(.

Of course, circular links will also break copyfuncs, equalfuncs,
and printfuncs.  We have a known bug with the backend crashing
when -d is enabled for certain queries, because of infinite
recursion in printfuncs.

For the moment, the only thing I need the freefuncs code for is
to free nodetrees that have been created by stringToNode.  AFAICT
that routine is incapable of creating circular links or multiple
links, so it should work.

Eventually it would be nice to have a better solution.
        regards, tom lane


pgsql-hackers by date:

Previous
From: "Hiroshi Inoue"
Date:
Subject: RE: [HACKERS] freefuncs.c is never called from anywhere!?
Next
From: Adriaan Joubert
Date:
Subject: Re: [HACKERS] Bit strings