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

R

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 ...

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 said:
::compare(0x143450, 0x0, 0xff000000, 0x274f18, 0x0, 0xb9), at
0xfdb46f14
=>[2] std::operator said:
(lhs = CLASS, rhs = CLASS), line 1685 in "string"
[3]
"functional"
[4]
__rwstd::__rb_tree said:
,std::pair<const
std::basic_string said:
,CMoc*>,__rwstd::__select1st<std::pair<const
std::basic_string said:
,CMoc*>,std::basic_string<char,std::char_traits<char>,std::allocator<char>
std::basic_string said:
,CMoc*> > >::insert(this = 0xdf878, v = STRUCT), line 195 in
"tree.cc"
[5]
std::basic_string said:
,CMoc*> > >::insert(this = 0xdf878, x = STRUCT), line 237 in "map"
[6]
std::basic_string said:
,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 !
 
A

Alf P. Steinbach

* 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
 
W

White Wolf

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top