Access violation from palloc, Visual Studio 2005, C-language function - Mailing list pgsql-hackers

From Kevin Flanagan
Subject Access violation from palloc, Visual Studio 2005, C-language function
Date
Msg-id 005401cabfe6$4cd82f20$e6888d60$@com
Whole thread Raw
In response to Re: Core dump running PL/Perl installcheck with bleadperl [PATCH]  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Access violation from palloc, Visual Studio 2005, C-language function
List 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.




pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Core dump running PL/Perl installcheck with bleadperl [PATCH]
Next
From: Tom Lane
Date:
Subject: Re: Access violation from palloc, Visual Studio 2005, C-language function