help for the core dump in ::std::map

Discussion in 'C++' started by robeson, Nov 18, 2009.

  1. robeson

    robeson Guest

    Hi ,
    I have a core dump while access std map in sparc solaris ...
    codes like below :
    CItem * getItem(const string& id) { return m_mapItem[id]; }
    m_mapItem defined as below :
    map<string, CItem *> m_mapItem;
    It is single threaded ....
    every time access the map, a core generated ...

    core like below :
    t@9 (l@9) terminated by signal SEGV (no mapping at the fault address)
    0xfdb46f14: compare+0x0010: ld [%o5 - 8], %o2
    Current function is std::eek:perator<
    <char,std::char_traits<char>,std::allocator<char> >
    ....
    [1] std::basic_string<char,std::char_traits<char>,std::allocator<char>
    >::compare(0x143450, 0x0, 0xff000000, 0x274f18, 0x0, 0xb9), at

    0xfdb46f14
    =>[2] std::eek:perator< <char,std::char_traits<char>,std::allocator<char>
    >(lhs = CLASS, rhs = CLASS), line 1685 in "string"

    [3]
    std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char>
    > >::eek:perator()(this = 0xdf895, x = CLASS, y = CLASS), line 166 in

    "functional"
    [4]
    __rwstd::__rb_tree<std::basic_string<char,std::char_traits<char>,std::allocator<char>
    >,std::pair<const

    std::basic_string<char,std::char_traits<char>,std::allocator<char>
    >,CMoc*>,__rwstd::__select1st<std::pair<const

    std::basic_string<char,std::char_traits<char>,std::allocator<char>
    >,CMoc*>,std::basic_string<char,std::char_traits<char>,std::allocator<char>
    >
    >,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char>
    > >,std::allocator<std::pair<const

    std::basic_string<char,std::char_traits<char>,std::allocator<char>
    >,CMoc*> > >::insert(this = 0xdf878, v = STRUCT), line 195 in

    "tree.cc"
    [5]
    std::map<std::basic_string<char,std::char_traits<char>,std::allocator<char>
    >,CMoc*,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char>
    > >,std::allocator<std::pair<const

    std::basic_string<char,std::char_traits<char>,std::allocator<char>
    >,CMoc*> > >::insert(this = 0xdf878, x = STRUCT), line 237 in "map"

    [6]
    std::map<std::basic_string<char,std::char_traits<char>,std::allocator<char>
    >,CMoc*,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char>
    > >,std::allocator<std::pair<const

    std::basic_string<char,std::char_traits<char>,std::allocator<char>
    >,CMoc*> > >::eek:perator[](this = 0xdf878, k = CLASS), line 233 in "map"


    It seems while I use mapX[] , a insert is launched and core ....
    Does anybody have a clue to investigate ?
    Thanks in advance !
    robeson, Nov 18, 2009
    #1
    1. Advertising

  2. * robeson:
    > Hi ,
    > I have a core dump while access std map in sparc solaris ...
    > codes like below :
    > CItem * getItem(const string& id) { return m_mapItem[id]; }
    > m_mapItem defined as below :
    > map<string, CItem *> m_mapItem;
    > It is single threaded ....
    > every time access the map, a core generated ...


    Check the FAQ item on how to post a question about Code That Does Not Work.


    Cheers & hth.,

    - Alf
    Alf P. Steinbach, Nov 18, 2009
    #2
    1. Advertising

  3. Vladimir Jovic, Nov 18, 2009
    #3
  4. robeson

    White Wolf Guest

    robeson wrote:
    [SNIP]
    > It seems while I use mapX[] , a insert is launched and core ....
    > Does anybody have a clue to investigate ?
    > Thanks in advance !


    Start by creating a minimal, compilable and then executable example code
    results in the same crash. Veeery minimal. Preferably one short file,
    no headers, only cpp (implementation). With a main function, otherwise
    it won't link.

    Hint: While preparing that minimal example you will most probably find
    the bug yourself.

    BR, WW
    White Wolf, Nov 19, 2009
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. halfdog
    Replies:
    12
    Views:
    12,417
  2. Replies:
    1
    Views:
    406
    red floyd
    Dec 21, 2008
  3. Thomas J. Gritzan
    Replies:
    6
    Views:
    998
    James Kanze
    Dec 22, 2008
  4. James Kanze
    Replies:
    0
    Views:
    1,983
    James Kanze
    Dec 21, 2008
  5. Jaydeep Chovatia

    core dump in std::list push_back

    Jaydeep Chovatia, Mar 24, 2011, in forum: C++
    Replies:
    9
    Views:
    1,171
    Angus
    Mar 25, 2011
Loading...

Share This Page