This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug gdb/15358] New: gdb deadlock due to gdb calling calloc() in signal handler.


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]