Hi,
I am facing a problem while running a STL CPP application Compiled
using gcc in Solaris environment.
Following is the code :
#include <set>
{
template <class SerImp>
class Services
{
public:
void Add(SerImp *TOSer)
{
if (TOSer)
m_list.insert(T OSer);
}
void Remove(SerImp *TOSer)
{
m_list.erase(TO Ser);
}
protected:
typedef std::set<SerImp *> SerL;
typedef SerL::iterator SerIter;
SerL m_list;
};
Whenever I try to do "m_list.insert( TOSer)" the application is
giving Segmentation fault.
This is the call stack.
#0 0xfef64ac8 in std::_Rb_tree_d ecrement (__x=0xff35356c )
at /rsft/users/akankari/gcc-3.4.2/libstdc++-v3/src/tree.cc:94
#1 0xff2839a8 in std::_Rb_tree_i terator<R::Base SerImp*>::opera tor--
(this=0xffbef3f 0) at stl_tree.h:195
#2 0xff283434 in std::_Rb_tree<R ::BaseSerImp*, R::BaseSerImp*,
std::_Identity< R::BaseSerImp*> , std::less<R::Ba seSerImp*>,
std::allocator< R::BaseSerImp*> >::insert_uniqu e (this=0xff35356 8,
__v=@0xffbef550 ) at stl_tree.h:877
#3 0xff282f08 in std::set<R::Bas eSerImp*, std::less<R::Ba seSerImp*>,
std::allocator< R::BaseSerImp*> >::insert (this=0xff35356 8,
__x=@0xffbef550 ) at stl_set.h:314
#4 0xff282bf0 in Services<R::Bas eSerImp>::Add (this=0xff35356 8,
TOSer=0x246d8) at Services.h:48
Can anybody suggest what the reason for this Segmentation fault is? We
have to use any special switch while compiling this application because
the same application is working fine in windows?
Thanks,
Vinu
I am facing a problem while running a STL CPP application Compiled
using gcc in Solaris environment.
Following is the code :
#include <set>
{
template <class SerImp>
class Services
{
public:
void Add(SerImp *TOSer)
{
if (TOSer)
m_list.insert(T OSer);
}
void Remove(SerImp *TOSer)
{
m_list.erase(TO Ser);
}
protected:
typedef std::set<SerImp *> SerL;
typedef SerL::iterator SerIter;
SerL m_list;
};
Whenever I try to do "m_list.insert( TOSer)" the application is
giving Segmentation fault.
This is the call stack.
#0 0xfef64ac8 in std::_Rb_tree_d ecrement (__x=0xff35356c )
at /rsft/users/akankari/gcc-3.4.2/libstdc++-v3/src/tree.cc:94
#1 0xff2839a8 in std::_Rb_tree_i terator<R::Base SerImp*>::opera tor--
(this=0xffbef3f 0) at stl_tree.h:195
#2 0xff283434 in std::_Rb_tree<R ::BaseSerImp*, R::BaseSerImp*,
std::_Identity< R::BaseSerImp*> , std::less<R::Ba seSerImp*>,
std::allocator< R::BaseSerImp*> >::insert_uniqu e (this=0xff35356 8,
__v=@0xffbef550 ) at stl_tree.h:877
#3 0xff282f08 in std::set<R::Bas eSerImp*, std::less<R::Ba seSerImp*>,
std::allocator< R::BaseSerImp*> >::insert (this=0xff35356 8,
__x=@0xffbef550 ) at stl_set.h:314
#4 0xff282bf0 in Services<R::Bas eSerImp>::Add (this=0xff35356 8,
TOSer=0x246d8) at Services.h:48
Can anybody suggest what the reason for this Segmentation fault is? We
have to use any special switch while compiling this application because
the same application is working fine in windows?
Thanks,
Vinu
Comment