Crash in STL list destructor 
Author Message
 Crash in STL list destructor

Hi All,
        My problem is as follows: we use instance of class 'list'(STL) in one
of my class. And my process creates and destroys this class which has
an object of list as an attribute during execution.
#include <list>
typedef list<int, allocator> tResCounts;

But, now we have started seeing the problem of my process crashing. On
stack trace analysis using standard tools like gdb and dbx, it shows
that the crash is while
calling destructor of the object of type 'list'. The stack trace looks
this:

Quote:
> ===============================
> (gdb) where
> #0  0x72ff8c in __0fElist7Us6Jallocator_Ferase65Elist7Us6Jallocator_Iiterator ()
> #1  0x72fe24 in __0fElist7Us6Jallocator_Ferase65Elist7Us6Jallocator_IiteratorTB ()
> #2  0x2ef850 in __0oElist7Us6Jallocator_dtv ()
> #3  0x2c1bd0 in __0oOActiveResourcedtv () <=== My class which has a attribute of type list
> #4  0x4f8bbc in __0oNLocalResourcedtv ()
> #5  0x470828 in __0oNLocalNonORResdtv ()
> #6  0x497fb8 in __0fNLocalNonORResQactionDeallocateP6XDeallocateDCHRequestMsgP6MReassignmentP6KActiveCalliTE()
> #7  0x47d38c in __0fNLocalNonORResMeventDeallocP6XDeallocateDCHRequestMsgP6MReassignmentP6KActiveCalliTE ()
> #8  0x606924 in __0fHTtGCallQactionDeallocateP6XDeallocateDCHRequestMsgiTC ()
> #9  0x5f3bc4 in __0fHTtGCallPeventDeallocDCHP6XDeallocateDCHRequestMsg ()
> #10 0x41c65c in __0fLCallMonitorgprocessTtGNonORCallReleaseCP1MsgP6ZTtGNonORCallReleaseCP1Msg ()
> #11 0x36eb58 in __0fLCallMonitorOprocessMessageP6HMessage ()
> #12 0x30562c in __0fLCallMonitorFstartv ()
> #13 0x2ff03c in main ()
> ================================================

This happens as follow: I create object of my calss, which has one of
the  attribute of type 'list'. Now when
I delete myObject, it calls the destructor of my own class  which
while destroying attribute of type 'list' calls
its destructor and it crashes here in the list's destructor. This
crash is occassionally reproducible.

Can you help me on this. Is there a known bug with lists. I am working
on following:

Language: C++;
Product: RogueWave-STL-list
Category: Crash occuring at run time and that too occassionally.
OS: SunOS 5.6 Generic_105181-12 sun4u sparc SUNW,Ultra-2



Thu, 13 May 2004 16:29:54 GMT  
 Crash in STL list destructor
Looks like the crash happens when the allocator frees the memory occupied by
list nodes. This most likely indicates a corrupt heap - somewhere else in
your program you overrun a heap-allocated buffer, or free the same pointer
twice, or something like that.
--
With best wishes,
    Igor Tandetnik

"For every complex problem, there is a solution that is simple, neat, and
wrong." H.L. Mencken


Quote:
> Hi All,
> My problem is as follows: we use instance of class 'list'(STL) in one
> of my class. And my process creates and destroys this class which has
> an object of list as an attribute during execution.
> #include <list>
> typedef list<int, allocator> tResCounts;

> But, now we have started seeing the problem of my process crashing. On
> stack trace analysis using standard tools like gdb and dbx, it shows
> that the crash is while
> calling destructor of the object of type 'list'. The stack trace looks
> this:

> > ===============================
> > (gdb) where
> > #0  0x72ff8c in

__0fElist7Us6Jallocator_Ferase65Elist7Us6Jallocator_Iiterator ()
Quote:
> > #1  0x72fe24 in

__0fElist7Us6Jallocator_Ferase65Elist7Us6Jallocator_IiteratorTB ()
Quote:
> > #2  0x2ef850 in __0oElist7Us6Jallocator_dtv ()
> > #3  0x2c1bd0 in __0oOActiveResourcedtv () <=== My class which has a

attribute of type list
Quote:
> > #4  0x4f8bbc in __0oNLocalResourcedtv ()
> > #5  0x470828 in __0oNLocalNonORResdtv ()
> > #6  0x497fb8 in

__0fNLocalNonORResQactionDeallocateP6XDeallocateDCHRequestMsgP6MReassignment
P6KActiveCalliTE()
Quote:
> > #7  0x47d38c in

__0fNLocalNonORResMeventDeallocP6XDeallocateDCHRequestMsgP6MReassignmentP6KA
ctiveCalliTE ()
Quote:
> > #8  0x606924 in

__0fHTtGCallQactionDeallocateP6XDeallocateDCHRequestMsgiTC ()
Quote:
> > #9  0x5f3bc4 in __0fHTtGCallPeventDeallocDCHP6XDeallocateDCHRequestMsg
()
> > #10 0x41c65c in

__0fLCallMonitorgprocessTtGNonORCallReleaseCP1MsgP6ZTtGNonORCallReleaseCP1Ms
g ()

- Show quoted text -

Quote:
> > #11 0x36eb58 in __0fLCallMonitorOprocessMessageP6HMessage ()
> > #12 0x30562c in __0fLCallMonitorFstartv ()
> > #13 0x2ff03c in main ()
> > ================================================

> This happens as follow: I create object of my calss, which has one of
> the  attribute of type 'list'. Now when
> I delete myObject, it calls the destructor of my own class  which
> while destroying attribute of type 'list' calls
> its destructor and it crashes here in the list's destructor. This
> crash is occassionally reproducible.

> Can you help me on this. Is there a known bug with lists. I am working
> on following:

> Language: C++;
> Product: RogueWave-STL-list
> Category: Crash occuring at run time and that too occassionally.
> OS: SunOS 5.6 Generic_105181-12 sun4u sparc SUNW,Ultra-2



Sat, 15 May 2004 01:26:37 GMT  
 Crash in STL list destructor

Quote:
> Can you help me on this. Is there a known bug with lists.

Not that I know. The chances are it is a bug in your class. Your class does
have to be copy-constructable.
If you are allocating memory using new in the constructor and deleting it in
the destructor then for your class to be bullet-proof, you need to write a
copy constructor and an assignment operator.

Stephen Howe



Sat, 15 May 2004 01:31:23 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. crash stl list on high load

2. STL list: odd behavior (CRASH!)

3. ATL virtual destructor and events causes crash

4. Crash in CComPtr destructor

5. String destructor crashes

6. STL maps, why is destructor called?

7. no Virtual Destructors in STL ??!!?!?!!%#$%

8. how to use STL list ( how to get a element from list)

9. list destructor

10. linked list destructors

11. STL in managed C++ crashing in malloc.c and keeping chars from becoming SBytes

12. ATL-COM DLL crashes when using STL container

 

 
Powered by phpBB® Forum Software