From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Pip Cet Newsgroups: gmane.emacs.bugs Subject: bug#41321: 27.0.91; Emacs aborts due to invalid pseudovector objects Date: Sat, 30 May 2020 18:39:36 +0000 Message-ID: References: <83zha8cgpi.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> <749bc7d0-6376-ec2e-7f84-dcd3a3cea465@cs.ucla.edu> <83sgfjqn49.fsf@gnu.org> <83eer2m0b6.fsf@gnu.org> <83367hn624.fsf@gnu.org> <831rn1mzgp.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="000000000000642ec805a6e1e484" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="5089"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 41321@debbugs.gnu.org, Stefan Monnier To: Paul Eggert Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat May 30 20:41:35 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 1jf6QI-0000ys-Nz for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 30 May 2020 20:41:34 +0200 Original-Received: from localhost ([::1]:42552 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jf6Px-0001Of-NY for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 30 May 2020 14:41:13 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41704) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jf6Pm-0001OY-F0 for bug-gnu-emacs@gnu.org; Sat, 30 May 2020 14:41:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:47667) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jf6Pm-0004qq-5M for bug-gnu-emacs@gnu.org; Sat, 30 May 2020 14:41:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jf6Pm-0003Fl-30 for bug-gnu-emacs@gnu.org; Sat, 30 May 2020 14:41:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Pip Cet Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 30 May 2020 18:41: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.159086402012440 (code B ref 41321); Sat, 30 May 2020 18:41:02 +0000 Original-Received: (at 41321) by debbugs.gnu.org; 30 May 2020 18:40:20 +0000 Original-Received: from localhost ([127.0.0.1]:59213 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jf6P5-0003Ea-Th for submit@debbugs.gnu.org; Sat, 30 May 2020 14:40:20 -0400 Original-Received: from mail-ot1-f50.google.com ([209.85.210.50]:35644) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jf6P4-0003EJ-QI for 41321@debbugs.gnu.org; Sat, 30 May 2020 14:40:19 -0400 Original-Received: by mail-ot1-f50.google.com with SMTP id 69so4650219otv.2 for <41321@debbugs.gnu.org>; Sat, 30 May 2020 11:40:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=1QABPw0WT9R6QOV9iXfuw18zQHP2iuI/X7cqwYaRDIM=; b=q2oK3fvBByI42t2u/733gysXvfy/xs2namlhYpBjtUBzWDu+3Pt77CgXMmHzISlJMm N8PlmQwZNnVMVw/v/X30NTM4b+jtfOl4xvTCeHfwF/wPBMjJfB6MDjPQKbU3qmbJDAfu ZeujjQXzEAhY+x2hiLM8gCKosMLqFx+UTRwvIdBW5CBud6N7RNc9lxsW+MAoz3RtMX8I WtF9MQwTgyRT2Z63exNJlx/8m6U9xFj/doVCSUVifSCWOhOpsfJuu/tJH3dfLxvZtLRT xFRA/gkga6XZbxvbcolwrQ0W+yezOWnG/tSdNUIGrqMXN9nQKjQTqMw4B7f9gWwynDSW PyWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=1QABPw0WT9R6QOV9iXfuw18zQHP2iuI/X7cqwYaRDIM=; b=rtadvKWyWDzqiZ+uQvAhrZSa/q9eJlqzdEzBMqLprQi5o0RCnvnAg+78pve+XunmmB ngEpCaX4Z47tMaZQrPIfQg7IrYsvB159ZqRxrgddd+AkiYG6eiWNLVIDMQcXATDmHp8Q fhyGiHdnkea8z1esr7vAj3yP4Xpaetj7u2sRHHb8gMPmatslAPEWJSa1Cz1Fwtar9yPA 4nh+a7nqig+nEyjL9HX9n+0mTBxtcLtraVTcpdbSEqxCiWe6u0gsOK+q8oqnNDQgAaLx adRuJSRf3+25/dt8kqRfOGiAYoBHEsouXhd0lodWkBMBAmXAEK9AKKlIDdMFEzJRuyJm HEOw== X-Gm-Message-State: AOAM533qYNz5Yfr/aYX3EoLG5gYKhni04YalQ5Zx0KU2O6EbZDg/TAkt zkFyHT4EPkIwmI+YwIfUgT18mB1P0fYuizWR/aI= X-Google-Smtp-Source: ABdhPJxt+EBAp1cSa5oJA3Sk91Hr/vLXgd4sENgcz3cVZ5vEcu2em7N2U51WS1FHnufjup0Or+Yl9RRIrjM2D0FNtEg= X-Received: by 2002:a9d:4c97:: with SMTP id m23mr7393303otf.154.1590864013156; Sat, 30 May 2020 11:40:13 -0700 (PDT) In-Reply-To: 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:181253 Archived-At: --000000000000642ec805a6e1e484 Content-Type: text/plain; charset="UTF-8" On Sat, May 30, 2020 at 6:04 PM Paul Eggert wrote: > On 5/30/20 6:29 AM, Pip Cet wrote: > > I'm surprised, but glad that you think so. Patch for emacs-27 attached. > That patch is on the right track but it's not clear whether it will > cause GC to fail to mark some objects that it should, both because it > omits mark_maybe_object on platforms like x86 --with-wide-int where > alignof (void *) < sizeof (Lisp_Object), and because it skips > mark_maybe_pointer on more-typical platforms where alignof (void *) == > sizeof (Lisp_Object). I've thought about this for a while, but I fail to see the problem with my patch. mark_maybe_object is unnecessary on x86 --with-wide-int, and mark_maybe_pointer (off + lispsym) is unnecessary on platforms that don't rip apart our precious Lisp_Objects. The other call to mark_maybe_pointer isn't skipped. I still think we ought to use yours (and accept a ~25% performance penalty in this particular loop on Eli's platform), but include a comment like the one I had in mine. It might hide further bugs, but that's probably what we want to do on emacs-27. Proposed patch attached. --000000000000642ec805a6e1e484 Content-Type: text/x-patch; charset="US-ASCII"; name="0001-Be-more-aggressive-in-marking-objects-during-GC-bug-.patch" Content-Disposition: attachment; filename="0001-Be-more-aggressive-in-marking-objects-during-GC-bug-.patch" Content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