开发者

Why does STL `set` core dump on find() & empty()?

when i want to reach STL lib set::find or empty()... i got core file.

i m using gcc version 4.1.2 20070115 (prerelease) (SUSE Linux), please see the stack flow:

#0  0x00002aaaae7caf2a in _STL::_Rb_t开发者_如何学编程ree<unsigned int, unsigned int,
_STL::_Identity<unsigned int>, _STL::less<unsigned int>,
_STL::allocator<unsigned int> >::empty (this=0x8)
    at /home/irish/nagrun/add-ons/include/stlport/stl/_tree.h:370
#1  0x00002aaaae7caf4f in _STL::set<unsigned int, _STL::less<unsigned int>, _STL::allocator<unsigned int> >::empty (this=0x8)
    at /home/irish/nagrun/add-ons/include/stlport/stl/_set.h:129
#2  0x00002aaaae7ca5d1 in User::deleteSessionID (this=0x0, sessionID=4143972353)
    at /home/irish/nagrun/NIG_SRC/PresenceEx_V100R001C41B010/Extends/UserManager/User.cpp:60

how can this be possible ? i can insert into set and traverse inside it with iterators.


You were correct in the comments: I have been calling functions on User through a null pointer.

I didn't realise this because the stack trace starts deep within the standard library functions, leading me to believe that the problem was with find, rather than with how I was calling it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜