From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.bugs Subject: bug#31996: 27.0.50; [w32] while dumping: assertion failed: specpdl_ptr->kind == SPECPDL_UNWIND_PTR && specpdl_ptr->unwind_ptr.func == xfree Date: Thu, 28 Jun 2018 13:55:50 -0700 Organization: UCLA Computer Science Department Message-ID: References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------4D18CF706225B6A373820E83" X-Trace: blaine.gmane.org 1530220198 5820 195.159.176.226 (28 Jun 2018 21:09:58 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 28 Jun 2018 21:09:58 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 Cc: 31996-done@debbugs.gnu.org, Andy Moreton To: Noam Postavsky Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jun 28 23:09:53 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fYeAq-0001PR-4i for geb-bug-gnu-emacs@m.gmane.org; Thu, 28 Jun 2018 23:09:52 +0200 Original-Received: from localhost ([::1]:38702 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fYeCx-0003S4-91 for geb-bug-gnu-emacs@m.gmane.org; Thu, 28 Jun 2018 17:12:03 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49832) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fYdxW-0008OE-AJ for bug-gnu-emacs@gnu.org; Thu, 28 Jun 2018 16:56:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fYdxT-0004cQ-6S for bug-gnu-emacs@gnu.org; Thu, 28 Jun 2018 16:56:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:59266) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fYdxS-0004bn-V8 for bug-gnu-emacs@gnu.org; Thu, 28 Jun 2018 16:56:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fYdxS-0004oc-LN for bug-gnu-emacs@gnu.org; Thu, 28 Jun 2018 16:56:02 -0400 In-Reply-To: Resent-From: Paul Eggert Original-Sender: "Debbugs-submit" Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Thu, 28 Jun 2018 20:56:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 31996 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Mail-Followup-To: 31996@debbugs.gnu.org, eggert@cs.ucla.edu, npostavs@gmail.com Original-Received: via spool by 31996-done@debbugs.gnu.org id=D31996.153021936118498 (code D ref 31996); Thu, 28 Jun 2018 20:56:02 +0000 Original-Received: (at 31996-done) by debbugs.gnu.org; 28 Jun 2018 20:56:01 +0000 Original-Received: from localhost ([127.0.0.1]:38928 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fYdxR-0004oI-Ah for submit@debbugs.gnu.org; Thu, 28 Jun 2018 16:56:01 -0400 Original-Received: from zimbra.cs.ucla.edu ([131.179.128.68]:44984) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fYdxO-0004o4-MB for 31996-done@debbugs.gnu.org; Thu, 28 Jun 2018 16:55:59 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id B4B711607BA; Thu, 28 Jun 2018 13:55:52 -0700 (PDT) Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id 0fUVyW-ri6BG; Thu, 28 Jun 2018 13:55:51 -0700 (PDT) Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id E40A7160780; Thu, 28 Jun 2018 13:55:51 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id YnHK_e7kZFWL; Thu, 28 Jun 2018 13:55:51 -0700 (PDT) Original-Received: from [192.168.1.9] (unknown [47.154.30.119]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 8EADA1607BA; Thu, 28 Jun 2018 13:55:51 -0700 (PDT) Openpgp: preference=signencrypt Autocrypt: addr=eggert@cs.ucla.edu; prefer-encrypt=mutual; keydata= xsFNBEyAcmQBEADAAyH2xoTu7ppG5D3a8FMZEon74dCvc4+q1XA2J2tBy2pwaTqfhpxxdGA9 Jj50UJ3PD4bSUEgN8tLZ0san47l5XTAFLi2456ciSl5m8sKaHlGdt9XmAAtmXqeZVIYX/UFS 96fDzf4xhEmm/y7LbYEPQdUdxu47xA5KhTYp5bltF3WYDz1Ygd7gx07Auwp7iw7eNvnoDTAl KAl8KYDZzbDNCQGEbpY3efZIvPdeI+FWQN4W+kghy+P6au6PrIIhYraeua7XDdb2LS1en3Ss mE3QjqfRqI/A2ue8JMwsvXe/WK38Ezs6x74iTaqI3AFH6ilAhDqpMnd/msSESNFt76DiO1ZK QMr9amVPknjfPmJISqdhgB1DlEdw34sROf6V8mZw0xfqT6PKE46LcFefzs0kbg4GORf8vjG2 Sf1tk5eU8MBiyN/bZ03bKNjNYMpODDQQwuP84kYLkX2wBxxMAhBxwbDVZudzxDZJ1C2VXujC OJVxq2kljBM9ETYuUGqd75AW2LXrLw6+MuIsHFAYAgRr7+KcwDgBAfwhPBYX34nSSiHlmLC+ KaHLeCLF5ZI2vKm3HEeCTtlOg7xZEONgwzL+fdKo+D6SoC8RRxJKs8a3sVfI4t6CnrQzvJbB n6gxdgCu5i29J1QCYrCYvql2UyFPAK+do99/1jOXT4m2836j1wARAQABzSBQYXVsIEVnZ2Vy dCA8ZWdnZXJ0QGNzLnVjbGEuZWR1PsLBfgQTAQIAKAUCTIByZAIbAwUJEswDAAYLCQgHAwIG FQgCCQoLBBYCAwECH Content-Language: en-US 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:147927 Archived-At: This is a multi-part message in MIME format. --------------4D18CF706225B6A373820E83 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Thanks for reporting that. I didn't observe the problem on Fedora 28. Anyway, I installed the attached patch, which should fix it. --------------4D18CF706225B6A373820E83 Content-Type: text/x-patch; name="0001-Fix-recently-introduced-SAFE_FREE-bug.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0001-Fix-recently-introduced-SAFE_FREE-bug.patch" >From ddc4371a89e5500e0203bed4b0ad453925b1c74f Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Thu, 28 Jun 2018 13:49:48 -0700 Subject: [PATCH] Fix recently-introduced SAFE_FREE bug Problem reported by Andy Moreton (Bug#31996). * src/lisp.h (union specbinding.unwind_array): Remove unused member func. Move array after nelts, as this is likely to generate more efficient code in safe_free, which can call xfree with the same value either way. (safe_free): Also handle SPECPDL_UNWIND_AWAY. --- src/lisp.h | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/lisp.h b/src/lisp.h index b544d81..cf7b8c0 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -3058,9 +3058,8 @@ union specbinding } unwind; struct { ENUM_BF (specbind_tag) kind : CHAR_BIT; - void (*func) (Lisp_Object); - Lisp_Object *array; ptrdiff_t nelts; + Lisp_Object *array; } unwind_array; struct { ENUM_BF (specbind_tag) kind : CHAR_BIT; @@ -4543,9 +4542,16 @@ safe_free (ptrdiff_t sa_count) while (specpdl_ptr != specpdl + sa_count) { specpdl_ptr--; - eassert (specpdl_ptr->kind == SPECPDL_UNWIND_PTR - && specpdl_ptr->unwind_ptr.func == xfree); - xfree (specpdl_ptr->unwind_ptr.arg); + if (specpdl_ptr->kind == SPECPDL_UNWIND_PTR) + { + eassert (specpdl_ptr->unwind_ptr.func == xfree); + xfree (specpdl_ptr->unwind_ptr.arg); + } + else + { + eassert (specpdl_ptr->kind == SPECPDL_UNWIND_ARRAY); + xfree (specpdl_ptr->unwind_array.array); + } } } -- 2.7.4 --------------4D18CF706225B6A373820E83--