<?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 static constructors in dlopen in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/static-constructors-in-dlopen/m-p/3084559#M717271</link>
    <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Does anyone know if there is a way to break in each of the static constructors called during dlopen() or destructors during dlclose() of a C++ library. &lt;BR /&gt;Currently, I am debugging a problem, where the program segfaults in dlclose() when I close the C++ shared library loaded through dlopen(). I suspect that there is a problem with the static destructors. &lt;BR /&gt;I have tried including the cpprt0.s stub suggested in some website and also tried using shl_load() instead of dlopen() and in both the cases it fails while closing. &lt;BR /&gt;Does anyone has faced a similar problem? If so can you let me know how to debug it.&lt;BR /&gt;&lt;BR /&gt;Thanks</description>
    <pubDate>Thu, 02 Oct 2003 21:59:05 GMT</pubDate>
    <dc:creator>lara</dc:creator>
    <dc:date>2003-10-02T21:59:05Z</dc:date>
    <item>
      <title>static constructors in dlopen</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/static-constructors-in-dlopen/m-p/3084559#M717271</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Does anyone know if there is a way to break in each of the static constructors called during dlopen() or destructors during dlclose() of a C++ library. &lt;BR /&gt;Currently, I am debugging a problem, where the program segfaults in dlclose() when I close the C++ shared library loaded through dlopen(). I suspect that there is a problem with the static destructors. &lt;BR /&gt;I have tried including the cpprt0.s stub suggested in some website and also tried using shl_load() instead of dlopen() and in both the cases it fails while closing. &lt;BR /&gt;Does anyone has faced a similar problem? If so can you let me know how to debug it.&lt;BR /&gt;&lt;BR /&gt;Thanks</description>
      <pubDate>Thu, 02 Oct 2003 21:59:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/static-constructors-in-dlopen/m-p/3084559#M717271</guid>
      <dc:creator>lara</dc:creator>
      <dc:date>2003-10-02T21:59:05Z</dc:date>
    </item>
    <item>
      <title>Re: static constructors in dlopen</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/static-constructors-in-dlopen/m-p/3084560#M717272</link>
      <description>make sure you link with aCC/g++ and not use the linker directly, when linking c++ objects (especially while building shared libraries).&lt;BR /&gt;&lt;BR /&gt;what compiler and linker are you using ? is this a 32-bit or a 64-bit application ?</description>
      <pubDate>Fri, 03 Oct 2003 01:54:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/static-constructors-in-dlopen/m-p/3084560#M717272</guid>
      <dc:creator>ranganath ramachandra</dc:creator>
      <dc:date>2003-10-03T01:54:11Z</dc:date>
    </item>
    <item>
      <title>Re: static constructors in dlopen</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/static-constructors-in-dlopen/m-p/3084561#M717273</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Yes, I compile with aCC and it's on 32bit platform&lt;BR /&gt;&lt;BR /&gt;Thanks</description>
      <pubDate>Fri, 03 Oct 2003 08:50:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/static-constructors-in-dlopen/m-p/3084561#M717273</guid>
      <dc:creator>lara</dc:creator>
      <dc:date>2003-10-03T08:50:47Z</dc:date>
    </item>
    <item>
      <title>Re: static constructors in dlopen</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/static-constructors-in-dlopen/m-p/3084562#M717274</link>
      <description>i remember one case of dlclose ending in a core dump, which was solved by the latest linker/loader patch, but i dont have the details.&lt;BR /&gt;&lt;BR /&gt;by the way, you dont just compile with aCC, you also link with it with the "-b" option when building the shared library. cpprt0.s is not required with aCC (i think it may be relevant to either g++ or the obsolete cfront). aCC includes /opt/aCC/lib/shlrt0.o in the link line (and adds an initializer/terminator __shlInit with the +I linker option). however if your initializer is being called, you dont need to bother about all this, just try the latest linker/loader patch and let us know if the problem still exists.</description>
      <pubDate>Fri, 03 Oct 2003 22:44:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/static-constructors-in-dlopen/m-p/3084562#M717274</guid>
      <dc:creator>ranganath ramachandra</dc:creator>
      <dc:date>2003-10-03T22:44:11Z</dc:date>
    </item>
    <item>
      <title>Re: static constructors in dlopen</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/static-constructors-in-dlopen/m-p/3084563#M717275</link>
      <description>correction - cpprt0.o is linked in while building executables and shlrt0.o into shared libraries.&lt;BR /&gt;&lt;BR /&gt;i am not very sure if this helps: "odump -slinit" will list the initializers of the shared library, perhaps you can proceed from here to set breakpoints.</description>
      <pubDate>Fri, 03 Oct 2003 22:50:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/static-constructors-in-dlopen/m-p/3084563#M717275</guid>
      <dc:creator>ranganath ramachandra</dc:creator>
      <dc:date>2003-10-03T22:50:07Z</dc:date>
    </item>
  </channel>
</rss>

