[Ecls-list] Segmentation fault in c-inline code question

Erik Winkels aerique at xs4all.nl
Tue Dec 16 16:50:31 UTC 2008


This question is deliberately generic, but hopefully not too generic.  For specifics see my earlier question "Segfault when a C++ member tries to load a new library".  (The question's more generic this time since it's not just limited to the loadPlugin member.)

Where should I look for what's causing the problem if a piece of C code within a c-inline form segfaults while the same code works directly from a C program?  In all cases the debugger reports line 108 in the following fragment to be the cuplrit (this if for an ECL compiled with the --with-cxx switch):

    /usr/include/c++/4.3.2/ext/new_allocator.h: 

     46   /**
     47    *  @brief  An allocator that uses global new, as per [20.4].
     48    *
     49    *  This is precisely the allocator defined in the C++ Standard.
     50    *    - all allocation calls operator new
     51    *    - all deallocation calls operator delete
     52    */
     53   template<typename _Tp>
     54     class new_allocator
     55     {
    ...
    104       // _GLIBCXX_RESOLVE_LIB_DEFECTS
    105       // 402. wrong new expression in [some_] allocator::construct
    106       void
    107       construct(pointer __p, const _Tp& __val)
    108       { ::new((void *)__p) _Tp(__val); }

Is this ECL which somehow limits what the external library can do with regards to allocating memory?




More information about the ecl-devel mailing list