<?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: Core Dump with multi-threaded application... in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/core-dump-with-multi-threaded-application/m-p/3938242#M97732</link>
    <description>&amp;gt;&amp;gt;(I hope you were given all of the user's shlibs? See gdb's packcore command.)&lt;BR /&gt;&lt;BR /&gt;&amp;gt;I am analyzing the core file on my test machine where it works fine. So its for sure has all the shlib files.&lt;BR /&gt;&lt;BR /&gt;That's not what I mean.  You must have an EXACT copy of every shlib your customer has.  Including libc, etc.  It is easier for your customer to just give you what they have with packcore, rather than play guessing games.  That may be why your stack traces aren't complete.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;&amp;gt;You could look at stack traces for the other threads to see if they are fiddling with NIS_PWDIR_&lt;BR /&gt;&lt;BR /&gt;&amp;gt;forgive my ignorance, but how do I do that?&lt;BR /&gt;&lt;BR /&gt;To dump all threads in gdb:&lt;BR /&gt;(gdb) info thread &lt;BR /&gt;(gdb) thread apply all bt&lt;BR /&gt;&lt;BR /&gt;Then look at the functions in each trace to see where they all are.  See if there is a pattern the next time it happens.  See if any function is accessing any variables near in memory to NIS_PWDIR_.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;&amp;gt;to see if there is a pattern for that $ nm -pxv HpuxAgent&lt;BR /&gt;&lt;BR /&gt;This gives the mangled names of variables in memory order.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;nothing like pattern of zero&lt;BR /&gt;&amp;gt;Attached is the dump of raw memory...&lt;BR /&gt;&lt;BR /&gt;There are a bunch of variables that are 0.  If they are strings, they are also bad:&lt;BR /&gt;0x40001404 0x00000000 0x00000000      0x00000000&lt;BR /&gt;0x40001410 &amp;lt;_ZN7Context8DEV_PTS_E&amp;gt;:     0x00000000 0x0 0x0 0x0&lt;BR /&gt;0x40001420 &amp;lt;_ZN7Context5PROC_E&amp;gt;:        0x00000000 0x0 0x0 0x0&lt;BR /&gt;0x40001430 &amp;lt;_ZN7Context9USR_SBIN_E&amp;gt;:    0x00000000 0x0 0x0 0x0&lt;BR /&gt;0x40001440 &amp;lt;_ZN7Context8VAR_RUN_E&amp;gt;:     0x00000000  0x0 0x0 0x0&lt;BR /&gt;0x40001450 &amp;lt;_ZN7Context9CRON_DENYE&amp;gt;:    0x00000000 0x0 0x0 0x0&lt;BR /&gt;0x40001460 &amp;lt;_ZN7Context8CHPWDAGEE&amp;gt;:     0x00000000 0x0 0x0 0x0&lt;BR /&gt;0x40001470 &amp;lt;_ZN7Context11SYSLOG_CONFE&amp;gt;: 0x00000000 0x0 0x0 0x0&lt;BR /&gt;0x40001480 &amp;lt;_ZN7Context4GREPE&amp;gt;: 0x00000000      0x0 0x0 0x0&lt;BR /&gt;0x40001490 &amp;lt;_ZN7Context7USERMODE&amp;gt;:      0x00000000 0x0 0x0 0x0&lt;BR /&gt;0x400014a0 &amp;lt;_ZN7Context22NISMAP_NETGROUP_BYUSERE&amp;gt;:      0x00000000 0x0 0x0 0x0&lt;BR /&gt;&lt;BR /&gt;Then your variable and 2 more words of 0:&lt;BR /&gt;0x400014b0 &amp;lt;_ZN7Context10NIS_PWDIR_E&amp;gt;:  0x00000000 0x0 0x0 0xffff0112&lt;BR /&gt;&lt;BR /&gt;(If there are other variables in this area, they aren't listed if static or they don't start on the first address of each line.  You need to match up with the nm(1) output.)&lt;BR /&gt;&lt;BR /&gt;&amp;gt;Is there something specific to that machine I should look for?&lt;BR /&gt;&lt;BR /&gt;Nothing is obvious, you'll set it when you find it.  ;-)  (How many CPUs?)&lt;BR /&gt;&lt;BR /&gt;&amp;gt;So how come they got zeroed on the customer machine.&lt;BR /&gt;&lt;BR /&gt;A bad pointer?  Something wasn't locking a critical resource like a pointer?&lt;BR /&gt;&lt;BR /&gt;&amp;gt;As I mentioned earlier, when we had similar problem earlier, we had to rebuilt ICU lib files as they were built with older gcc.&lt;BR /&gt;&lt;BR /&gt;A mismatch in layouts is a possible cause.&lt;BR /&gt;What does "info shared" show?&lt;BR /&gt;&lt;BR /&gt;&amp;gt;Any pointers/info is much appreciated.&lt;BR /&gt;&lt;BR /&gt;There isn't much I can suggest except to try to build debugging tools/tracing into your product.  Or see if you can get the customer to repeat it.  It seems you were able to do that from your original message??&lt;BR /&gt;&lt;BR /&gt;As I said, linking with -z may catch the error sooner.&lt;BR /&gt;&lt;BR /&gt;You are asking questions that are getting into real time and money.</description>
    <pubDate>Thu, 08 Feb 2007 03:23:45 GMT</pubDate>
    <dc:creator>Dennis Handly</dc:creator>
    <dc:date>2007-02-08T03:23:45Z</dc:date>
    <item>
      <title>Core Dump with multi-threaded application...</title>
      <link>https://community.hpe.com/t5/operating-system-linux/core-dump-with-multi-threaded-application/m-p/3938221#M97711</link>
      <description>&lt;P&gt;Hi All,&lt;BR /&gt; I have a multi-threaded application which gives core dump on only HPUX box but runs fine on other.&lt;BR /&gt;&lt;BR /&gt;the stack trace doesnt give much information;&lt;BR /&gt;&lt;BR /&gt;(gdb) where&lt;BR /&gt;#0 0xcd60b9a0 in setsockopt () from ../lib/libstdc++.sl.6&lt;BR /&gt;#1 0xcd60b990 in setsockopt () from ../lib/libstdc++.sl.6&lt;BR /&gt;#2 0xcd60b990 in setsockopt () from ../lib/libstdc++.sl.6&lt;BR /&gt;#3 0xcd60b990 in setsockopt () from ../lib/libstdc++.sl.6&lt;BR /&gt;#4 0xcd60b990 in setsockopt () from ../lib/libstdc++.sl.6&lt;BR /&gt;#5 0xcd60b990 in setsockopt () from ../lib/libstdc++.sl.6&lt;BR /&gt;Cannot access memory at address 0x2e2f4870&lt;BR /&gt;(gdb)&lt;BR /&gt;&lt;BR /&gt;Attached is the output of swlist.&lt;BR /&gt;&lt;BR /&gt; $uname -a&lt;BR /&gt;HP-UX hpcmtest B.11.11 U 9000/800 6466272 &lt;BR /&gt;unlimited-user license&lt;BR /&gt;&lt;BR /&gt;As I couldnt get any useful info from the stack trace , I added few more debug (print) statement in my code after each step and found that the code crashes when it calls fexist&lt;BR /&gt;&lt;BR /&gt;fexist(get_path());&lt;BR /&gt;&lt;BR /&gt;----here is def of get_path() in .h file&lt;BR /&gt;&lt;BR /&gt;string get_path () { return NIS_PWDIR_ + SHADOW; }&lt;BR /&gt;&lt;BR /&gt;--- and def of fexist&lt;BR /&gt;&lt;BR /&gt;bool fexist(const string&amp;amp; path)&lt;BR /&gt;{&lt;BR /&gt; return (!path.empty() &amp;amp;&amp;amp; access(path.c_str(), F_OK) == 0);&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;I also started another thread with opens a socket and calls accept() blocking call....&lt;BR /&gt;&lt;BR /&gt;I am not sure which thread is causing crash, as the main thread also prints 5-6 message and crash just after printing statement before it calls fexist...&lt;BR /&gt;&lt;BR /&gt;Any help or pointers to analyze core file will be appreciated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;P.S. This thread has been moevd&amp;nbsp;from HP-UX &amp;gt; General to HP-UX &amp;gt; languages. - Hp Forum Moderator&lt;/P&gt;</description>
      <pubDate>Mon, 07 Oct 2013 04:05:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/core-dump-with-multi-threaded-application/m-p/3938221#M97711</guid>
      <dc:creator>Sanjay Sutar</dc:creator>
      <dc:date>2013-10-07T04:05:58Z</dc:date>
    </item>
    <item>
      <title>Re: Core Dump with multi-threaded application...</title>
      <link>https://community.hpe.com/t5/operating-system-linux/core-dump-with-multi-threaded-application/m-p/3938222#M97712</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;a multithreaded application under HP-UX needs to be compiled AND linked with '-mt' option of aCC - check this first!&lt;BR /&gt;&lt;BR /&gt;mfG Peter</description>
      <pubDate>Mon, 05 Feb 2007 08:55:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/core-dump-with-multi-threaded-application/m-p/3938222#M97712</guid>
      <dc:creator>Peter Nikitka</dc:creator>
      <dc:date>2007-02-05T08:55:05Z</dc:date>
    </item>
    <item>
      <title>Re: Core Dump with multi-threaded application...</title>
      <link>https://community.hpe.com/t5/operating-system-linux/core-dump-with-multi-threaded-application/m-p/3938223#M97713</link>
      <description>Thanks for your reply!!&lt;BR /&gt;&lt;BR /&gt;I am using g++ for compiling and linking. &lt;BR /&gt;Looking at the man g++, I found -mthread option... &lt;BR /&gt;Is this equivalent to -mt option for aCC.&lt;BR /&gt;</description>
      <pubDate>Mon, 05 Feb 2007 09:05:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/core-dump-with-multi-threaded-application/m-p/3938223#M97713</guid>
      <dc:creator>Sanjay Sutar</dc:creator>
      <dc:date>2007-02-05T09:05:55Z</dc:date>
    </item>
    <item>
      <title>Re: Core Dump with multi-threaded application...</title>
      <link>https://community.hpe.com/t5/operating-system-linux/core-dump-with-multi-threaded-application/m-p/3938224#M97714</link>
      <description>I am using following option for g++ , &lt;BR /&gt;&lt;BR /&gt; -g -threads -c $(INCLUDES) -DDEBUG  &lt;BR /&gt;-DNISPLUS_STUB -D_hpux -Dunix&lt;BR /&gt;</description>
      <pubDate>Mon, 05 Feb 2007 09:16:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/core-dump-with-multi-threaded-application/m-p/3938224#M97714</guid>
      <dc:creator>Sanjay Sutar</dc:creator>
      <dc:date>2007-02-05T09:16:32Z</dc:date>
    </item>
    <item>
      <title>Re: Core Dump with multi-threaded application...</title>
      <link>https://community.hpe.com/t5/operating-system-linux/core-dump-with-multi-threaded-application/m-p/3938225#M97715</link>
      <description>And these are my linking options&lt;BR /&gt;&lt;BR /&gt;-lpthread -lcrypt -lxnet -lnsl -lsec -lstdc++ -Xlinker +b -Xlinker ../li&lt;BR /&gt;b:. -Xlinker +s&lt;BR /&gt;</description>
      <pubDate>Mon, 05 Feb 2007 09:24:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/core-dump-with-multi-threaded-application/m-p/3938225#M97715</guid>
      <dc:creator>Sanjay Sutar</dc:creator>
      <dc:date>2007-02-05T09:24:32Z</dc:date>
    </item>
    <item>
      <title>Re: Core Dump with multi-threaded application...</title>
      <link>https://community.hpe.com/t5/operating-system-linux/core-dump-with-multi-threaded-application/m-p/3938226#M97716</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I really would give -mthread a try for the compiler.&lt;BR /&gt;What do you use for a linker:&lt;BR /&gt;- do you call 'ld' directly?&lt;BR /&gt;- do you use /usr/bin/ld or something out of the gcc stuff?&lt;BR /&gt;- let you do g++ the work for linking as well?&lt;BR /&gt;&lt;BR /&gt;In the last case I would add '-mthread' to the linking command option as well.&lt;BR /&gt;&lt;BR /&gt;For the other cases you would have do do additional research and tests. Here is link to appropriate documentation of the aCC compiler:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://docs.hp.com/en/7762/5991-4874/threads.htm" target="_blank"&gt;http://docs.hp.com/en/7762/5991-4874/threads.htm&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Look for corresponding information in the gcc documentation.&lt;BR /&gt;&lt;BR /&gt;mfG Peter</description>
      <pubDate>Mon, 05 Feb 2007 09:47:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/core-dump-with-multi-threaded-application/m-p/3938226#M97716</guid>
      <dc:creator>Peter Nikitka</dc:creator>
      <dc:date>2007-02-05T09:47:34Z</dc:date>
    </item>
    <item>
      <title>Re: Core Dump with multi-threaded application...</title>
      <link>https://community.hpe.com/t5/operating-system-linux/core-dump-with-multi-threaded-application/m-p/3938227#M97717</link>
      <description>Some more information on this;&lt;BR /&gt;&lt;BR /&gt;We had similar crash at same location i.e while concating two strings , earlier... That time we found out that the ICU lib fies were not rebuilt with gcc 3.4.2 with which the application was built... &lt;BR /&gt;Rebuilding the ICU lib files with gcc 3.4.2 solved our issue.&lt;BR /&gt;&lt;BR /&gt;But now I dont see anything related to strin g in core file...</description>
      <pubDate>Tue, 06 Feb 2007 02:10:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/core-dump-with-multi-threaded-application/m-p/3938227#M97717</guid>
      <dc:creator>Sanjay Sutar</dc:creator>
      <dc:date>2007-02-06T02:10:26Z</dc:date>
    </item>
    <item>
      <title>Re: Core Dump with multi-threaded application...</title>
      <link>https://community.hpe.com/t5/operating-system-linux/core-dump-with-multi-threaded-application/m-p/3938228#M97718</link>
      <description>What gdb are you using?  It may not understand g++ code.  Also you neglected to mention what signal you got?&lt;BR /&gt;&lt;BR /&gt;You may have a thread stack overflow.</description>
      <pubDate>Tue, 06 Feb 2007 05:05:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/core-dump-with-multi-threaded-application/m-p/3938228#M97718</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2007-02-06T05:05:09Z</dc:date>
    </item>
    <item>
      <title>Re: Core Dump with multi-threaded application...</title>
      <link>https://community.hpe.com/t5/operating-system-linux/core-dump-with-multi-threaded-application/m-p/3938229#M97719</link>
      <description>Its GNU gdb 5.3&lt;BR /&gt;and this is the last line from my log&lt;BR /&gt;  "Received a segmentation violation"&lt;BR /&gt;&lt;BR /&gt;I rebuild my application with -pthread option and even then I am getting the crash at same location and same stack trace in core file;&lt;BR /&gt;&lt;BR /&gt;Here is the analysis of core file....&lt;BR /&gt;&lt;BR /&gt;[root@sh3hp11i bin]$/usr/local/local/bin/gdb HpuxAgent core_hpcmtest_0206.log&lt;BR /&gt;Name collision between 9826 9836&lt;BR /&gt;Name collision between gsi dtc300s&lt;BR /&gt;Name collision between dm1521 dm1520&lt;BR /&gt;Name collision between c108 c108&lt;BR /&gt;Name collision between ovt100 vt100&lt;BR /&gt;Name collision between 300 dtc300s&lt;BR /&gt;Name collision between t1061 t3700&lt;BR /&gt;GNU gdb 5.3&lt;BR /&gt;Copyright 2002 Free Software Foundation, Inc.&lt;BR /&gt;GDB is free software, covered by the GNU General Public License, and you are&lt;BR /&gt;welcome to change it and/or distribute copies of it under certain conditions.&lt;BR /&gt;Type "show copying" to see the conditions.&lt;BR /&gt;There is absolutely no warranty for GDB.  Type "show warranty" for details.&lt;BR /&gt;This GDB was configured as "hppa2.0n-hp-hpux11.00"...&lt;BR /&gt;Core was generated by `HpuxAgent'.&lt;BR /&gt;Program terminated with signal 11, Segmentation fault.&lt;BR /&gt;&lt;BR /&gt;warning: The shared libraries were not privately mapped; setting a&lt;BR /&gt;breakpoint in a shared library will not work until you rerun the program.&lt;BR /&gt;&lt;BR /&gt;Reading symbols from ./HpuxAgent...done.&lt;BR /&gt;Reading symbols from ../lib/libAdkApi.sl...done.&lt;BR /&gt;Reading symbols from ../lib/libErmApi.sl...done.&lt;BR /&gt;Reading symbols from ../lib/libicuuc.sl.26...done.&lt;BR /&gt;Reading symbols from ../lib/libicudata.sl.26...done.&lt;BR /&gt;Reading symbols from /usr/lib/libpthread.1...done.&lt;BR /&gt;Reading symbols from /usr/lib/libxnet.2...done.&lt;BR /&gt;Reading symbols from /usr/lib/libnsl.1...done.&lt;BR /&gt;Reading symbols from /usr/lib/libxti.2...done.&lt;BR /&gt;Reading symbols from /usr/lib/libsec.2...done.&lt;BR /&gt;Reading symbols from ../lib/libstdc++.sl.6...done.&lt;BR /&gt;Reading symbols from /usr/lib/libm.2...done.&lt;BR /&gt;Reading symbols from ../lib/libgcc_s.sl...done.&lt;BR /&gt;Reading symbols from /usr/lib/libc.2...done.&lt;BR /&gt;Name collision between 9826 9836&lt;BR /&gt;Name collision between gsi dtc300s&lt;BR /&gt;Name collision between dm1521 dm1520&lt;BR /&gt;Name collision between c108 c108&lt;BR /&gt;Name collision between ovt100 vt100&lt;BR /&gt;Name collision between 300 dtc300s&lt;BR /&gt;Name collision between t1061 t3700&lt;BR /&gt;---Type &lt;RETURN&gt; to continue, or q &lt;RETURN&gt; to quit---&lt;BR /&gt;Reading symbols from /usr/lib/libdld.2...done.&lt;BR /&gt;#0  0xcd60b9a0 in setsockopt () from ../lib/libstdc++.sl.6&lt;BR /&gt;(gdb) where&lt;BR /&gt;#0  0xcd60b9a0 in setsockopt () from ../lib/libstdc++.sl.6&lt;BR /&gt;#1  0xcd60b990 in setsockopt () from ../lib/libstdc++.sl.6&lt;BR /&gt;#2  0xcd60b990 in setsockopt () from ../lib/libstdc++.sl.6&lt;BR /&gt;#3  0xcd60b990 in setsockopt () from ../lib/libstdc++.sl.6&lt;BR /&gt;#4  0xcd60b990 in setsockopt () from ../lib/libstdc++.sl.6&lt;BR /&gt;#5  0xcd60b990 in setsockopt () from ../lib/libstdc++.sl.6&lt;BR /&gt;Cannot access memory at address 0x2e2f4870&lt;BR /&gt;(gdb)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Here are the last few lines of my log&lt;BR /&gt;&lt;BR /&gt;DBG:07/02/06 18:09:54 Thread:000001  context.h:: shadow_path &lt;BR /&gt;DBG:07/02/06 18:09:54 Thread:000001  context.h:: shadow_path : value of NIS_PWDIR_ :  &lt;BR /&gt;DBG:07/02/06 18:09:54 Thread:000001  context.h:: shadow_path : value of SHADOW : &lt;BR /&gt;BSE:07/02/06 18:09:54 Thread:000001 Received a segmentation violation...&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;From the log it seems that there are no values for two variables NIS_PWDIR_ and SHADOW , and the code is crashing when I concanate these two string and return them in my get_path function&lt;BR /&gt;&lt;BR /&gt;Can it be a cause of crash...&lt;BR /&gt;&lt;/RETURN&gt;&lt;/RETURN&gt;</description>
      <pubDate>Tue, 06 Feb 2007 07:00:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/core-dump-with-multi-threaded-application/m-p/3938229#M97719</guid>
      <dc:creator>Sanjay Sutar</dc:creator>
      <dc:date>2007-02-06T07:00:41Z</dc:date>
    </item>
    <item>
      <title>Re: Core Dump with multi-threaded application...</title>
      <link>https://community.hpe.com/t5/operating-system-linux/core-dump-with-multi-threaded-application/m-p/3938230#M97720</link>
      <description>Are you recursive?  Do you call setsockopt?  If not, your gdb is broken.  Why don't you use HP's gdb and see if it is any better.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;and the code is crashing when I concanate these two string and return them in my get_path function&lt;BR /&gt;&amp;gt;Can it be a cause of crash?&lt;BR /&gt;&lt;BR /&gt;A thread stack overflow will cause random crashes.  But you can't figure this out until you get a debugger that will trace the whole stack.&lt;BR /&gt;&lt;BR /&gt;Or you could just call pthread_default_stacksize_np(3) to make it bigger, just to see.</description>
      <pubDate>Tue, 06 Feb 2007 08:19:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/core-dump-with-multi-threaded-application/m-p/3938230#M97720</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2007-02-06T08:19:44Z</dc:date>
    </item>
    <item>
      <title>Re: Core Dump with multi-threaded application...</title>
      <link>https://community.hpe.com/t5/operating-system-linux/core-dump-with-multi-threaded-application/m-p/3938231#M97721</link>
      <description>I used HP gdb and here is the analysis of core dump&lt;BR /&gt;&lt;BR /&gt;sh1hp11i[/sanjay/agent/bin]#/usr/local/opt/langtools/bin/gdb HpuxAgent core_hpcmtest_0206.log&lt;BR /&gt;HP gdb 5.2 for PA-RISC 1.1 or 2.0 (narrow), HP-UX 11.00&lt;BR /&gt;and target hppa1.1-hp-hpux11.00.&lt;BR /&gt;Copyright 1986 - 2001 Free Software Foundation, Inc.&lt;BR /&gt;Hewlett-Packard Wildebeest 5.2 (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.&lt;BR /&gt;..&lt;BR /&gt;Core was generated by `HpuxAgent'.&lt;BR /&gt;Program terminated with signal 11, Segmentation fault.&lt;BR /&gt;Unknown si_code.  Report to HP.&lt;BR /&gt;#0  _ZNSsC1ERKSs ()&lt;BR /&gt;    at /scratch/njs/pkgbuild/3.3.1/hpux-11/gcc-3.4.2-b/hppa2.0w-hp-hpux11.11/libstdc++-v3/include/bits/basic_string.h:182&lt;BR /&gt;182     /scratch/njs/pkgbuild/3.3.1/hpux-11/gcc-3.4.2-b/hppa2.0w-hp-hpux11.11/libstdc++-v3/include/bits/basic_string.h: No such file or directory.&lt;BR /&gt;        in /scratch/njs/pkgbuild/3.3.1/hpux-11/gcc-3.4.2-b/hppa2.0w-hp-hpux11.11/libstdc++-v3/include/bits/basic_string.h&lt;BR /&gt;(gdb) where&lt;BR /&gt;#0  _ZNSsC1ERKSs ()&lt;BR /&gt;    at /scratch/njs/pkgbuild/3.3.1/hpux-11/gcc-3.4.2-b/hppa2.0w-hp-hpux11.11/libstdc++-v3/include/bits/basic_string.h:182&lt;BR /&gt;#1  0x197b4 in _ZStplIcSt11char_traitsIcESaIcEESbIT_T0_T1_ERKS6_S8_ ()&lt;BR /&gt;    at /usr/local/include/c++/3.4.2/bits/basic_string.h:1984&lt;BR /&gt;(gdb)&lt;BR /&gt;&lt;BR /&gt;I have observed this type of core file earlier and that time I had to rebuild the ICU lib files as they were built with older gcc.&lt;BR /&gt;&lt;BR /&gt;Now in this case if I execute following script for all by lib and binary files ;&lt;BR /&gt;&lt;BR /&gt;------------------&lt;BR /&gt; cd $1&lt;BR /&gt; echo " Cur dir `pwd`"&lt;BR /&gt;  for i in `ls`&lt;BR /&gt;  do&lt;BR /&gt;#       echo "$i"&lt;BR /&gt;        strings -a $i | grep  gcc-3.4.2-b &amp;gt; /dev/null &amp;amp;&amp;amp; echo "File $i was built with gcc-3.4.2-b!"&lt;BR /&gt;strings -a $i | grep  gcc-3.3.1 &amp;gt; /dev/null &amp;amp;&amp;amp; echo "File $i was built with gcc-3.3.1!"&lt;BR /&gt;strings -a $i | grep  gcc-3.4.2 &amp;gt; /dev/null &amp;amp;&amp;amp; echo "File $i was built with gcc-3.4.2!"&lt;BR /&gt;  done&lt;BR /&gt;&lt;BR /&gt;------------------&lt;BR /&gt;&lt;BR /&gt;I get libstdc++.sl.6 file having ref to gcc-3.4.2-b&lt;BR /&gt;&lt;BR /&gt;But this works on all other machine and gives core only on one machine...&lt;BR /&gt;&lt;BR /&gt;Any clue???&lt;BR /&gt;&lt;BR /&gt;Thanks for all your assistance....&lt;BR /&gt;</description>
      <pubDate>Tue, 06 Feb 2007 10:15:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/core-dump-with-multi-threaded-application/m-p/3938231#M97721</guid>
      <dc:creator>Sanjay Sutar</dc:creator>
      <dc:date>2007-02-06T10:15:55Z</dc:date>
    </item>
    <item>
      <title>Re: Core Dump with multi-threaded application...</title>
      <link>https://community.hpe.com/t5/operating-system-linux/core-dump-with-multi-threaded-application/m-p/3938232#M97722</link>
      <description>&amp;gt;I used HP gdb and here is the analysis of core dump&lt;BR /&gt;&lt;BR /&gt;Much better.  Your two frames just had:&lt;BR /&gt;#0 string::string(const string&amp;amp;)&lt;BR /&gt;#1 std::operator+(const string&amp;amp;, const string&amp;amp;)&lt;BR /&gt;&lt;BR /&gt;Now you need to do bt.  Or did it stop after two frames?  Without the complete thread stack trace, I can't tell if you have a thread stack overflow.  So either you make the call below or provide more info:&lt;BR /&gt;(gdb) info reg&lt;BR /&gt;(gdb) disas $pc-4*32 $pc+4*8&lt;BR /&gt;&lt;BR /&gt;&amp;gt;Any clue??? &lt;BR /&gt;&lt;BR /&gt;Did you call pthread_default_stacksize_np(1000000) to set the default thread size to 1 Mb?</description>
      <pubDate>Tue, 06 Feb 2007 22:09:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/core-dump-with-multi-threaded-application/m-p/3938232#M97722</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2007-02-06T22:09:24Z</dc:date>
    </item>
    <item>
      <title>Re: Core Dump with multi-threaded application...</title>
      <link>https://community.hpe.com/t5/operating-system-linux/core-dump-with-multi-threaded-application/m-p/3938233#M97723</link>
      <description>How you figured out what the frame 0 has?&lt;BR /&gt;When I saw into basic_sting.h , line 182, it has some thing else. &lt;BR /&gt;&lt;BR /&gt;And bt also gives me same output.&lt;BR /&gt;&lt;BR /&gt;(gdb) bt&lt;BR /&gt;#0  _ZNSsC1ERKSs ()&lt;BR /&gt;    at /scratch/njs/pkgbuild/3.3.1/hpux-11/gcc-3.4.2-b/hppa2.0w-hp-hpux11.11/libstdc++-v3/include/bits/basic_string.h:182&lt;BR /&gt;#1  0x197b4 in _ZStplIcSt11char_traitsIcESaIcEESbIT_T0_T1_ERKS6_S8_ ()&lt;BR /&gt;    at /usr/local/include/c++/3.4.2/bits/basic_string.h:1984&lt;BR /&gt;&lt;BR /&gt;I have attached the complete analysis with output of gdb command you asked for.&lt;BR /&gt;&lt;BR /&gt;Thanks a lot for your continued assistance.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 07 Feb 2007 01:04:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/core-dump-with-multi-threaded-application/m-p/3938233#M97723</guid>
      <dc:creator>Sanjay Sutar</dc:creator>
      <dc:date>2007-02-07T01:04:50Z</dc:date>
    </item>
    <item>
      <title>Re: Core Dump with multi-threaded application...</title>
      <link>https://community.hpe.com/t5/operating-system-linux/core-dump-with-multi-threaded-application/m-p/3938234#M97724</link>
      <description>&amp;gt;How you figured out what the frame 0 has?&lt;BR /&gt;When I saw into basic_string.h , line 182, it has some thing else. &lt;BR /&gt;&lt;BR /&gt;I demangled the name on IPF with aC++'s c++filt then I replaced the long template name by its typedef, so it would be easy to understand.  I assume you got something with basic_string&amp;lt;...&amp;gt;, the copy constructor.&lt;BR /&gt;&lt;BR /&gt;This doesn't look like a thread stack overflow:&lt;BR /&gt;;;; Line: 257&lt;BR /&gt;0xcd60b990 &amp;lt;_ZNSsC1ERKSs+0xc8&amp;gt;: ldw -0x12c(%sp),%r20&lt;BR /&gt;0xcd60b994 &amp;lt;_ZNSsC1ERKSs+0xcc&amp;gt;: ldw 0(%r20),%r20       NULL ptr&lt;BR /&gt;0xcd60b998 &amp;lt;_ZNSsC1ERKSs+0xd0&amp;gt;: stw %r20,-0x124(%sp)&lt;BR /&gt;0xcd60b99c &amp;lt;_ZNSsC1ERKSs+0xd4&amp;gt;: ldo -0xc(%r20),%r26&lt;BR /&gt;;;; Line: 182&lt;BR /&gt;0xcd60b9a0 &amp;lt;_ZNSsC1ERKSs+0xd8&amp;gt;: ldw 8(%r26),%r20   &amp;lt;&amp;lt;&amp;lt;&amp;lt; abort here&lt;BR /&gt;&lt;BR /&gt;R20 is 0 and R26 is -4.  I'm not sure what's at SP-0x12c, I didn't have you go back far enough.  Using "disas $pc", will do the whole function.  In any case, you might want to link with -z so you abort sooner.  (Or use chatr -z HpuxAgent)&lt;BR /&gt;&lt;BR /&gt;(You have some instructions missing, 0xcd60b948 to 0xcd60b950.)</description>
      <pubDate>Wed, 07 Feb 2007 01:49:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/core-dump-with-multi-threaded-application/m-p/3938234#M97724</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2007-02-07T01:49:16Z</dc:date>
    </item>
    <item>
      <title>Re: Core Dump with multi-threaded application...</title>
      <link>https://community.hpe.com/t5/operating-system-linux/core-dump-with-multi-threaded-application/m-p/3938235#M97725</link>
      <description>Here is the complete assembly dump.&lt;BR /&gt;&lt;BR /&gt;I dont know how to read it.&lt;BR /&gt;</description>
      <pubDate>Wed, 07 Feb 2007 03:48:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/core-dump-with-multi-threaded-application/m-p/3938235#M97725</guid>
      <dc:creator>Sanjay Sutar</dc:creator>
      <dc:date>2007-02-07T03:48:44Z</dc:date>
    </item>
    <item>
      <title>Re: Core Dump with multi-threaded application...</title>
      <link>https://community.hpe.com/t5/operating-system-linux/core-dump-with-multi-threaded-application/m-p/3938236#M97726</link>
      <description>&amp;gt;&amp;gt;I'm not sure what's at SP-0x12c,&lt;BR /&gt;&lt;BR /&gt;Ok, this comes from R25, the string you are copying from.  So either NIS_PWDIR_ or SHADOW has not been initialized.  That's why you want to link with -z.&lt;BR /&gt;&lt;BR /&gt;Of course the pointer inside the string could be NULL.  Do the following:&lt;BR /&gt;(gdb) x /2x $sp-0x12c&lt;BR /&gt;(gdb) x /4x *(void**)($sp-0x12c)</description>
      <pubDate>Wed, 07 Feb 2007 04:27:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/core-dump-with-multi-threaded-application/m-p/3938236#M97726</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2007-02-07T04:27:14Z</dc:date>
    </item>
    <item>
      <title>Re: Core Dump with multi-threaded application...</title>
      <link>https://community.hpe.com/t5/operating-system-linux/core-dump-with-multi-threaded-application/m-p/3938237#M97727</link>
      <description>(gdb) x/2x $sp-0x12c&lt;BR /&gt;0x7aff13d4:     0x400014b0      0x7aff0ed0&lt;BR /&gt;(gdb) x/4x *(void**)($sp-0x12c)&lt;BR /&gt;0x400014b0 &amp;lt;_ZN7Context10NIS_PWDIR_E&amp;gt;:  0x00000000      0x00000000      0x00000000      0xffff0112&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 07 Feb 2007 04:47:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/core-dump-with-multi-threaded-application/m-p/3938237#M97727</guid>
      <dc:creator>Sanjay Sutar</dc:creator>
      <dc:date>2007-02-07T04:47:21Z</dc:date>
    </item>
    <item>
      <title>Re: Core Dump with multi-threaded application...</title>
      <link>https://community.hpe.com/t5/operating-system-linux/core-dump-with-multi-threaded-application/m-p/3938238#M97728</link>
      <description>(gdb) x/2x $sp-0x12c&lt;BR /&gt;0x7aff13d4: 0x400014b0 0x7aff0ed0&lt;BR /&gt;&lt;BR /&gt;You are copying the string from 0x400014b0, NIS_PWDIR, to a local temp 0x7aff0ed0&lt;BR /&gt;&lt;BR /&gt;(gdb) x/4x *(void**)($sp-0x12c)&lt;BR /&gt;0x400014b0 &amp;lt;_ZN7Context10NIS_PWDIR_E&amp;gt;: 0x00000000 0x00000000 0x00000000 0xffff0112&lt;BR /&gt;&lt;BR /&gt;The contents of Context::NIS_PWDIR_ have either been zeroed out or you are accessing it before it has been initialized because of order of static initialization.&lt;BR /&gt;&lt;BR /&gt;You can put a watch point on it by:&lt;BR /&gt;(gdb) watch *(int*)0x400014b0&lt;BR /&gt;&lt;BR /&gt;For being "zeroed out", it should start at 0, then be set valid, then reset to 0, what you are looking for, then you have the abort.&lt;BR /&gt;If never valid, you have initialization order issues.</description>
      <pubDate>Wed, 07 Feb 2007 05:58:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/core-dump-with-multi-threaded-application/m-p/3938238#M97728</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2007-02-07T05:58:45Z</dc:date>
    </item>
    <item>
      <title>Re: Core Dump with multi-threaded application...</title>
      <link>https://community.hpe.com/t5/operating-system-linux/core-dump-with-multi-threaded-application/m-p/3938239#M97729</link>
      <description>Sorry Dennis, I cant put any watch.&lt;BR /&gt;  The application is not crashing on my machine and I dont have access to the customer environment where its crashing.&lt;BR /&gt;&lt;BR /&gt;I only have the core file for analysis.</description>
      <pubDate>Wed, 07 Feb 2007 07:09:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/core-dump-with-multi-threaded-application/m-p/3938239#M97729</guid>
      <dc:creator>Sanjay Sutar</dc:creator>
      <dc:date>2007-02-07T07:09:59Z</dc:date>
    </item>
    <item>
      <title>Re: Core Dump with multi-threaded application...</title>
      <link>https://community.hpe.com/t5/operating-system-linux/core-dump-with-multi-threaded-application/m-p/3938240#M97730</link>
      <description>&lt;P&gt;&amp;gt;I cant put any watch.&lt;BR /&gt;&amp;gt;The application is not crashing on my machine and I dont have access to the customer environment where its crashing.&lt;BR /&gt;&lt;BR /&gt;Then there is not much you can do unless you want to write tool to dump ALL of your data structures.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;I only have the core file for analysis.&lt;BR /&gt;&lt;BR /&gt;(I hope you were given all of the user's shlibs? See gdb's packcore command.)&lt;BR /&gt;&lt;BR /&gt;You could look at stack traces for the other threads to see if they are fiddling with NIS_PWDIR_. (I assume you are doing locking?)&lt;BR /&gt;&lt;BR /&gt;You could look at all globals that are "close" to NIS_PWDIR_ to see if there is a pattern for that zeroing. For named globals you can use the following:&lt;BR /&gt;$ nm -pxv HpuxAgent&lt;BR /&gt;&lt;BR /&gt;You can use the x command to look at raw memory:&lt;BR /&gt;(gdb) x /128x 0x400014b0-64*4&lt;BR /&gt;&lt;BR /&gt;If this isn't helpful, record this info for next time.&lt;/P&gt;</description>
      <pubDate>Sat, 05 Oct 2013 03:33:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/core-dump-with-multi-threaded-application/m-p/3938240#M97730</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2013-10-05T03:33:49Z</dc:date>
    </item>
  </channel>
</rss>

