<?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: -mt linker flag causing crash in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/mt-linker-flag-causing-crash/m-p/4660401#M677510</link>
    <description>The problem has been fixed.&lt;BR /&gt;&lt;BR /&gt;@Dennis&lt;BR /&gt;I recompiled all the open source libraries  with -mt compilation flag, checked if the 3rd party libraries were compiled with -mt...they were. &lt;BR /&gt;&lt;BR /&gt;@Vaclay&lt;BR /&gt;We use log4cplus version 1.0.2.&lt;BR /&gt;I used --enable-pthread flag while compiling log4cplus. I noticed this did not change the CFLAGS, CXXFLAGS or the compiler options though.&lt;BR /&gt;&lt;BR /&gt;One or both of these steps fixed the problem. Once I finish this task I will isolate them check which one actually worked post it here and close the thread.&lt;BR /&gt;&lt;BR /&gt;Thanks for the help provided in fixing the problem&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;Sruthi</description>
    <pubDate>Mon, 19 Jul 2010 13:41:21 GMT</pubDate>
    <dc:creator>Sruthi P</dc:creator>
    <dc:date>2010-07-19T13:41:21Z</dc:date>
    <item>
      <title>-mt linker flag causing crash</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/mt-linker-flag-causing-crash/m-p/4660395#M677504</link>
      <description>I am porting our application to 64-bit on a HP-ia64 11.23 machine. &lt;BR /&gt;We use log4cplus for logging.&lt;BR /&gt;&lt;BR /&gt;My application crashes at runtime and the gdb stack trace points to the following line of code. &lt;BR /&gt;APPLOGGER_INITIALIZE("logging.properties");&lt;BR /&gt;where&lt;BR /&gt;#define APPLOGGER_INITIALIZE(filename) log4cplus::PropertyConfigurator::doConfigure(LOG4CPLUS_STRING_TO_TSTRING(filename));&lt;BR /&gt;&lt;BR /&gt;The stack trace is included below.&lt;BR /&gt;Program terminated with signal 11, Segmentation fault.&lt;BR /&gt;SEGV_MAPERR - Address not mapped to object&lt;BR /&gt;#0  0xc0000000000ec090:0 in pthread_mutex_lock+0x610 ()&lt;BR /&gt;   from /usr/lib/hpux64/libpthread.so.1&lt;BR /&gt;(gdb) where&lt;BR /&gt;#0  0xc0000000000ec090:0 in pthread_mutex_lock+0x610 ()&lt;BR /&gt;   from /usr/lib/hpux64/libpthread.so.1&lt;BR /&gt;#1  0xc000000000359fb0:0 in __thread_mutex_lock+0xb0 ()&lt;BR /&gt;   from /usr/lib/hpux64/libc.so.1&lt;BR /&gt;#2  0xc000000002046be0:0 in _HPMutexWrapper::lock(void*)+0x80 ()&lt;BR /&gt;   from /usr/lib/hpux64/libstd_v2.so.1&lt;BR /&gt;#3  0xc00000000211f160:0 in std::basic_istream&lt;CHAR&gt; &amp;gt;::read(char*,long,int,int)+0xa0 () from /usr/lib/hpux64/libstd_v2.so.1&lt;BR /&gt;#4  0xc0000001136db9f0:0 in std::basic_istream&lt;CHAR&gt; &amp;gt;::getline () at /opt/aCC/include_std/istream:235&lt;BR /&gt;#5  0xc0000001136debe0:0 in log4cplus::helpers::Properties::init ()&lt;BR /&gt;    at property.cxx:104&lt;BR /&gt;#6  0xc0000001136dfd40:0 in log4cplus::helpers::Properties::Properties ()&lt;BR /&gt;    at property.cxx:90&lt;BR /&gt;#7  0xc0000001136e01d0:0 in log4cplus::helpers::Properties::Properties(std::basic_string&lt;CHAR&gt;,std::allocator&lt;CHAR&gt; &amp;gt; const&amp;amp;)+0x40 ()&lt;BR /&gt;    at property.cxx:0&lt;BR /&gt;#8  0xc0000001135e96a0:0 in log4cplus::PropertyConfigurator::PropertyConfigurator () at configurator.cxx:204&lt;BR /&gt;#9  0xc0000001135ea740:0 in log4cplus::PropertyConfigurator::PropertyConfigurator(std::basic_string&lt;CHAR&gt;,std::allocator&lt;CHAR&gt; &amp;gt; const&amp;amp;,log4cplus::Hierarchy&amp;amp;)+0x50 () at configurator.cxx:0&lt;BR /&gt;#10 0xc0000001135ec7a0:0 in log4cplus::PropertyConfigurator::doConfigure ()&lt;BR /&gt;&lt;BR /&gt;The linker flags I use to build my application are&lt;BR /&gt; aCC -Wl,-N -Wl,+s -Wl,+b,/usr/lib/hpux64:. -Wl,-Brestricted -AA +DD64 -mt&lt;BR /&gt;&lt;BR /&gt;However if I remove the -mt flag I do not get the error.&lt;BR /&gt;Can anyone tell me why I get the error if I use the -mt linker flag.&lt;BR /&gt;&lt;BR /&gt;Any help is very much appreciated.&lt;BR /&gt;Thanks&lt;BR /&gt;Sruthi&lt;/CHAR&gt;&lt;/CHAR&gt;&lt;/CHAR&gt;&lt;/CHAR&gt;&lt;/CHAR&gt;&lt;/CHAR&gt;</description>
      <pubDate>Tue, 13 Jul 2010 05:33:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/mt-linker-flag-causing-crash/m-p/4660395#M677504</guid>
      <dc:creator>Sruthi P</dc:creator>
      <dc:date>2010-07-13T05:33:08Z</dc:date>
    </item>
    <item>
      <title>Re: -mt linker flag causing crash</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/mt-linker-flag-causing-crash/m-p/4660396#M677505</link>
      <description>Is your application threaded?  If not, don't use -mt.&lt;BR /&gt;&lt;BR /&gt;If you link against libpthread, every object must be compiled with -mt.&lt;BR /&gt;Your stack trace implies that you have compiled some code referencing std::basic_istream without -mt.  I.e. when you constructed it.&lt;BR /&gt;&lt;BR /&gt;If your lib needs to be used by applications that are or aren't threaded, compile with -mt but don't link with -mt.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 13 Jul 2010 05:57:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/mt-linker-flag-causing-crash/m-p/4660396#M677505</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2010-07-13T05:57:07Z</dc:date>
    </item>
    <item>
      <title>Re: -mt linker flag causing crash</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/mt-linker-flag-causing-crash/m-p/4660397#M677506</link>
      <description>Hi Dennis,&lt;BR /&gt;&lt;BR /&gt;Thanks for the quick response.&lt;BR /&gt;&lt;BR /&gt;Yes my application is multithreaded.&lt;BR /&gt;I realized that I had not compiled log4cplus with the -mt flag. So I recompiled log4cplus with -mt and rebuilt my application with log4cplus but my application still crashes when i use the -mt linker flag and the gdb stacktrace is the same as previous.&lt;BR /&gt;</description>
      <pubDate>Tue, 13 Jul 2010 08:29:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/mt-linker-flag-causing-crash/m-p/4660397#M677506</guid>
      <dc:creator>Sruthi P</dc:creator>
      <dc:date>2010-07-13T08:29:17Z</dc:date>
    </item>
    <item>
      <title>Re: -mt linker flag causing crash</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/mt-linker-flag-causing-crash/m-p/4660398#M677507</link>
      <description>Hi, I am developing log4cplus. What version of log4cplus are you using? Is it possible for you to reduce "logging.properties" to the smallest possible file that still reproduces the problem and post it here?&lt;BR /&gt;&lt;BR /&gt;I do not have access to an IA64/HP-UX machine but I could at least take a look at the source given the call stack and line numbers and version of the source.&lt;BR /&gt;</description>
      <pubDate>Tue, 13 Jul 2010 15:36:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/mt-linker-flag-causing-crash/m-p/4660398#M677507</guid>
      <dc:creator>Václav Haisman</dc:creator>
      <dc:date>2010-07-13T15:36:34Z</dc:date>
    </item>
    <item>
      <title>Re: -mt linker flag causing crash</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/mt-linker-flag-causing-crash/m-p/4660399#M677508</link>
      <description>Another idea, what configure script flags have you used? Since your application is threaded, have you configured log4cplus with --enable-threads=yes, too?&lt;BR /&gt;</description>
      <pubDate>Tue, 13 Jul 2010 15:44:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/mt-linker-flag-causing-crash/m-p/4660399#M677508</guid>
      <dc:creator>Václav Haisman</dc:creator>
      <dc:date>2010-07-13T15:44:45Z</dc:date>
    </item>
    <item>
      <title>Re: -mt linker flag causing crash</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/mt-linker-flag-causing-crash/m-p/4660400#M677509</link>
      <description>&amp;gt;rebuilt my application with log4cplus but my application still crashes when I use the -mt linker flag and the gdb stacktrace is the same as previous.&lt;BR /&gt;&lt;BR /&gt;Have you checked EVERY object, archive and shared lib in your application for -mt?  Even other third party libs.&lt;BR /&gt;&lt;BR /&gt;Try footprints(1) on your application.&lt;BR /&gt;&lt;BR /&gt;Are you on a thread stack or in the main thread?</description>
      <pubDate>Tue, 13 Jul 2010 22:52:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/mt-linker-flag-causing-crash/m-p/4660400#M677509</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2010-07-13T22:52:22Z</dc:date>
    </item>
    <item>
      <title>Re: -mt linker flag causing crash</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/mt-linker-flag-causing-crash/m-p/4660401#M677510</link>
      <description>The problem has been fixed.&lt;BR /&gt;&lt;BR /&gt;@Dennis&lt;BR /&gt;I recompiled all the open source libraries  with -mt compilation flag, checked if the 3rd party libraries were compiled with -mt...they were. &lt;BR /&gt;&lt;BR /&gt;@Vaclay&lt;BR /&gt;We use log4cplus version 1.0.2.&lt;BR /&gt;I used --enable-pthread flag while compiling log4cplus. I noticed this did not change the CFLAGS, CXXFLAGS or the compiler options though.&lt;BR /&gt;&lt;BR /&gt;One or both of these steps fixed the problem. Once I finish this task I will isolate them check which one actually worked post it here and close the thread.&lt;BR /&gt;&lt;BR /&gt;Thanks for the help provided in fixing the problem&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;Sruthi</description>
      <pubDate>Mon, 19 Jul 2010 13:41:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/mt-linker-flag-causing-crash/m-p/4660401#M677510</guid>
      <dc:creator>Sruthi P</dc:creator>
      <dc:date>2010-07-19T13:41:21Z</dc:date>
    </item>
  </channel>
</rss>

