From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andreas Gustafsson Newsgroups: gmane.emacs.bugs Subject: bug#22790: 24.5; Infinite loop involving malloc called from signal handler Date: Thu, 7 Jul 2016 19:24:09 +0300 Message-ID: <22398.33321.545313.217115@guava.gson.org> References: <83povmgfnn.fsf@gnu.org> <22228.22862.708667.152490@guava.gson.org> <838u1yzij7.fsf@gnu.org> <22233.39509.879175.437974@guava.gson.org> <83ziuexogp.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1467908997 12726 80.91.229.3 (7 Jul 2016 16:29:57 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 7 Jul 2016 16:29:57 +0000 (UTC) Cc: Andreas Gustafsson , 22790@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jul 07 18:29:48 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bLCBP-0002nD-2O for geb-bug-gnu-emacs@m.gmane.org; Thu, 07 Jul 2016 18:29:47 +0200 Original-Received: from localhost ([::1]:41109 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bLCBO-00027t-1s for geb-bug-gnu-emacs@m.gmane.org; Thu, 07 Jul 2016 12:29:46 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52200) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bLC6u-0004Ji-CV for bug-gnu-emacs@gnu.org; Thu, 07 Jul 2016 12:25:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bLC6p-0005w6-C1 for bug-gnu-emacs@gnu.org; Thu, 07 Jul 2016 12:25:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:57301) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bLC6o-0005vP-6B for bug-gnu-emacs@gnu.org; Thu, 07 Jul 2016 12:25:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bLC6o-0000hs-27 for bug-gnu-emacs@gnu.org; Thu, 07 Jul 2016 12:25:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Andreas Gustafsson Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 07 Jul 2016 16:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22790 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo Original-Received: via spool by 22790-submit@debbugs.gnu.org id=B22790.14679086542655 (code B ref 22790); Thu, 07 Jul 2016 16:25:02 +0000 Original-Received: (at 22790) by debbugs.gnu.org; 7 Jul 2016 16:24:14 +0000 Original-Received: from localhost ([127.0.0.1]:41405 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bLC62-0000gl-Bl for submit@debbugs.gnu.org; Thu, 07 Jul 2016 12:24:14 -0400 Original-Received: from gusto.araneus.fi ([185.55.84.130]:52864) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bLC60-0000gc-Hl for 22790@debbugs.gnu.org; Thu, 07 Jul 2016 12:24:13 -0400 Original-Received: from guava.gson.org (unknown [10.0.1.240]) by gusto.araneus.fi (Postfix) with ESMTP id DBDAF8BE302; Thu, 7 Jul 2016 16:24:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=gson.org; s=mail; t=1467908650; bh=m/kbkrLDaWzwqKJkkrmcX7Nu6TKeoU6eqR4maXHMCQA=; h=Date:To:Cc:Subject:In-Reply-To:References:From; b=byzDb6Iz2FJmzPJTFyeI1OQN7r58yhOpI2JSu2D/FAJ8USHnmkoXoGFx1qSAguJ+1 8DdtlqWZHK1i/rqZPz5m9B2oNxDU2btl6T9KPmYNJk0+3CC+P/YYx/gnbHUNjysb1O VoO9nGQ93hO+i1QnkdBk+2HjF/uG79Qm7ncohGhs= Original-Received: by guava.gson.org (Postfix, from userid 101) id BF6FA74466B; Thu, 7 Jul 2016 19:24:09 +0300 (EEST) In-Reply-To: Re: <83ziuexogp.fsf@gnu.org> X-Mailer: VM 8.2.0b under 24.5.1 (x86_64--netbsd) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:120576 Archived-At: In March, Eli Zaretskii wrote: > In any case, if those printf's are the culprit, they are no longer > there in the current sources of what will soon become Emacs 25.1. > They were replaced with direct calls to 'write'. So if we are sure > there's no other problem that causes these loops, we can close this > bug. Eliminating the printf calls has mostly fixed the problem for me, but not completely. I just had my emacs 24 (which I have patched to eliminate the printf calls) go into a loop again, following a control-G and the usual "Auto-save?" and "Abort (and dump core)?" dialog, but now with the following backtrace: (gdb) where #0 pthread__mutex_spin (ptm=ptm@entry=0xaea860 <_malloc_mutex>, owner=) at /bracket/prod/7.0gson1/src/lib/libpthread/pthread_mutex.c:204 #1 0x00007f7ff680b73b in pthread__mutex_lock_slow (ptm=0xaea860 <_malloc_mutex>) at /bracket/prod/7.0gson1/src/lib/libpthread/pthread_mutex.c:288 #2 0x00000000005c5307 in _free_internal (ptr=0x2a71000) at gmalloc.c:1268 #3 0x00000000005c5362 in free (ptr=0x2a71000) at gmalloc.c:1283 #4 0x0000000000533e4e in xfree (block=0x2a71000) at alloc.c:735 #5 0x000000000055abd2 in unbind_to (count=4, value=11933746) at eval.c:3304 #6 0x00000000005562e4 in unwind_to_catch (catch=0xfc4500, value=33964454) at eval.c:1161 #7 0x0000000000557203 in Fsignal (error_symbol=12003810, data=11933746) at eval.c:1557 #8 0x00000000004daf23 in handle_interrupt (in_signal_handler=true) at keyboard.c:10440 #9 0x00000000004dac4a in handle_interrupt_signal (sig=2) at keyboard.c:10288 #10 0x00000000004e8092 in deliver_process_signal (sig=2, handler=0x4dabfd ) at sysdep.c:1570 #11 0x00000000004dac66 in deliver_interrupt_signal (sig=2) at keyboard.c:10295 #12 0x00007f7ff5c9f3f0 in _opendir (name=) at /bracket/prod/7.0gson1/src/lib/libc/gen/opendir.c:72 #13 0x00007fff00000002 in ?? () #14 0x0000000000000000 in ?? () Calling free() from a signal handler is of course incorrect for the same reasons calling printf() is. I have not yet checked if emacs 25 has the same bug. -- Andreas Gustafsson, gson@gson.org