Boost C++ Libraries: Ticket #6799: Assert hit in dl-close.c when calling dlclose on libboost_date_time.so https://svn.boost.org/trac10/ticket/6799 <p> I get the hit the following assert when calling dlclose() on libboost_date_time.so: Inconsistency detected by ld.so: dl-close.c: 759: _dl_close: Assertion `map-&gt;l_init_called' failed! </p> <p> I wrote a small test library and test app to reproduce the issue. </p> <ol><li>Compile libchild.so library. It is a library which links against libboost_date_time.so but has a missing symbol. </li><li>Compile test-dlopen.c and run the app. </li></ol><p> The test-dlopen app will: </p> <ol><li>Call dlopen("./libchild.so", RTLD_NOW), which will fail because of the missing symbol (normal). It will probably recursively load libboost_date_time.so since libchild.so links against it. </li><li>Call mh = dlopen("/usr/lib/libboost_date_time.so", RTLD_NOW), which will succeed (normal). </li><li>Call dlclose(mh), which will hit the assert. </li></ol><p> The output of the test app is: $ ./test-dlopen trying to load ./libchild.so... Failed to load: ./libchild.so: undefined symbol: _Z15registerMethodsv trying to load /usr/lib/libboost_date_time.so... Inconsistency detected by ld.so: dl-close.c: 743: _dl_close: Assertion `map-&gt;l_init_called' failed! </p> <p> I tried with: boost v1.48 + glibc 2.13 (Tizen) boost v1.47 + glic 2.14.90 (Fedora) </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/6799 Trac 1.4.3 Christophe Dumez <christophe.dumez@…> Mon, 16 Apr 2012 12:31:19 GMT attachment set https://svn.boost.org/trac10/ticket/6799 https://svn.boost.org/trac10/ticket/6799 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">libchild.cpp</span> </li> </ul> <p> Library linking against boost date_time with missing symbol </p> Ticket Christophe Dumez <christophe.dumez@…> Mon, 16 Apr 2012 12:31:46 GMT attachment set https://svn.boost.org/trac10/ticket/6799 https://svn.boost.org/trac10/ticket/6799 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">test-dlopen.c</span> </li> </ul> <p> test app which calls dlopen/dlclose </p> Ticket Christophe Dumez <christophe.dumez@…> Mon, 16 Apr 2012 12:56:49 GMT <link>https://svn.boost.org/trac10/ticket/6799#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6799#comment:1</guid> <description> <p> In case it matters, I have gcc 4.6.1 and 4.6.2. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Andrey Semashev</dc:creator> <pubDate>Wed, 12 Mar 2014 19:47:14 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/6799#comment:2 https://svn.boost.org/trac10/ticket/6799#comment:2 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">invalid</span> </li> </ul> <p> I don't think this problem is caused by Boost.<a class="missing wiki">DateTime</a>. I'm not sure what exactly the assert means, I can only guess it has something to do with global initialization not having been performed at the unload point. If that's the case then the problem is in the linker (i.e. ld.so) and cannot be fixed on our side. </p> Ticket