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.diffs,gmane.emacs.devel Subject: Re: master 9227864: Further fix for aborts due to GC losing pseudovectors Date: Tue, 26 May 2020 06:40:49 +0000 Message-ID: References: <20200526060645.22243.34109@vcs0.savannah.gnu.org> <20200526060646.662E120A2C@vcs0.savannah.gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="125846"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-diffs@gnu.org To: emacs-devel@gnu.org, Paul Eggert Original-X-From: emacs-diffs-bounces+gnu-emacs-diffs=m.gmane-mx.org@gnu.org Tue May 26 08:41:36 2020 Return-path: Envelope-to: gnu-emacs-diffs@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 1jdTHM-000Weg-6P for gnu-emacs-diffs@m.gmane-mx.org; Tue, 26 May 2020 08:41:36 +0200 Original-Received: from localhost ([::1]:39788 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jdTHL-0002iH-6W for gnu-emacs-diffs@m.gmane-mx.org; Tue, 26 May 2020 02:41:35 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36454) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jdTHG-0002hn-T2; Tue, 26 May 2020 02:41:30 -0400 Original-Received: from mail-ot1-x32b.google.com ([2607:f8b0:4864:20::32b]:35025) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jdTHF-0005qy-RN; Tue, 26 May 2020 02:41:30 -0400 Original-Received: by mail-ot1-x32b.google.com with SMTP id 69so15456273otv.2; Mon, 25 May 2020 23:41:29 -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=OyUukl+rkSw5rRJfLcZcOtVjRvIClqy6NpGFOrfzJxs=; b=o3oRRzO+/FF12CCFv4zwbYS8YYqkPPELs0/sav+E+vaHK8DBtadbzBLO5kRvX+9gT5 k2upL9XABZbOVUvm5famZI1OjRcnbrZP5r38AIhjTw8YJzlZd2Zb4ZSoZXqW0asEL1Go cuYZ8xAA3qrxL7T8wGzxwJQsYdbj8bUKM6omJT0wyIXIE41GsgSJYgJGZi269+QutrPt 1LSG3ibpi5rNa2GcqTVkcbYeGxDh1Y7UCy1tiJ2OhLdtxhgPMAIc5vXeLBqHq+XispeB QVICjSuYFD18TvaOmPOAE7B+lCgcT5sa4z2MvR9K/93ukQcVcGo8uJh48Xv0yc5Br7Os Eqfw== 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=OyUukl+rkSw5rRJfLcZcOtVjRvIClqy6NpGFOrfzJxs=; b=k+DddSGJ349JVdViIpvv83xgvvOddQ4sv491Y4s0h5BtrAmjRi9QwWfM6fzYTs4+t0 eQYG6iSRSgEXKL4KjIinZpjtCpXo1Tq642jz7hJqio9ngyAevFxvB4o/WpuYv2OKoFhA uXF2KSrkSAmj4s0AlygZDGOJIeXv/8fZuexSLFK4eTa1eLDtUcLxFQp5JIsbqP8Nbd2h qtkefPRT37Ke3TDssO7F9UqGxcXUx8GOWHrvab5MGwwFmKYbIjpOj/i+3h4GRabrql/6 S1zEQdy/2s6/hPjltUPzRTfvP9SWiASr6tdg8Fx4ignMkaq3GgLr+K4g3cvMCo3Hx/xD f66g== X-Gm-Message-State: AOAM533d1NzPRYtSDm0f71nvEq+bRxVrtey9aYvVHbGwixAOQNjIx9fw AFHmzqqaYQsPRipoRd1k0YDOuwMPguHkF0t2uK/6vO0A X-Google-Smtp-Source: ABdhPJwOwSpWJYn3n1q+gwpGsKTmijD+SUKQauX1GYAPBDJH4Mb84PwxBBPqjXd9+EdUlZWsquEq0pS4djxqFRaE0Uc= X-Received: by 2002:a9d:6a44:: with SMTP id h4mr24194196otn.287.1590475288198; Mon, 25 May 2020 23:41:28 -0700 (PDT) In-Reply-To: <20200526060646.662E120A2C@vcs0.savannah.gnu.org> Received-SPF: pass client-ip=2607:f8b0:4864:20::32b; envelope-from=pipcet@gmail.com; helo=mail-ot1-x32b.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: emacs-diffs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Mailing list for Emacs changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-diffs-bounces+gnu-emacs-diffs=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-diffs" Xref: news.gmane.io gmane.emacs.diffs:156308 gmane.emacs.devel:251431 Archived-At: On Tue, May 26, 2020 at 6:06 AM Paul Eggert wrote: > Further fix for aborts due to GC losing pseudovectors I don't understand this change. It makes the code much more complicated, all for hypothetical systems that require alignment > 8 for a hypothetical 16-byte data type in a Lisp structure. > + multiple of LISP_ALIGNMENT. This works even for buggy platforms > + like MinGW circa 2020, where alignof (max_align_t) is 16 even though > + the malloc alignment is only 8, and where Emacs still works because > + it never does anything that requires an alignment of 16. */ I think we should be specific here and say it's the mingw.org 32-bit version (or whatever Eli's using) only that has problems. mingw64 is fine, I believe, and the normal mingw32 version is buggy but our header inclusion order happens to get things right, so there are no crashes. > static bool > maybe_lisp_pointer (void *p) > { > - return (uintptr_t) p % LISP_ALIGNMENT == 0; > + return (uintptr_t) p % GCALIGNMENT == 0; > } This is the only change that I understand is necessary. > - generate better code. > + generate better code. Also, such structs should be added to the > + emacs_align_type union. That's going to be a maintenance nightmare, since failures to do so won't actually show up on real machines, and a lot of wasted memory if someone does add an AVX512 type. I'd prefer a simple warning not to use long double or similarly unusual types in pseudovectors, and an eassert (see below) to catch it if people do that. > +/* A type with alignment at least as large as any object that Emacs > + allocates. This is not max_align_t because some platforms (e.g., > + mingw) have buggy malloc implementations that do not align for > + max_align_t. This union contains types of all GCALIGNED_STRUCT I think a simple eassert (GCALIGNMENT % alignof (type) == 0) in an (inlined, obviously) version of allocate_pseudovector should suffice to catch this hypothetical problem.