logo       

Re: SWIG+Perl+C free() error and zero pointer on very simple script Bug # 1: msg#00183

programming.swig

Subject: Re: SWIG+Perl+C free() error and zero pointer on very simple script Bug # 1035817

Bryga 66 wrote:
This was submitted as BUG # 1035817 on Sourceforge.
Any insight is greatly appreciated.

We use SWIG to wrap some simple C code into a Perl
Module.

Using the module in a simple script produces an error
like
free(): invalid pointer 0x816c138! Also a string seems to be improperly passed as a zero
pointer to the underlying C code.

To see the problem untar the attached file and execute
the following commands:

$ swig -perl SwigTest.i; $ gcc -D_GNU_SOURCE -I/usr/include
-I/usr/local/include
-I/usr/lib/perl5/5.8.3/i586-linux-thread-multi/CORE -c
SwigTest_wrap.c SwigTest.c; $ gcc -shared SwigTest.o SwigTest_wrap.o -o
swigTest.so;
$ ./SwigTest.pl

The problem occurs under the following Linux
environment
uname -a: i686, SuSE 9.1, kernel 2.6.5-7.108-default,
perl -v: v5.8.3 built for i586-linux-thread-multi,
swig -version: SWIG Version 1.3.21, Compiled with g++
[i686-pc-linux-gnu]

We don't really think it's environment specific as we
have similar problems on Sparc Solaris and with
various recent versions of SWIG and Perl including
Perl 5.8.5 and SWIG 1.3.22


See comments in bug report. Please close #1035734 if it is the same problem.

William
_______________________________________________
Swig maillist - Swig@xxxxxxxxxxxxxxx
http://mailman.cs.uchicago.edu/mailman/listinfo/swig



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise