Menu

#983 Wrapping Intel IPP headers generates assertion.

None
closed-fixed
nobody
5
2023-04-20
2009-01-27
No

%swig% -tcl8 -c++ -debug-template -o Ipp.cpp Ipp.i
Ipp.h(211): Warning(451): Setting a const char * variable may leak memory.
Ipp.h(212): Warning(451): Setting a const char * variable may leak memory.
Ipp.h(213): Warning(451): Setting a const char * variable may leak memory.
Bad template type passed to SwigType_remember: a((1 << 2)).int
Assertion failed: 0, file Swig/typesys.c, line 1492
================================
Attached IPP.h is pre-processor-generated. I was getting identical error trying to SWIG the Intel headers directly, and thought it might be due to Intel's use of lots of macros to define the interfaces, so I used the pre-processor to generate a macro-free file (rather large).

SWIGging the new file generates the same error. Zip file contains all needed stuff to recreate the error....

Downloaded V1.37 to see if fixed, but same error.

Discussion

  • Karl C. Hansen

    Karl C. Hansen - 2009-01-27

    Zip-file for recreating the error....

     
  • William Fulton

    William Fulton - 2009-01-29

    SWIG is choking on the bitshift operator within arrays. A workaround for now is to comment out the following 3 lines and SWIG will no longer abort:

    int pLfeTagSel[(1<<2)];
    int pDataTagSel[(1<<3)];
    Ipp8s pComFieldData[(1<<8)];

    or add the following ignores before the %include "Ipp.h":

    %ignore pLfeTagSel;
    %ignore pDataTagSel;
    %ignore pComFieldData;

     
  • Karl C. Hansen

    Karl C. Hansen - 2009-02-24

    Thanks!

     
  • Olly Betts

    Olly Betts - 2022-02-02

    William's cut down testcase still fails with current git master:

    $ swig -python -module x test.i
    Bad template type passed to SwigType_remember: a((1 << 2)).int
    swig: Swig/typesys.c:1707: SwigType_remember_clientdata: Assertion `0' failed.
    Aborted
    
     
  • Olly Betts

    Olly Betts - 2022-07-26
    • status: open --> closed-fixed
    • Group: -->
     
  • Olly Betts

    Olly Betts - 2022-07-26

    Fixed in git master by 2227dc9e53dfe7aa236523058de139b5b3d5b6cc. Fix should be in SWIG 4.1.0.

     
  • Olly Betts

    Olly Betts - 2022-07-27
    • status: closed-fixed --> open
     
  • Olly Betts

    Olly Betts - 2022-07-27

    The fix broke with Go, and my second attempt to fix this broke with Java and C#, so regrettably I've had to revert this for now.

     
  • Olly Betts

    Olly Betts - 2023-04-20
    • status: open --> closed-fixed
     
  • Olly Betts

    Olly Betts - 2023-04-20

    I failed to fully revert my second attempt, and actually left the first fix in place, just without the testcase, so this really was fixed in SWIG 4.1.0 (and I've just confirmed that the original full example can be processed successfully with currently SWIG git master).

     

Log in to post a comment.