Re: [HACKERS] PL compile warning messages - Mailing list pgsql-hackers

From jwieck@debis.com (Jan Wieck)
Subject Re: [HACKERS] PL compile warning messages
Date
Msg-id m0zRkEY-000EBRC@orion.SAPserv.Hamburg.dsh.de
Whole thread Raw
In response to PL compile warning messages  (Brook Milligan <brook@trillium.NMSU.Edu>)
Responses Re: [HACKERS] PL compile warning messages  (Bruce Momjian <maillist@candle.pha.pa.us>)
List pgsql-hackers
>
> With the new PL code in pl/tcl I am getting a bunch of warnings like
> the following:
>
>    pltcl.c:443: warning: variable `prodesc' might be clobbered by `longjmp' or `vfork'
>
> I have never seen this before in any of my programming.  What do they
> mean?  Is anyone else seeing these?  Does it matter?
>
> Cheers,
> Brook
>
>

    I get them too and don't know exactly what they mean. I think
    gcc is just  telling  that  after  returning  to  the  setjmp
    location  via  longjmp  the  variable  might not contain what
    there was before (the longjmp  mechanism  only  restores  the
    stack pointers, not the variable contents on the stack).

    But  the  longjmp's  are  there  only  to  clean up the Tcl's
    interpreter  nesting  and  allocations  in  the  case  of  an
    elog(ERROR) before really jumping back into the postgres main
    loop. Tcl doesn't allocate via  palloc,  so  there  would  be
    memory  allocations  never  free'd  otherwise.  The mentioned
    variables aren't accessed after the longjumping session began
    (it's  really a longjmp party if Tcl triggers use in turn Tcl
    functions where the queries invoke  other  functions/triggers
    and so on :-).

    Since  PL/Tcl  is  designed  to  be used as trigger language,
    raising errors with elog would be  a  normal  operation  from
    inside of PL/Tcl.

    Nothing I tested so far is really broken. I assume it doesn't
    really matter.


Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#======================================== jwieck@debis.com (Jan Wieck) #

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [HACKERS] Open 6.4 items
Next
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] dynamic libraries