fmgr_info_cxt_security() screwing memory ?

From: Luis Vargas <Luis(dot)Vargas(at)cl(dot)cam(dot)ac(dot)uk>
To: pgsql-hackers(at)postgresql(dot)org
Subject: fmgr_info_cxt_security() screwing memory ?
Date: 2007-10-12 20:56:17
Message-ID: Prayer.1.0.18.0710122156170.27553@hermes-2.csi.cam.ac.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi, I'm calling an arbitrary user-defined function from the backend.
Although I can do it via FunctionCallInvoke, I have a weird problem when
calling fmgr_info. The call results in a argument variable (eventType)
being cleared. A gdb hardware watch says that the variable is modified by
fmgr_info_cxt_security (fmgr.c:185): "finfo->fn_extra = NULL"; Any ideas of
what is happening?

For simplicity, in the following snippet I have hardcoded foid to some
(PGPSQL) function id and removed the rest of the call-related statements.

static void execEventTypeFunc(char *eventType, Oid funcId)
{
FmgrInfo *finfo;
FunctionCallInfoData fcinfo;
Datum result;
Oid foid = 17283;

finfo = (FmgrInfo *) palloc0(sizeof(FmgrInfo));

fmgr_info(foid, finfo);

...
}

Thanks,

Luis Vargas

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2007-10-12 22:07:29 Re: fmgr_info_cxt_security() screwing memory ?
Previous Message Brendan Jurd 2007-10-12 19:28:39 Re: [HACKERS] quote_literal with NULL