<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: using operator= on value field of type std::string of std::map causes segmentation fault in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/using-operator-on-value-field-of-type-std-string-of-std-map/m-p/4434309#M664110</link>
    <description>see attached the gdb commands i run on the coredump file.</description>
    <pubDate>Mon, 08 Jun 2009 09:31:41 GMT</pubDate>
    <dc:creator>codeshark</dc:creator>
    <dc:date>2009-06-08T09:31:41Z</dc:date>
    <item>
      <title>using operator= on value field of type std::string of std::map causes segmentation fault</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/using-operator-on-value-field-of-type-std-string-of-std-map/m-p/4434305#M664106</link>
      <description>hi All,&lt;BR /&gt;&lt;BR /&gt;i have problem similar to this one, but not exactly the same: &lt;BR /&gt;&lt;A href="http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=1087638" target="_blank"&gt;http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=1087638&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;it's very hard for me to be totally sure or describe all that is going since a lot of code is involved and i get many crashes, but i think i see a pattern to all of the crashes &lt;BR /&gt;and i want to know if UR familiar with this issue. when i use a std::map (C++) with value field of type std::string , when i get the value &lt;BR /&gt;of a certain key in the map and use operator= to assign this found std::string value to another std::string parameter i sometimes get a coredump.&lt;BR /&gt;somehow the memory is reaching some limit sometimes and there is a crash. here's 1 of the coredumps i get:&lt;BR /&gt;#0  0xc00000001dfb61c0:0 in __rw::__string_ref&lt;CHAR&gt;,std::allocator&lt;CHAR&gt; &amp;gt;::__references() const+0x10 ()&lt;BR /&gt;   from /home/lng/RunEnv/bin/libProjectBillingEnhancmentLoaderDll.sl&lt;BR /&gt;#1  0xc00000001dfac000:0 in std::basic_string&lt;CHAR&gt;,std::allocator&lt;CHAR&gt; &amp;gt;::operator=(std::basic_string&lt;CHAR&gt;,std::allocator&lt;CHAR&gt; &amp;gt; const&amp;amp;)+0x60 ()&lt;BR /&gt;   from /home/lng/RunEnv/bin/libProjectBillingEnhancmentLoaderDll.sl&lt;BR /&gt;#2  0xc00000001dfafce0:0 in ProjectBillingEnhancment::GetTaxesNameStringByChargeType(long,Dof::ObjectNumber,BillingInfo const&amp;amp;,std::basic_string&lt;CHAR&gt;,std::allocator&lt;CHAR&gt; &amp;gt;&amp;amp;,std::basic_string&lt;CHAR&gt;,std::allocator&lt;CHAR&gt; &amp;gt;&amp;amp;)+0x430 ()&lt;BR /&gt;   from /home/lng/RunEnv/bin/libProjectBillingEnhancmentLoaderDll.sl&lt;BR /&gt;   &lt;BR /&gt;it doesn't always crash in the same place but i think the source of the memory access / allocation / etc... problems come from what i explained above.&lt;BR /&gt;i've remarked the code that uses this sort of map and the process was ok in most cases (less crashes).&lt;BR /&gt;still i'm getting crashes in other places where this sort of map is used , but also on other places where there isn't a map used.&lt;BR /&gt;could it be that that on HP-UX working with this sort of maps is problematic ? Have U heard of any other issues similiar to that in HP-UX ?   &lt;BR /&gt;i'm using compiler: aCC: HP C/aC++ B3910B A.06.20 [May 13 2008] and OS version: HP-UX B.11.31 &lt;BR /&gt;&lt;BR /&gt;Tanx,&lt;BR /&gt;Amit.&lt;/CHAR&gt;&lt;/CHAR&gt;&lt;/CHAR&gt;&lt;/CHAR&gt;&lt;/CHAR&gt;&lt;/CHAR&gt;&lt;/CHAR&gt;&lt;/CHAR&gt;&lt;/CHAR&gt;&lt;/CHAR&gt;</description>
      <pubDate>Sun, 07 Jun 2009 15:12:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/using-operator-on-value-field-of-type-std-string-of-std-map/m-p/4434305#M664106</guid>
      <dc:creator>codeshark</dc:creator>
      <dc:date>2009-06-07T15:12:20Z</dc:date>
    </item>
    <item>
      <title>Re: using operator= on value field of type std::string of std::map causes segmentation fault</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/using-operator-on-value-field-of-type-std-string-of-std-map/m-p/4434306#M664107</link>
      <description>Are you linking with libpthread?  If so, have you compiled everything with -mt?  You might want to link with -z so it aborts sooner.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;could it be that that on HP-UX working with this sort of maps is problematic? Have you heard of any other issues similar to that in HP-UX?&lt;BR /&gt;&lt;BR /&gt;No.  There was a performance problem with removing items from a map but that was fixed in A.06.20.&lt;BR /&gt;&lt;BR /&gt;Note the latest patch is A.06.22, PHSS_39096, with A.06.23 coming out shortly.</description>
      <pubDate>Sun, 07 Jun 2009 18:15:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/using-operator-on-value-field-of-type-std-string-of-std-map/m-p/4434306#M664107</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2009-06-07T18:15:07Z</dc:date>
    </item>
    <item>
      <title>Re: using operator= on value field of type std::string of std::map causes segmentation fault</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/using-operator-on-value-field-of-type-std-string-of-std-map/m-p/4434307#M664108</link>
      <description>hi,&lt;BR /&gt;&lt;BR /&gt;yes i'm linking with libpthread with -mt and with -z. any other ideas ? do U know of another HP Forum i can try my luck in ?&lt;BR /&gt;&lt;BR /&gt;Tanx,&lt;BR /&gt;Amit.</description>
      <pubDate>Mon, 08 Jun 2009 07:36:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/using-operator-on-value-field-of-type-std-string-of-std-map/m-p/4434307#M664108</guid>
      <dc:creator>codeshark</dc:creator>
      <dc:date>2009-06-08T07:36:33Z</dc:date>
    </item>
    <item>
      <title>Re: using operator= on value field of type std::string of std::map causes segmentation fault</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/using-operator-on-value-field-of-type-std-string-of-std-map/m-p/4434308#M664109</link>
      <description>&amp;gt;linking with libpthread with -mt&lt;BR /&gt;&lt;BR /&gt;I hope you are compiling with -mt too?&lt;BR /&gt;&lt;BR /&gt;&amp;gt;Do you know of another HP Forum I can try my luck in?&lt;BR /&gt;&lt;BR /&gt;No, all roads lead to me, even if you tried the Response Center.  But they would ask you for your application to debug.&lt;BR /&gt;&lt;BR /&gt;Have you checked to see if you have a thread stack overflow?&lt;BR /&gt;In gdb:&lt;BR /&gt;(gdb) bt&lt;BR /&gt;(gdb) info reg&lt;BR /&gt;(gdb) disas $pc-16*8 $pc+16*4&lt;BR /&gt;(gdb) p /x $sp_save - $sp&lt;BR /&gt;(gdb) frame ##&lt;BR /&gt;(Where ## is the frame number of the last function in the thread stack.)&lt;BR /&gt;(gdb) p $sp - $sp_save</description>
      <pubDate>Mon, 08 Jun 2009 08:43:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/using-operator-on-value-field-of-type-std-string-of-std-map/m-p/4434308#M664109</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2009-06-08T08:43:57Z</dc:date>
    </item>
    <item>
      <title>Re: using operator= on value field of type std::string of std::map causes segmentation fault</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/using-operator-on-value-field-of-type-std-string-of-std-map/m-p/4434309#M664110</link>
      <description>see attached the gdb commands i run on the coredump file.</description>
      <pubDate>Mon, 08 Jun 2009 09:31:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/using-operator-on-value-field-of-type-std-string-of-std-map/m-p/4434309#M664110</guid>
      <dc:creator>codeshark</dc:creator>
      <dc:date>2009-06-08T09:31:41Z</dc:date>
    </item>
    <item>
      <title>Re: using operator= on value field of type std::string of std::map causes segmentation fault</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/using-operator-on-value-field-of-type-std-string-of-std-map/m-p/4434310#M664111</link>
      <description>&amp;gt;see attached the gdb commands&lt;BR /&gt;&lt;BR /&gt;Let's try again, I had a typo:&lt;BR /&gt;(gdb) frame 0&lt;BR /&gt;(gdb) bt&lt;BR /&gt;(gdb) info reg&lt;BR /&gt;(gdb) disas $pc-16*8 $pc+16*4&lt;BR /&gt;(gdb) p /x $sp_save = $sp&lt;BR /&gt;(gdb) frame ##&lt;BR /&gt;(Where you replace ## by the (largest) frame number of the thread stack.)&lt;BR /&gt;(gdb) p $sp - $sp_save&lt;BR /&gt;&lt;BR /&gt;If you only get 3 functions in your stack trace, your stack is corrupted.  What version of gdb are you using?</description>
      <pubDate>Mon, 08 Jun 2009 09:45:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/using-operator-on-value-field-of-type-std-string-of-std-map/m-p/4434310#M664111</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2009-06-08T09:45:23Z</dc:date>
    </item>
    <item>
      <title>Re: using operator= on value field of type std::string of std::map causes segmentation fault</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/using-operator-on-value-field-of-type-std-string-of-std-map/m-p/4434311#M664112</link>
      <description>(gdb) p /x $sp_save = $sp&lt;BR /&gt;$1 = 0x9fffffffee3c0a40&lt;BR /&gt;(gdb) p $sp - $sp_save&lt;BR /&gt;$2 = 0&lt;BR /&gt;&lt;BR /&gt;regarding the frame ## it's useless to use it since all of the last calls are the same. there isn't 3 calls but thousands which are all the same. i think it's cause i'm opening the core with correct Exe process (the one it crashed with) but not with the correct .sl (dll file) it crashed with. i need to open the core with the old (original) dll (before i added a fix to the dll). i'll do it later since currently i'm running the same process with the new (fixed) dll file.</description>
      <pubDate>Mon, 08 Jun 2009 09:59:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/using-operator-on-value-field-of-type-std-string-of-std-map/m-p/4434311#M664112</guid>
      <dc:creator>codeshark</dc:creator>
      <dc:date>2009-06-08T09:59:53Z</dc:date>
    </item>
    <item>
      <title>Re: using operator= on value field of type std::string of std::map causes segmentation fault</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/using-operator-on-value-field-of-type-std-string-of-std-map/m-p/4434312#M664113</link>
      <description>forgot the gdb version:&lt;BR /&gt;gdb -version&lt;BR /&gt;HP gdb 5.9 for HP Itanium (32 or 64 bit) and target HP-UX 11.2x.&lt;BR /&gt;Copyright 1986 - 2001 Free Software Foundation, Inc.&lt;BR /&gt;Hewlett-Packard Wildebeest 5.9 (based on GDB) is covered by the&lt;BR /&gt;GNU General Public License. Type "show copying" to see the conditions to&lt;BR /&gt;change it and/or distribute copies. Type "show warranty" for warranty/support.</description>
      <pubDate>Mon, 08 Jun 2009 10:02:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/using-operator-on-value-field-of-type-std-string-of-std-map/m-p/4434312#M664113</guid>
      <dc:creator>codeshark</dc:creator>
      <dc:date>2009-06-08T10:02:33Z</dc:date>
    </item>
    <item>
      <title>Re: using operator= on value field of type std::string of std::map causes segmentation fault</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/using-operator-on-value-field-of-type-std-string-of-std-map/m-p/4434313#M664114</link>
      <description>(gdb) p /x $sp_save = $sp $1 = 0x9fffffffee3c0a40&lt;BR /&gt;(gdb) p $sp - $sp_save $2 = 0&lt;BR /&gt;&lt;BR /&gt;You didn't use the frame command so this is useless.  You must take the difference between the $sp of the aborting frame and the first (last listed) frame to get an idea of the thread stack size.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;regarding the frame # it's useless to use it since all of the last calls are the same.&lt;BR /&gt;&lt;BR /&gt;I want the frame number of the first frame in the thread stack, or main in the main thread.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;there isn't 3 calls but thousands which are all the same. I think it's cause I'm opening the core with correct Exe process but not with the correct .sl&lt;BR /&gt;&lt;BR /&gt;You MUST debug core files on the original system (or use packcore to copy), with the original shlibs.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;I need to open the core with the original shlib.&lt;BR /&gt;&lt;BR /&gt;Yes, you can't change anything or the stack trace is useless.</description>
      <pubDate>Mon, 08 Jun 2009 10:11:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/using-operator-on-value-field-of-type-std-string-of-std-map/m-p/4434313#M664114</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2009-06-08T10:11:59Z</dc:date>
    </item>
    <item>
      <title>Re: using operator= on value field of type std::string of std::map causes segmentation fault</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/using-operator-on-value-field-of-type-std-string-of-std-map/m-p/4434314#M664115</link>
      <description>hi,&lt;BR /&gt;&lt;BR /&gt;ok now i think it's ok. i used the old (original) dll file when i opened the coredump.&lt;BR /&gt;see attached the gdb commands results.&lt;BR /&gt;&lt;BR /&gt;Amit.</description>
      <pubDate>Mon, 08 Jun 2009 10:55:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/using-operator-on-value-field-of-type-std-string-of-std-map/m-p/4434314#M664115</guid>
      <dc:creator>codeshark</dc:creator>
      <dc:date>2009-06-08T10:55:06Z</dc:date>
    </item>
    <item>
      <title>Re: using operator= on value field of type std::string of std::map causes segmentation fault</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/using-operator-on-value-field-of-type-std-string-of-std-map/m-p/4434315#M664116</link>
      <description>&amp;gt;see attached the gdb commands results.&lt;BR /&gt;&lt;BR /&gt;Your thread stack usage is too small for stack overflow:&lt;BR /&gt;p $sp - $sp_save  &amp;gt;&amp;gt;= 11104&lt;BR /&gt;&lt;BR /&gt;You seem to have a null pointer where you are trying to change the color of a parent of a parent node to RED:&lt;BR /&gt;0xc000000018d64a00:2 &amp;lt;_C_insert+0xb02&amp;gt;:           adds             r8=8,r56;; parent&lt;BR /&gt;0xc000000018d64a10:0 &amp;lt;_C_insert+0xb10&amp;gt;:           ld8              r55=[r8];;&lt;BR /&gt;0xc000000018d64a10:1 &amp;lt;_C_insert+0xb11&amp;gt;:           mov              r8=r55&lt;BR /&gt;0xc000000018d64a10:2 &amp;lt;_C_insert+0xb12&amp;gt;:           mov              r9=1;;  BLACK&lt;BR /&gt;0xc000000018d64a20:0 &amp;lt;_C_insert+0xb20&amp;gt;:           st4              [r8]=r9&lt;BR /&gt;0xc000000018d64a20:1 &amp;lt;_C_insert+0xb21&amp;gt;:           mov              r54=r39;;&lt;BR /&gt;0xc000000018d64a20:2 &amp;lt;_C_insert+0xb22&amp;gt;:           adds             r8=8,r54;;  parent&lt;BR /&gt;0xc000000018d64a30:0 &amp;lt;_C_insert+0xb30&amp;gt;:           ld8              r53=[r8]&lt;BR /&gt;0xc000000018d64a30:2 &amp;lt;_C_insert+0xb32&amp;gt;:           adds             r8=8,r53;;  parent&lt;BR /&gt;0xc000000018d64a40:0 &amp;lt;_C_insert+0xb40&amp;gt;:           ld8              r52=[r8]&lt;BR /&gt;0xc000000018d64a40:2 &amp;lt;_C_insert+0xb42&amp;gt;:           mov              r8=r52;;   NULL&lt;BR /&gt;0xc000000018d64a50:0 &amp;lt;_C_insert+0xb50&amp;gt;:           st4              [r8]=r0 &amp;lt;&amp;lt; RED&lt;BR /&gt;&lt;BR /&gt;Somehow your rbtree has been corrupted.&lt;BR /&gt;I assume you know that multiple threads can't be accessing the map if one is modifying it?</description>
      <pubDate>Tue, 09 Jun 2009 01:54:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/using-operator-on-value-field-of-type-std-string-of-std-map/m-p/4434315#M664116</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2009-06-09T01:54:59Z</dc:date>
    </item>
    <item>
      <title>Re: using operator= on value field of type std::string of std::map causes segmentation fault</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/using-operator-on-value-field-of-type-std-string-of-std-map/m-p/4434316#M664117</link>
      <description>hi,&lt;BR /&gt;&lt;BR /&gt;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.&lt;BR /&gt;&lt;BR /&gt;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. &lt;BR /&gt;&lt;BR /&gt;BTW how RU converting (or know the meaning) the stack prints to the words: parent, BLACK, RED, NULL, '&amp;lt;', etc... ?&lt;BR /&gt;&lt;BR /&gt;BR,&lt;BR /&gt;Amit.</description>
      <pubDate>Tue, 09 Jun 2009 05:25:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/using-operator-on-value-field-of-type-std-string-of-std-map/m-p/4434316#M664117</guid>
      <dc:creator>codeshark</dc:creator>
      <dc:date>2009-06-09T05:25:58Z</dc:date>
    </item>
    <item>
      <title>Re: using operator= on value field of type std::string of std::map causes segmentation fault</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/using-operator-on-value-field-of-type-std-string-of-std-map/m-p/4434317#M664118</link>
      <description>&amp;gt;how are you converting (or know the meaning) the stack prints to the words: parent, BLACK, RED, NULL, etc...?&lt;BR /&gt;&lt;BR /&gt;I look at the assembly and match it up to the source.  The abort location is in the ip or $pc register.</description>
      <pubDate>Tue, 09 Jun 2009 10:23:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/using-operator-on-value-field-of-type-std-string-of-std-map/m-p/4434317#M664118</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2009-06-09T10:23:18Z</dc:date>
    </item>
  </channel>
</rss>

