kkaempf / swig-issues

Issues from SWIG (testing)
0 stars 0 forks source link

Bug in swig runtime/type query system/code generation #83

Open SwigAtSF opened 11 years ago

SwigAtSF commented 11 years ago

For a thorough explanation see here:

http://thread.gmane.org/gmane.comp.programming.swig/10089/focus=10098

-Matthias

SwigAtSF commented 11 years ago

Logged In: YES user_id=14972 Originator: NO

Was this bug fixed by this recent change?

09/05/2007: wuzzeb (John Lenz)

  • Change r_ltype in typesys.c to store a hashtable instead of a single value. several very subtle bugs were being caused by multiple ltypes being mapped to a single mangled type, mostly when using typedefed template parameters. Now, r_ltype stores a hashtable of possible ltypes, and when generating the type table, all the ltypes are added into the swig_type_info structure.
SwigAtSF commented 11 years ago

Logged In: YES user_id=788099 Originator: YES

I can't tell. I'm on a windows machine without all the cygwin/MinGW machinery so I can't check-out SVN and recompile SWIG to test. However if the test code in the link mentioned above works, the problem is probably gone. If you are on the newest SWIG version I'd by happy to put the testcase into a zip file and send it to you.

SwigAtSF commented 11 years ago

Logged In: YES user_id=14972 Originator: NO

I just tried the "main1.i" example from the first message in the gmane thread and get an essentially identical main1_wrap.cxx generated with 1.3.31 and SVN HEAD - in particular, this line is unchanged:

static swig_type_info _swigt__p_YYY = {"_p_YYY", 0, 0, 0, 0, 0};

So I don't think this is fixed.

If that testcase isn't suitable, feel free to attach a better one to this bug.

SwigAtSF commented 11 years ago

Logged In: YES user_id=788099 Originator: YES

Seems like it is not fixed. The testcase is suitable and causes problems in practice. So the reason of this bug is a different one than the one before. Here I mention a workaround to the problem, but I guess it is not the fix: http://article.gmane.org/gmane.comp.programming.swig/10091 .

Thanks for your efforts!

-Matthias

SwigAtSF commented 11 years ago

Logged In: YES user_id=153408 Originator: NO

Ok, I'll take another look at it

SwigAtSF commented 11 years ago

Logged In: YES user_id=153408 Originator: NO

Ok, I committed (in r9981) a entry for the test suite. It passes with the latest CVS, and I didn't need to change anything... so you should test again, and if it still doesn't work try modifying Examples/test-suite/multi_import_a.i and so on to get the test suite to fail.

Note, _swigt__p_YYY should be empty, because the dependencies are stored the other way around... _p_XXX has entries for both YYY and ZZZ