From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.bugs Subject: bug#41321: 27.0.91; Emacs aborts due to invalid pseudovector objects Date: Thu, 28 May 2020 12:33:10 -0700 Organization: UCLA Computer Science Department Message-ID: <749bc7d0-6376-ec2e-7f84-dcd3a3cea465@cs.ucla.edu> References: <83zha8cgpi.fsf@gnu.org> <83r1vibmyj.fsf@gnu.org> <83imgublku.fsf@gnu.org> <831rncjuwf.fsf@gnu.org> <83h7w5xvfa.fsf@gnu.org> <83y2phwb9x.fsf@gnu.org> <83r1v9w9vi.fsf@gnu.org> <83mu5xw50d.fsf@gnu.org> <83k110wxte.fsf@gnu.org> <4bab5f55-95fe-cf34-e490-1d4319728395@cs.ucla.edu> <837dwyvi74.fsf@gnu.org> <1484f569-c260-9fb0-bfe1-67897de289d3@cs.ucla.edu> <83blm9tn4j.fsf@gnu.org> <4aeb8963-4fd1-fcd4-e6e1-be409ab54775@cs.ucla.edu> <83tuzzrk30.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------51ECAC95726408D85B31C2BA" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="45646"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 Cc: 41321@debbugs.gnu.org, monnier@iro.umontreal.ca, pipcet@gmail.com To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu May 28 21:34:10 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jeOI6-000Bpx-AU for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 28 May 2020 21:34:10 +0200 Original-Received: from localhost ([::1]:53058 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jeOI5-0006dy-Cp for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 28 May 2020 15:34:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48580) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jeOHy-0006dg-J6 for bug-gnu-emacs@gnu.org; Thu, 28 May 2020 15:34:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:41566) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jeOHy-0004it-A0 for bug-gnu-emacs@gnu.org; Thu, 28 May 2020 15:34:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jeOHy-0001aj-8G for bug-gnu-emacs@gnu.org; Thu, 28 May 2020 15:34:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Paul Eggert Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 28 May 2020 19:34:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41321 X-GNU-PR-Package: emacs Original-Received: via spool by 41321-submit@debbugs.gnu.org id=B41321.15906944006030 (code B ref 41321); Thu, 28 May 2020 19:34:02 +0000 Original-Received: (at 41321) by debbugs.gnu.org; 28 May 2020 19:33:20 +0000 Original-Received: from localhost ([127.0.0.1]:53108 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jeOHI-0001ZB-7i for submit@debbugs.gnu.org; Thu, 28 May 2020 15:33:20 -0400 Original-Received: from zimbra.cs.ucla.edu ([131.179.128.68]:45546) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jeOHF-0001Yn-KL for 41321@debbugs.gnu.org; Thu, 28 May 2020 15:33:18 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id B07DE16004F; Thu, 28 May 2020 12:33:11 -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 jYeBiNiMmg2U; Thu, 28 May 2020 12:33:10 -0700 (PDT) Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id C57A31600CC; Thu, 28 May 2020 12:33:10 -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 8CYYYOeU_L0J; Thu, 28 May 2020 12:33:10 -0700 (PDT) Original-Received: from [192.168.1.9] (cpe-23-242-74-103.socal.res.rr.com [23.242.74.103]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 8DC4616004F; Thu, 28 May 2020 12:33:10 -0700 (PDT) Autocrypt: addr=eggert@cs.ucla.edu; prefer-encrypt=mutual; keydata= LS0tLS1CRUdJTiBQR1AgUFVCTElDIEtFWSBCTE9DSy0tLS0tCgptUUlOQkV5QWNtUUJFQURB QXlIMnhvVHU3cHBHNUQzYThGTVpFb243NGRDdmM0K3ExWEEySjJ0QnkycHdhVHFmCmhweHhk R0E5Smo1MFVKM1BENGJTVUVnTjh0TFowc2FuNDdsNVhUQUZMaTI0NTZjaVNsNW04c0thSGxH ZHQ5WG0KQUF0bVhxZVpWSVlYL1VGUzk2ZkR6ZjR4aEVtbS95N0xiWUVQUWRVZHh1NDd4QTVL aFRZcDVibHRGM1dZRHoxWQpnZDdneDA3QXV3cDdpdzdlTnZub0RUQWxLQWw4S1lEWnpiRE5D UUdFYnBZM2VmWkl2UGRlSStGV1FONFcra2doCnkrUDZhdTZQcklJaFlyYWV1YTdYRGRiMkxT MWVuM1NzbUUzUWpxZlJxSS9BMnVlOEpNd3N2WGUvV0szOEV6czYKeDc0aVRhcUkzQUZINmls QWhEcXBNbmQvbXNTRVNORnQ3NkRpTzFaS1FNcjlhbVZQa25qZlBtSklTcWRoZ0IxRApsRWR3 MzRzUk9mNlY4bVp3MHhmcVQ2UEtFNDZMY0ZlZnpzMGtiZzRHT1JmOHZqRzJTZjF0azVlVThN Qml5Ti9iClowM2JLTmpOWU1wT0REUVF3dVA4NGtZTGtYMndCeHhNQWhCeHdiRFZadWR6eERa SjFDMlZYdWpDT0pWeHEya2wKakJNOUVUWXVVR3FkNzVBVzJMWHJMdzYrTXVJc0hGQVlBZ1Jy NytLY3dEZ0JBZndoU In-Reply-To: <83tuzzrk30.fsf@gnu.org> Content-Language: en-US X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:181160 Archived-At: This is a multi-part message in MIME format. --------------51ECAC95726408D85B31C2BA Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit On 5/28/20 11:27 AM, Eli Zaretskii wrote: >> Cc: pipcet@gmail.com, 41321@debbugs.gnu.org, monnier@iro.umontreal.ca >> From: Paul Eggert >> Date: Wed, 27 May 2020 09:58:11 -0700 >> >> we can then talk about what to do with emacs-27. > > After thinking about this some, I think the only sensible thing to do > on emacs-27 is to return to 8-byte alignment test in GC for 32-bit > MinGW builds. That is, replace max_align_t with just 8 in the > definition of LISP_ALIGNMENT in that case. Exactly the same problem can occur for other x86 platforms (e.g., GNU/Linux, GCC 7-and-later, glibc 2.25-and-earlier), because these other platforms also have the bug that malloc can return a pointer that is 8 modulo 16 even though alignof (max_align_t) is 16. so I suggest doing the replacement for those platforms too, as in the attached patch. --------------51ECAC95726408D85B31C2BA Content-Type: text/x-patch; charset=UTF-8; name="0001-Fix-aborts-due-to-GC-losing-pseudovectors.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0001-Fix-aborts-due-to-GC-losing-pseudovectors.patch" >From b3501c978f315d980f7a26481989725d63953558 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Thu, 28 May 2020 12:27:27 -0700 Subject: [PATCH] Fix aborts due to GC losing pseudovectors Problem reported by Eli Zaretskii (Bug#41321). * src/alloc.c (maybe_lisp_pointer): Modulo GCALIGNMENT, not modulo LISP_ALIGNMENT. Master has a more-elaborate fix. Do not merge to master. --- src/alloc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/alloc.c b/src/alloc.c index 1c6b664b22..c7a4a3ee86 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -4589,12 +4589,12 @@ mark_maybe_objects (Lisp_Object const *array, ptrdiff_t nelts) collected, and false otherwise (i.e., false if it is easy to see that P cannot point to Lisp data that can be garbage collected). Symbols are implemented via offsets not pointers, but the offsets - are also multiples of LISP_ALIGNMENT. */ + are also multiples of GCALIGNMENT. */ static bool maybe_lisp_pointer (void *p) { - return (uintptr_t) p % LISP_ALIGNMENT == 0; + return (uintptr_t) p % GCALIGNMENT == 0; } /* If P points to Lisp data, mark that as live if it isn't already -- 2.17.1 --------------51ECAC95726408D85B31C2BA--