From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#12242: Emacs 24.2 RC1 build fails on OpenBSD Date: Fri, 24 Aug 2012 11:46:05 +0300 Message-ID: <83obm08ype.fsf@gnu.org> References: <877gstuyqb.fsf@moo.wxcvbn.org> <83txvxaquu.fsf@gnu.org> <83obm4b367.fsf@gnu.org> <837gsrbpe9.fsf@gnu.org> <83y5l6amor.fsf@gnu.org> <87vcg93cvg.fsf@gnu.org> <83k3wpa8i3.fsf@gnu.org> <87obm10y55.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE X-Trace: ger.gmane.org 1345798071 30545 80.91.229.3 (24 Aug 2012 08:47:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 24 Aug 2012 08:47:51 +0000 (UTC) Cc: 12242@debbugs.gnu.org, jca@wxcvbn.org, handa@m17n.org To: Chong Yidong Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Aug 24 10:47:51 2012 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 1T4pYO-0000Fc-VF for geb-bug-gnu-emacs@m.gmane.org; Fri, 24 Aug 2012 10:47:45 +0200 Original-Received: from localhost ([::1]:38755 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T4pYN-0002tb-Df for geb-bug-gnu-emacs@m.gmane.org; Fri, 24 Aug 2012 04:47:43 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:48009) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T4pY9-0002Ng-5E for bug-gnu-emacs@gnu.org; Fri, 24 Aug 2012 04:47:34 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T4pY8-0000iT-19 for bug-gnu-emacs@gnu.org; Fri, 24 Aug 2012 04:47:29 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:36740) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T4pY7-0000iJ-Tz for bug-gnu-emacs@gnu.org; Fri, 24 Aug 2012 04:47:27 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1T4pYg-0002AA-2n for bug-gnu-emacs@gnu.org; Fri, 24 Aug 2012 04:48:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 24 Aug 2012 08:48:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 12242 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 12242-submit@debbugs.gnu.org id=B12242.13457980348257 (code B ref 12242); Fri, 24 Aug 2012 08:48:02 +0000 Original-Received: (at 12242) by debbugs.gnu.org; 24 Aug 2012 08:47:14 +0000 Original-Received: from localhost ([127.0.0.1]:46284 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1T4pXt-000297-OA for submit@debbugs.gnu.org; Fri, 24 Aug 2012 04:47:14 -0400 Original-Received: from mtaout21.012.net.il ([80.179.55.169]:64642) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1T4pXq-00028y-FA for 12242@debbugs.gnu.org; Fri, 24 Aug 2012 04:47:12 -0400 Original-Received: from conversion-daemon.a-mtaout21.012.net.il by a-mtaout21.012.net.il (HyperSendmail v2007.08) id <0M9900A004BJCU00@a-mtaout21.012.net.il> for 12242@debbugs.gnu.org; Fri, 24 Aug 2012 11:45:55 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout21.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0M9900AVC4CIBY10@a-mtaout21.012.net.il>; Fri, 24 Aug 2012 11:45:55 +0300 (IDT) In-reply-to: <87obm10y55.fsf@gnu.org> X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:63447 Archived-At: > From: Chong Yidong > Cc: mituharu@math.s.chiba-u.ac.jp, monnier@iro.umontreal.ca, hand= a@m17n.org, jca@wxcvbn.org, 12242@debbugs.gnu.org > Date: Fri, 24 Aug 2012 11:25:26 +0800 >=20 > > Can I have a 1-day grace to try debugging the OpenBSD crash? J= =C3=A9r=C3=A9mie > > generously gave me a login on the machine where it happened, and = I'd > > like a chance to try debugging it. >=20 > OK. Good luck, and thanks for all your efforts with this bug. I committed a fix for this as emacs-24 branch revision 108120. It is somewhat of a phenomenological nature, because I could not actually catch the entire sequence of calls and actions leading to the crash, which might have allowed me to fix the root cause where it happens, i= f possible. (It turns out OpenBSD doesn't have hardware watchpoints support in GDB, which makes catching references to variables painfull= y slow, certainly when a deadline is looming.) I did see that the crash happens because a 'heap' structure recorded in a memory control block maintained by ralloc.c refers to addresses that aren't managed as part of the linked list of 'heap' structures. It is therefore wrong to dereference such bogus 'heap' structures to update them. The crash happens because 'heap' pointed to memory that was beyond our break point; however, I found that we dereference such bogus 'heap's in more places, and survive that only because, by sheer luck, they are still within our address space. (ralloc.c does not relinquish memory to the system until it has enough excess memory to justify that.) The solution I checked in is not to dereference 'heap' pointers that are not in the linked list of heaps we maintain. The fixed version survived the command that crashed and in addition 3 different bootstraps, one on OpenBSD where the crash happened and 2 more (optimized and unoptimized) on MS-Windows. I also checked that the MS-DOS build, which also uses ralloc.c, still works OK with the offending commands after the patch. Those are the only systems I hav= e access to which use ralloc.c. I do suggest another pretest, to make sure this fix is solid. I will also work on the trunk on removing calls to xmalloc inside the functions called by maybe_unify_char, which should probably eliminate the original problem (although they also call to make-char-table, which still allocates memory, albeit in smaller chunks). Thanks.