pthread_mutex_lock and pthread_mutex_unlock

Michael Neumann mneumann at ntecs.de
Fri Jan 16 08:17:58 PST 2026


On Thu, Jan 15, 2026 at 01:43:33PM +0100, Paul Floyd wrote:
> Hi
> 
> I just noticed that if I put breakpoints on pthread_mutex_lock and
> pthread_mutex_unlock in gdb141 then I don't hit the lock breakpoint until I
> reach main().
> 
> However if I set a breakpoint on _pthread_mutex_lock (with a leading
> underscore) then I stop at

% gdb --version
GNU gdb (GDB) 7.6.1

When I set a "break pthread_mutex_lock" it correctly stops there:

Breakpoint 1, 0x0000000800668c64 in pthread_mutex_lock () from /usr/lib/libpthread.so.0
(gdb) bt
#0  0x0000000800668c64 in pthread_mutex_lock () from /usr/lib/libpthread.so.0
#1  0x0000000000400921 in main ()

I can observe the same behaviour with gdb 15.2:

gdb152 --version
GNU gdb (GDB) 15.2 [GDB v15.2 for DragonFly]

Regards,

  Michael



More information about the Users mailing list