Re: Showing debug messages in my C function

From: Jorge Arevalo <jorgearevalo(at)gis4free(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Showing debug messages in my C function
Date: 2010-04-15 18:16:08
Message-ID: p2nd321138e1004151116w314b4109iaa8c9879aba13bdc@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Apr 13, 2010 at 10:04 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Jorge Arevalo <jorgearevalo(at)gis4free(dot)org> writes:
>> I'm sorry, because this may be a simple question: I'm programming a C
>> function that returns a set (PostgreSQL 8.4). The function crash, and
>> I'm trying to
>> debug it. I've read:
>
>> http://www.postgresql.org/docs/8.4/interactive/xfunc-c.html
>> http://www.postgresql.org/docs/8.4/interactive/error-message-reporting.html
>> http://www.postgresql.org/docs/current/static/runtime-config-logging.html
>
>> but I can't see any of my log messages.
>
> Seems likely to me that the function is crashing before it gets to any
> of the elog calls; which would most likely be a problem in linking or in
> declaring the function.  Did you remember to use the
> PG_FUNCTION_INFO_V1() macro?  Try writing a trivial function that only
> does an elog and see what it takes to get that to work.
>
>                        regards, tom lane
>

Yes, I put the PG_FUNCTION_INFO_V1(myFunction) macro.

I solved some small bugs, and I checked the function is called, but I
get a segmentation fault when try to call SRF_IS_FIRSTCALL. I think
this has no much sense, and the problem keeps hidden for another
reason.

I'm going to continue debugging, but if helps, I provide the
interesting part of log file.

Thanks!

Best regards,
Jorge

Attachment Content-Type Size
postgresql-2010-04-15_195917.log application/octet-stream 8.6 KB

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Howard Yeh 2010-04-15 18:22:26 Re: Byte Escape Syntax
Previous Message John R Pierce 2010-04-15 18:03:07 Re: solaris tarballs and pl/java