From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30940 invoked by alias); 11 Apr 2013 15:02:45 -0000 Mailing-List: contact gdb-prs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-prs-owner@sourceware.org Received: (qmail 30908 invoked by uid 48); 11 Apr 2013 15:02:44 -0000 From: "xavier.bru at bull dot net" To: gdb-prs@sourceware.org Subject: [Bug gdb/15358] New: gdb deadlock due to gdb calling calloc() in signal handler. Date: Thu, 11 Apr 2013 15:02:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: gdb X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: xavier.bru at bull dot net X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 X-SW-Source: 2013-q2/txt/msg00039.txt.bz2 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 #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.