Access violation from palloc, Visual Studio 2005, C-language function

From: "Kevin Flanagan" <kevin-f(at)linkprior(dot)com>
To: "'PostgreSQL-development'" <pgsql-hackers(at)postgresql(dot)org>
Subject: Access violation from palloc, Visual Studio 2005, C-language function
Date: 2010-03-10 00:11:57
Message-ID: 005401cabfe6$4cd82f20$e6888d60$@com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Environment: Windows Vista, PostgreSQL 8.4 (1-click installer), Visual
Studio 2005 sp1.

I have a bare-bones DLL built as per the above, compiling the 'add_one' and
'copytext' samples found at
http://www.postgresql.org/docs/8.4/interactive/xfunc-c.html (version 1
calling convention), compiled as 'C'. I can use 'add_one' just fine from
within SQL, but if I use 'copytext', an access violation occurs as soon as
palloc() is called.

Could anyone suggest what the problem might be?

Failing that, are there any other (creative?) ways to return strings from a
C-language function without using palloc?

Thanks in advance for any leads

Kevin.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2010-03-10 00:26:57 Re: Access violation from palloc, Visual Studio 2005, C-language function
Previous Message Tom Lane 2010-03-09 22:37:04 Re: Core dump running PL/Perl installcheck with bleadperl [PATCH]