Operating System - HP-UX
1751847 Members
5097 Online
108782 Solutions
New Discussion юеВ

Re: using operator= on value field of type std::string of std::map causes segmentation fault

 
Dennis Handly
Acclaimed Contributor

Re: using operator= on value field of type std::string of std::map causes segmentation fault

>see attached the gdb commands results.

Your thread stack usage is too small for stack overflow:
p $sp - $sp_save >>= 11104

You seem to have a null pointer where you are trying to change the color of a parent of a parent node to RED:
0xc000000018d64a00:2 <_C_insert+0xb02>: adds r8=8,r56;; parent
0xc000000018d64a10:0 <_C_insert+0xb10>: ld8 r55=[r8];;
0xc000000018d64a10:1 <_C_insert+0xb11>: mov r8=r55
0xc000000018d64a10:2 <_C_insert+0xb12>: mov r9=1;; BLACK
0xc000000018d64a20:0 <_C_insert+0xb20>: st4 [r8]=r9
0xc000000018d64a20:1 <_C_insert+0xb21>: mov r54=r39;;
0xc000000018d64a20:2 <_C_insert+0xb22>: adds r8=8,r54;; parent
0xc000000018d64a30:0 <_C_insert+0xb30>: ld8 r53=[r8]
0xc000000018d64a30:2 <_C_insert+0xb32>: adds r8=8,r53;; parent
0xc000000018d64a40:0 <_C_insert+0xb40>: ld8 r52=[r8]
0xc000000018d64a40:2 <_C_insert+0xb42>: mov r8=r52;; NULL
0xc000000018d64a50:0 <_C_insert+0xb50>: st4 [r8]=r0 << RED

Somehow your rbtree has been corrupted.
I assume you know that multiple threads can't be accessing the map if one is modifying it?
codeshark
Occasional Advisor

Re: using operator= on value field of type std::string of std::map causes segmentation fault

hi,

tanx a lot. i reviewed the many lines of code and i think there is a shared memory access problem. it's still not confirmed 100% but some maps and other objects that crashes occurred when accessing them seem to not be protected.

i have to say that the same code / process runs on Solaris without crashing. of course if the code is not safe it needs to be fixed, but maybe Solaris "Tolerates" this not safe code better.

BTW how RU converting (or know the meaning) the stack prints to the words: parent, BLACK, RED, NULL, '<', etc... ?

BR,
Amit.
Dennis Handly
Acclaimed Contributor

Re: using operator= on value field of type std::string of std::map causes segmentation fault

>how are you converting (or know the meaning) the stack prints to the words: parent, BLACK, RED, NULL, etc...?

I look at the assembly and match it up to the source. The abort location is in the ip or $pc register.