Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8391297
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T19:13:24+00:00 2026-06-09T19:13:24+00:00

We have some unit tests that often deadlock. Closer inspection with GDB reveals the

  • 0

We have some unit tests that often deadlock. Closer inspection with GDB reveals the following:

Thread 1:

(gdb) bt
#0  0x00110424 in __kernel_vsyscall ()
#1  0x00c681a3 in __lll_lock_wait_private () from /lib/libc.so.6
#2  0x00bf09fb in _L_lock_515 () from /lib/libc.so.6
#3  0x00bf068c in tr_mallochook () from /lib/libc.so.6
#4  0x00bece22 in calloc () from /lib/libc.so.6
#5  0x00b5ed93 in _dl_new_object () from /lib/ld-linux.so.2
#6  0x00b5b287 in _dl_map_object_from_fd () from /lib/ld-linux.so.2
#7  0x00b5c521 in _dl_map_object () from /lib/ld-linux.so.2
#8  0x00b66f43 in dl_open_worker () from /lib/ld-linux.so.2
#9  0x00b629a6 in _dl_catch_error () from /lib/ld-linux.so.2
#10 0x00b66a06 in _dl_open () from /lib/ld-linux.so.2
#11 0x00d38c3b in dlopen_doit () from /lib/libdl.so.2
#12 0x00b629a6 in _dl_catch_error () from /lib/ld-linux.so.2
#13 0x00d3903c in _dlerror_run () from /lib/libdl.so.2
#14 0x00d38b71 in dlopen@@GLIBC_2.1 () from /lib/libdl.so.2
...

Thread 2:

#0  0x00110424 in __kernel_vsyscall ()
#1  0x00d4c059 in __lll_lock_wait () from /lib/libpthread.so.0
#2  0x00d4740e in _L_lock_752 () from /lib/libpthread.so.0
#3  0x00d4731a in pthread_mutex_lock () from /lib/libpthread.so.0
#4  0x00c95dd2 in _dl_addr () from /lib/libc.so.6
#5  0x00bf0425 in tr_where () from /lib/libc.so.6
#6  0x00bf06bd in tr_mallochook () from /lib/libc.so.6
#7  0x00bed01b in malloc () from /lib/libc.so.6
....

I did a lot of searches on the Internet but I can’t really find out whether I am doing something wrong, or whether I have found a bug in the libraries.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T19:13:26+00:00Added an answer on June 9, 2026 at 7:13 pm

    glibc’s dlopen() code doesn’t seem to be thread safe.

    It looks like your code calls malloc() and dlopen() concurrently from two threads. It also looks like malloc() call hits an unresolved dynamic symbol and tries to resolve it using _dl_addr(), which implies that the binary you are executing was linked with lazy binding (default ld behaviour) and this is why the runtime linker resolves symbols on demand on the first call. Try linking it with -Wl,-z,now gcc linker option to cause the runtime linker resolve all symbols prior to starting your application.

    This bug looks similar to the one I filed a bug report against.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some unit tests that expects the 'current time' to be different than
I have some unit tests that I'm writing for a WPF application, and as
I have some Objective-C [i-os] code that I would like to run unit tests
So I have some unit tests that pass in Xcode 3.1 / Leopard. These
I have some unit tests that run fine on my dev machine on both
Currently I have some unit tests that I would like to be executed during
I have some MSTest unit tests that are running just fine on my machine
I have some unit tests set up in my PowerBuilder application that run through
I have some unit tests that use Azure Storage. When running these locally, I
I have some written a number of unit tests that test a wrapper around

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.