public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/15358] New: gdb deadlock due to gdb calling calloc() in signal handler.
@ 2013-04-11 15:02 xavier.bru at bull dot net
  2013-04-12  8:35 ` [Bug gdb/15358] " jan.kratochvil at redhat dot com
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: xavier.bru at bull dot net @ 2013-04-11 15:02 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=15358

             Bug #: 15358
           Summary: gdb deadlock due to gdb calling calloc() in signal
                    handler.
           Product: gdb
           Version: 7.2
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gdb
        AssignedTo: unassigned@sourceware.org
        ReportedBy: xavier.bru@bull.net
    Classification: Unclassified


Created attachment 6976
  --> http://sourceware.org/bugzilla/attachment.cgi?id=6976
Traces of manually reprucing the deadlock in calloc()

gdb calls calloc() in signal hanler. It seems that this function is not
reentrant.
If gdb catches a signal in calloc(), it can sometimes deadlock, due to calling
calloc() in the signal handler. 


Version-Release number of selected component (if applicable): gdb-7.2-56


How reproducible: Can be reproduced manually using gdb to stop in calloc().
See attached traces .


Steps to Reproduce:
1. run gdb on gdb
2. set a breakpoint in calloc() after the cmpxchg instruction
3.  send a SIGTERM to gdb

Actual results:
gdb deadlocks


Expected results:
gdb should catch the signal and exit

Additional info:
On HPC cluster, gdb is used a lot by padb, ddt, etc with
a lot of parallel applications and it's very difficult to reproduce the issue
in a testcase, but it has already been found in the deadlock (hereafter a trace
on RHEL 6.1) :

# ps -ef | grep gdb
user   85753    1  0 15:04 ? 00:00:01 gdb --interpreter=mi -q
# gstack 85753
#0 0x000003405ef542e in __lll__lock_wait_private () from /lib64/libc.so.6
#1 0x000003405e7943b in _L_lock_8926 () from /lib64/libc.so.6
#2 0x000003405e7943b in calloc () from /lib64/libc.so.6
#3 0x0000000004159f9 in ?? ()
#4 0x000000000513b7b in ?? ()
#5 0x000000000513cbe in ?? ()
#6 0x0000000004134b7 in ?? ()
#7 <signal handler called>
#8 0x000003405e7a6e4 in _int_realloc () from /lib64/libc.so.6
#9 0x000003405e7aaf5 in realloc () from /lib64/libc.so.6
#10 0x000000000415a5d in ?? ()
#11 0x00000000054e873 in ?? ()
#12 0x000000000557094 in ?? ()
....
#41 0x000000000409869 in ?? ()
#42 0x000003405e1ecdd in __libc_start_main () from /lib64/libc.so.6
....
#50 0x000000000000000 in ?? ()
#

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2023-02-15 21:34 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-11 15:02 [Bug gdb/15358] New: gdb deadlock due to gdb calling calloc() in signal handler xavier.bru at bull dot net
2013-04-12  8:35 ` [Bug gdb/15358] " jan.kratochvil at redhat dot com
2013-04-15  5:10 ` xavier.bru at bull dot net
2013-06-17  6:30 ` jan.kratochvil at redhat dot com
2013-06-17 14:00 ` tromey at redhat dot com
2013-07-01 20:36 ` jan.kratochvil at redhat dot com
2013-07-03  5:31 ` jan.kratochvil at redhat dot com
2014-03-14 18:38 ` jan.kratochvil at redhat dot com
2014-03-14 18:46 ` jan.kratochvil at redhat dot com
2014-03-18 21:51 ` cvs-commit at gcc dot gnu.org
2014-03-18 21:52 ` jan.kratochvil at redhat dot com
2023-02-15 21:34 ` pedro at palves dot net

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).