Hi Christian,

OK great, thanks for the fix!

Cheers,
Karl


On 25 September 2013 20:45, Christian Delbaere <christian.delbaere@gmail.com> wrote:
Hi Karl,

I believe that what you are seeing is a result of the fix for:

http://sourceforge.net/p/swig/bugs/1301/

Which was indeed fixed in Swig 2.0.11.

Best Regards,

Christian

Hi,

I've come across the following bug in SWIG 2.0.10: given the following files

===== test.i
%module test;

%inline {
  typedef struct tagMyStruct {
    int a;
    double b;
  } MyStruct;
}
=====

===== subclass.py
import test
cls = test.MyStruct

class subcls(cls):
    pass

while 1:
    row = subcls()
=====

the following command runs forever, as expected:

swig -python -o test.c test.i && gcc -g -c -fPIC `python-config --includes` -o test.o test.c && gcc -g -shared test.o -o _test.so && python subclass.py

However, if I add -builtin to the SWIG arguments, Python aborts when running subclass.py with a memory error, specifically:

*** glibc detected *** python: double free or corruption (out): 0x00007f6a3cb4d010 ***

However, this *does* work with SWIG 2.0.11, i.e. Python does not crash. Was this a known bug that was fixed, or a fortuitous coincidence???

Cheers,
Karl


------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60133471&iu=/4140/ostg.clktrk
_______________________________________________
Swig-devel mailing list
Swig-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/swig-devel