From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Robert Pluim Newsgroups: gmane.emacs.bugs Subject: bug#58288: 29.0.50; (flyspell-correct-word-before-point) followed by crashes emacs Date: Wed, 05 Oct 2022 12:01:03 +0200 Message-ID: <87k05e8u8w.fsf@gmail.com> References: <877d1f3kgj.fsf@gnus.org> <83tu4jvkfz.fsf@gnu.org> <87zgeb91ac.fsf@gmail.com> <83mtabvgxw.fsf@gnu.org> <87pmf78vta.fsf@gmail.com> <83fsg3v9fb.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7716"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 58288@debbugs.gnu.org, larsi@gnus.org, ajd2195@columbia.edu To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Oct 05 12:04:12 2022 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 1og1G8-0001sH-Ja for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 05 Oct 2022 12:04:12 +0200 Original-Received: from localhost ([::1]:45104 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1og1G7-0001ux-Cj for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 05 Oct 2022 06:04:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42676) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1og1E3-0008Nb-FY for bug-gnu-emacs@gnu.org; Wed, 05 Oct 2022 06:02:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:56845) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1og1E2-00077j-3H for bug-gnu-emacs@gnu.org; Wed, 05 Oct 2022 06:02:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1og1E1-0004Xp-Ua for bug-gnu-emacs@gnu.org; Wed, 05 Oct 2022 06:02:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Robert Pluim Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 05 Oct 2022 10:02:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58288 X-GNU-PR-Package: emacs Original-Received: via spool by 58288-submit@debbugs.gnu.org id=B58288.166496407317416 (code B ref 58288); Wed, 05 Oct 2022 10:02:01 +0000 Original-Received: (at 58288) by debbugs.gnu.org; 5 Oct 2022 10:01:13 +0000 Original-Received: from localhost ([127.0.0.1]:55923 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1og1DE-0004Wo-PQ for submit@debbugs.gnu.org; Wed, 05 Oct 2022 06:01:13 -0400 Original-Received: from mail-wr1-f49.google.com ([209.85.221.49]:46903) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1og1DD-0004Wc-8N for 58288@debbugs.gnu.org; Wed, 05 Oct 2022 06:01:12 -0400 Original-Received: by mail-wr1-f49.google.com with SMTP id bk15so25153295wrb.13 for <58288@debbugs.gnu.org>; Wed, 05 Oct 2022 03:01:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:from:to:cc:subject:date:message-id :reply-to; bh=xhnxLeXoTMFCCPDp2x4Fws5lAjo9Sz3rjjwz9V2tQws=; b=M0IKotIwJbBjFqF6IUoOFqL7e/FBd/vofgXY39G788bzqt0yBOCNOB+p1+6Td1gbCV FdaN3Gr95S/2YVqP+3VM4qpWY93p+DrJZT0cA3bs43X+kRzor/iR1fmNwvzG2jDLKO5K cxCrgJfgimfMPiM9RwZ6AJuZan83WIjp+P7epBjEgw7fPhn592WWtIkNaagMAE6rI6GN Qo4tE4OM7D6NzrGLQgPguag4bLX8zcBMhxWuQApbiBoqA/OiggYiJWTn5RWLEPHrFQbB sWKQeYlECQUEaiU5ITkQJSsiUs8JSVYZYOxpVyrUhPoAeNFH8W5Ey3nkdHMSQPpYlCnZ 231g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xhnxLeXoTMFCCPDp2x4Fws5lAjo9Sz3rjjwz9V2tQws=; b=PYUfW2D+GSHYuao16m+W33mQRSoQd0TWGk8O9pzBGIN90YLSPwA8sFx64eHv9KGMHT lCWY6MHVrZSotTyWwOv/VYaGVNdFIPAmExy8U9fisnNCQO5Uw5Yueql4IXx2wc597S30 G4ARB/LaaXk935Dgth3X5yrbwgAh0ULdocZ/51Zlz6Y1JNqtE7ipg2H5rYHTURWVIYZJ cezzKMqIaXW5MYxj9zC/pb/nuIeFUNeD629CuLA/4pZLZ8vZVlfMfXEcps129+6rfRbh oiQfOjYWBS8p103XM59d5fMf1FKAm6u5jIS4hQ6sdwnTVtCUv7oac/Kcoi7l4EfcTNMU NO3A== X-Gm-Message-State: ACrzQf1zOVYd5TdESzHrHwQEuHvY4YS/kHVhUTaGPSImH8YyrW77WzNl Z9JcDGGsWmeDPMFJF6lIEkw= X-Google-Smtp-Source: AMsMyM5XabPTVS42hpDP2URWz8m1u2taNyI3Qh0vfCOv6qc/wI9l/Ye6PgEG1aAXljbCRZcTzaUFBg== X-Received: by 2002:adf:fec6:0:b0:22e:3218:f7e1 with SMTP id q6-20020adffec6000000b0022e3218f7e1mr11492597wrs.522.1664964064986; Wed, 05 Oct 2022 03:01:04 -0700 (PDT) Original-Received: from rltb ([2a01:e0a:3f3:fb50:37a5:6c3e:78d8:b7fc]) by smtp.gmail.com with ESMTPSA id l1-20020a5d6741000000b0022cdf2179b2sm9226407wrw.68.2022.10.05.03.01.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Oct 2022 03:01:04 -0700 (PDT) In-Reply-To: <83fsg3v9fb.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 04 Oct 2022 19:30:00 +0300") 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:244501 Archived-At: >>>>> On Tue, 04 Oct 2022 19:30:00 +0300, Eli Zaretskii said: >> It=CA=BCs being set up, but menu_items is ending up as Qnil for some= reason >> (I suspect something is going wrong with save_menu_items). Eli> GC, perhaps? No, not GC. frame #1: 0x00000001000754e0 emacs`find_and_return_menu_selection(f=3D0x000= 06210000c1530, keymaps=3Dfalse, client_data=3D0x00006210006854e8) at menu.c= :989:11 986 987 while (i < menu_items_used) 988 { -> 989 if (NILP (AREF (menu_items, i))) 990 { 991 subprefix_stack[submenu_depth++] =3D prefix; 992 prefix =3D entry; (lldb) p menu_items_used (int) $36 =3D 59 (lldb) p menu_items (Lisp_Object) $37 =3D NULL So the code is assuming that menu_items_used > 0 means that menu_items is valid, but we have this in menu.c: void save_menu_items (void) { Lisp_Object saved =3D list4 (menu_items_inuse ? menu_items : Qnil, make_fixnum (menu_items_used), make_fixnum (menu_items_n_panes), make_fixnum (menu_items_submenu_depth)); record_unwind_protect (restore_menu_items, saved); menu_items_inuse =3D false; menu_items =3D Qnil; } This fixes it, but it seems a bit dodgy to me, why has no other platform ever run into this? diff --git a/src/menu.c b/src/menu.c index eeb0c9a7e5..a368da373b 100644 --- a/src/menu.c +++ b/src/menu.c @@ -147,7 +147,7 @@ restore_menu_items (Lisp_Object saved) void save_menu_items (void) { - Lisp_Object saved =3D list4 (menu_items_inuse ? menu_items : Qnil, + Lisp_Object saved =3D list4 (menu_items, make_fixnum (menu_items_used), make_fixnum (menu_items_n_panes), make_fixnum (menu_items_submenu_depth)); Robert --=20