Opened 11 years ago

Closed 9 years ago

#6799 closed Bugs (invalid)

Assert hit in dl-close.c when calling dlclose on libboost_date_time.so

Reported by: Christophe Dumez <christophe.dumez@…> Owned by: az_sw_dude
Milestone: To Be Determined Component: date_time
Version: Boost 1.48.0 Severity: Problem
Keywords: Cc:

Description

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->l_init_called' failed!

I wrote a small test library and test app to reproduce the issue.

  1. Compile libchild.so library. It is a library which links against libboost_date_time.so but has a missing symbol.
  2. Compile test-dlopen.c and run the app.

The test-dlopen app will:

  1. 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.
  2. Call mh = dlopen("/usr/lib/libboost_date_time.so", RTLD_NOW), which will succeed (normal).
  3. Call dlclose(mh), which will hit the assert.

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->l_init_called' failed!

I tried with: boost v1.48 + glibc 2.13 (Tizen) boost v1.47 + glic 2.14.90 (Fedora)

Attachments (2)

libchild.cpp (134 bytes ) - added by Christophe Dumez <christophe.dumez@…> 11 years ago.
Library linking against boost date_time with missing symbol
test-dlopen.c (482 bytes ) - added by Christophe Dumez <christophe.dumez@…> 11 years ago.
test app which calls dlopen/dlclose

Download all attachments as: .zip

Change History (4)

by Christophe Dumez <christophe.dumez@…>, 11 years ago

Attachment: libchild.cpp added

Library linking against boost date_time with missing symbol

by Christophe Dumez <christophe.dumez@…>, 11 years ago

Attachment: test-dlopen.c added

test app which calls dlopen/dlclose

comment:1 by Christophe Dumez <christophe.dumez@…>, 11 years ago

In case it matters, I have gcc 4.6.1 and 4.6.2.

comment:2 by Andrey Semashev, 9 years ago

Resolution: invalid
Status: newclosed

I don't think this problem is caused by Boost.DateTime. 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.

Note: See TracTickets for help on using tickets.