This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

opt6x.exe experienced a segmentation

I get the following error, when compiling my code. Unfortunatelly, I cannot display the code...

INTERNAL ERROR: C:\Program Files\Texas Instruments\C6000 Code Generation Tools 7.0.1\bin\opt6x.exe experienced a segmentation fault while
processing function _ZN2ax7zzFspec4ImplINS0_4PairILh21ENS_9El048_230EEENS1_INS2_ILh20ENS_9El048_120EEENS1_INS2_ILh19ENS_9El048_110EEENS1_INS2_ILh18ENS_9El048_100EEENS1_INS2_ILh17ENS_9El048_080EEENS1_INS2_ILh16ENS_9El048_030EEENS1_INS2_ILh15ENS_9El048_210EEENS1_INS2_ILh14ENS_9El048_170EEENS1_INS2_ILh13ENS_9El048_200EEENS1_INS2_ILh12ENS_9El048_042EEENS1_INS2_ILh11ENS_9El048_161EEENS1_INS2_ILh10ENS_9El048_250EEENS1_INS2_ILh9ENS_9El048_240EEENS1_INS2_ILh8ENS_9El048_220EEENS1_INS2_ILh7ENS_9El048_130EEENS1_INS2_ILh6ENS_9El048_090EEENS1_INS2_ILh5ENS_9El048_070EEENS1_INS2_ILh4ENS_9El048_040EEENS1_INS2_ILh3ENS_9El048_020EEENS1_INS2_ILh2ENS_7DayTimeEEENS1_INS2_ILh1ENS_6SenderEEENS0_4BaseEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEC1Ev file ENS_6SenderEEENS0_4BaseEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE);

I suspect this has somthing to do with some buffer overflow due to the very long name of the function. Has anyone encountered this problem? Is it a known bug? Any workarounds?

Cheers
  • It may or may not have anything to do with the function name;  without a test case, we can't tell.

  • Your code crashed the optimizer so badly it cannot even correctly display the name of the function that is causing the problem.  I'm sorry, but without a reproducible test case, there is nothing we can do.  See this article http://tiexpressdsp.com/index.php/Preprocess_Complex_Source_Code_for_Bug_Submissions for help with creating the test case.

    Thanks and regards,

    -George

     

  • Actually, the name is a properly-mangled EABI identifier.  Use "dem6x --abi-eabi" to get it to demangle correctly.   It is a deeply-instantiated template function named Impl in class ax::zzFspec.

     

  • I used the C6000 cgtools-7.0.1, with options --abi=eabi -o0

    When I turned off the -o0, the compiler spent 30 mins compiling this file, and I canceled the compilation.

    When compiling this project without --abi=eabi, it compiles cleanly, and links for a very long time (over 40 mins), but successfully.

    Unfortunatelly I may not show the original code, and I have not succeeded in creating a sample that causes a segmentation fault.

    The very high linking time is the main reason why I am trying to migrate to eabi.

    Thanks for the replies

  • I finally managed to create a sample, that segfaults the same way

    Minor changes I have noticed, that prevent the segfault:

    1. Removing the namespace surrounding the class Dummy<>

    2. Shrinking TypeWrapperList by 1 element


    #include <cstdio>

    #include <boost/mpl/fold.hpp>
    #include <boost/mpl/placeholders.hpp>
    #include <boost/mpl/vector/vector30.hpp>

    namespace mpl = boost::mpl;
    using namespace mpl::placeholders;
    using namespace std;

    template < char, typename T >
    struct TypeWrapper
    {
    typedef T type;
    };

    class Base
    {
    public:

    void getType()
    {}
    };

    template < class TypeWrapper_, class Base_ >
    class ElemsImpl : public Base_
    {
    typedef typename TypeWrapper_::type T;

    public:

    ElemsImpl();

    ~ElemsImpl();

    using Base_::getType;

    T& getType( TypeWrapper_ )
    {
    return t_;
    }

    T const& getType( TypeWrapper_ ) const
    {
    return t_;
    }

    private:

    T t_;
    };

    template < class TypeWrapper_, class Base_ >
    ElemsImpl<TypeWrapper_,Base_>::ElemsImpl()
    {}

    template < class TypeWrapper_, class Base_ >
    ElemsImpl<TypeWrapper_,Base_>::~ElemsImpl()
    {}

    namespace asdfghjkl { namespace qwertyui {

    template < int I, int J = 1 >
    struct Dummy : Dummy<I+1000,J-1>
    {
    Dummy()
    {
    printf( " %d ", I );
    }
    ~Dummy()
    {
    printf( "~%d ", I );
    }

    void fun()
    {
    printf( "f%d ", I );
    }

    Dummy<I+100,J-1> d;
    };

    template < int I >
    struct Dummy<I,0>
    {
    Dummy()
    {
    printf( " %d ", I );
    }
    ~Dummy()
    {
    printf( "~%d ", I );
    }

    void fun()
    {
    printf( "f%d ", I );
    }
    };

    }}

    using namespace asdfghjkl::qwertyui;

    typedef TypeWrapper<1,Dummy<1> > T1;
    typedef TypeWrapper<2,Dummy<2> > T2;
    typedef TypeWrapper<3,Dummy<3> > T3;
    typedef TypeWrapper<4,Dummy<4> > T4;
    typedef TypeWrapper<5,Dummy<5> > T5;
    typedef TypeWrapper<6,Dummy<6> > T6;
    typedef TypeWrapper<7,Dummy<7> > T7;
    typedef TypeWrapper<8,Dummy<8> > T8;
    typedef TypeWrapper<9,Dummy<9> > T9;
    typedef TypeWrapper<10,Dummy<10> > T10;
    typedef TypeWrapper<11,Dummy<11> > T11;
    typedef TypeWrapper<12,Dummy<12> > T12;
    typedef TypeWrapper<13,Dummy<13> > T13;
    typedef TypeWrapper<14,Dummy<14> > T14;
    typedef TypeWrapper<15,Dummy<15> > T15;
    typedef TypeWrapper<16,Dummy<16> > T16;
    typedef TypeWrapper<17,Dummy<17> > T17;
    typedef TypeWrapper<18,Dummy<18> > T18;
    typedef TypeWrapper<19,Dummy<19> > T19;
    typedef TypeWrapper<20,Dummy<20> > T20;
    typedef TypeWrapper<21,Dummy<21> > T21;
    typedef TypeWrapper<22,Dummy<22> > T22;
    typedef TypeWrapper<23,Dummy<23> > T23;
    typedef TypeWrapper<24,Dummy<24> > T24;
    typedef TypeWrapper<25,Dummy<25> > T25;
    typedef TypeWrapper<26,Dummy<26> > T26;
    typedef TypeWrapper<27,Dummy<27> > T27;
    typedef TypeWrapper<28,Dummy<28> > T28;
    typedef TypeWrapper<29,Dummy<29> > T29;
    typedef TypeWrapper<30,Dummy<30> > T30;

    typedef mpl::vector20< T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16
    , T17, T18, T19
    , T20 // !!!
    // , T21 , T22, T23, T24, T25, T26, T27
    > TypeWrapperList;

    struct Elems : mpl::fold< TypeWrapperList, Base, ElemsImpl<_2,_1> >::type
    {};

    int main()
    {
    Elems e;
    e.getType( T1() ).fun();
    e.getType( T19() ).fun();
    // e.getType( T20() ).fun();
    // e.getType( T27() ).fun();
    }
  • What version of Boost are you using?  Are you sure you're using only options "--abi=eabi -o0"