From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Pip Cet via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#71744: 29.4; SIGSEGV during completion-at-point in lsp-mode with corfu and cape Date: Wed, 14 Aug 2024 17:03:37 +0000 Message-ID: <87sev711ga.fsf@protonmail.com> References: <86mslf8axb.fsf@gnu.org> <86ed6r8535.fsf@gnu.org> <86cymb846o.fsf@gnu.org> Reply-To: Pip Cet 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="7183"; mail-complaints-to="usenet@ciao.gmane.io" Cc: sigve.indregard@pm.me, 71744@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Aug 14 19:04:46 2024 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 1seHQT-0001fV-Ok for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 14 Aug 2024 19:04:45 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1seHQD-0007QU-EH; Wed, 14 Aug 2024 13:04:29 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1seHQB-0007Py-IF for bug-gnu-emacs@gnu.org; Wed, 14 Aug 2024 13:04:27 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1seHQB-00056C-9G for bug-gnu-emacs@gnu.org; Wed, 14 Aug 2024 13:04:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:From:Date:To:Subject; bh=ki8L+VeOlE9eSKn2opRh1RaEKg7KuNJQQLcokMUJ6Jo=; b=LyaFnCszpDcQvZ/4/te1Fy1HGDKtObPNAPPVyNXcrqE568DjbnLA/87ZqRtbXJEUYdPjGMIXJ8La3bQFx5lZaaUUETfECJ86sWA9yGozqtRe5FTtcvH7RYqUPFTqJUuW5XVfIG/fAdUAFHqxldtQno6ippScjLNo4Gvyfto47A67SMMsmvwbR13OZy7vI18tov2wKLQfYzPSr+pgaFh1orxc845KfUfl2hv+NtiJzJbXTet3lnhHWQLOVDATZsQPgHt/kOtp7mFSWhSVCgRQ69Gzh/YozNBJkuIiE4t0HHqnRRbcD5ORwrJi6+WZHhj6HOENsxGuXmSui4BwZ5/ZXg==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1seHQj-0002iX-VR for bug-gnu-emacs@gnu.org; Wed, 14 Aug 2024 13:05:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Pip Cet Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 14 Aug 2024 17:05:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71744 X-GNU-PR-Package: emacs Original-Received: via spool by 71744-submit@debbugs.gnu.org id=B71744.172365506610361 (code B ref 71744); Wed, 14 Aug 2024 17:05:01 +0000 Original-Received: (at 71744) by debbugs.gnu.org; 14 Aug 2024 17:04:26 +0000 Original-Received: from localhost ([127.0.0.1]:47333 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1seHQA-0002h2-EB for submit@debbugs.gnu.org; Wed, 14 Aug 2024 13:04:26 -0400 Original-Received: from mail-4316.protonmail.ch ([185.70.43.16]:35433) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1seHQ8-0002gj-0B for 71744@debbugs.gnu.org; Wed, 14 Aug 2024 13:04:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1723655022; x=1723914222; bh=ki8L+VeOlE9eSKn2opRh1RaEKg7KuNJQQLcokMUJ6Jo=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=OAHZIGlt4soahzW8SnBjOmBTaDlR7cpIFiZnmBHKuNURp8cnhLbzQNT8InATNx+b6 rMv7/Ri8pz1ZTTtfw6zO0kAalhNxtOadVtlNOQCEoLzhBD/eEoOZxIRKTiK+zvHZis AmTj/NylkWD0t7t4qxT9AzUvwYcDoSMjwC8mSzbzcgw49aIqdtQZ3sSpjvvR8Mhuhe Iw+ofOMTJ82JsIpkv9TY2xKQaogOyPLsOLQ/Yi3ow+Xi30mcLDtvZh+pEyVUsxsAKg /XVHC94HzO5SLbcye2Ne8Fvf4y7cd8BvWNARrrPtl8SxH6WprIfnFRj02lOAILomYp 92fRyPkGVx6WQ== In-Reply-To: <86cymb846o.fsf@gnu.org> Feedback-ID: 112775352:user:proton X-Pm-Message-ID: f2ab91fc312cb98703a20f5f32d59e959875c5dd 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:290153 Archived-At: "Eli Zaretskii" writes: >> Cc: 71744@debbugs.gnu.org >> Date: Wed, 14 Aug 2024 19:03:10 +0300 >> From: Eli Zaretskii >> >> > Date: Wed, 14 Aug 2024 15:40:34 +0000 >> > From: Sigve Indregard >> > Cc: 71744@debbugs.gnu.org >> > >> > (gdb) frame 3 >> > #3 parse_modifiers (symbol=3DXIL(0x5555564e3dc0)) at /usr/src/debug/e= macs/emacs-29.4-wayland/src/keyboard.c:6888 >> > 6888=09parse_modifiers (Lisp_Object symbol) >> > (gdb) print symbol >> > $11 =3D XIL(0x5555564e3dc0) >> > (gdb) xsymbol >> > $12 =3D (struct Lisp_Symbol *) 0xaaaaac1f1640 >> > Cannot access memory at address 0xaaaaac1f1648 > > Btw, this 0x5555564e3dc0 value is the same as the pointer to old_kbd > inside read_char: > > #7 read_char (commandflag=3D0, map=3D0x0, prev_event=3D0x0, used_mouse= _menu=3D0x0, end_time=3D0x7fffffffb5b0) at /usr/src/debug/emacs/emacs-29.4-= wayland/src/keyboard.c:3018 > =09 c =3D > =09 local_getcjmp =3D {{__jmpbuf =3D {93825000405056, -51473246617495375= 57, 1, 4611686019484352512, 5, 0, -5147324661946669845, -131383469637817832= 5}, __mask_was_saved =3D 0, __saved_mask =3D {__val =3D {0, 93825010269488,= 93825104789632, 140737488335792, 18446744073709550936, 11, 93825104789616,= 140737488335856, 140737279378894, 140737488335856, 140737488335920, 0, 140= 737488335920, 0, 93825010269488, 140737488336000}}}} > =09 save_jump =3D {{__jmpbuf =3D {12048, 140737188459256, 14073748833585= 6, 93825095637120, 16, -7692597586030666240, 48, 1}, __mask_was_saved =3D 1= 453957408, __saved_mask =3D {__val =3D {140737488335776, 2, 140737488335824= , 140737488335760, 140737321006214, 1, 140737321006651, 1431953555774269030= 4, 6, 140737488335696, 140737279373914, 93825000331312, 0, 1, 1, 9382356058= 1122}}}} > =09 tem =3D > =09 save =3D 0x0 > =09 previous_echo_area_message =3D 0x0 > =09 also_record =3D 0x0 > =09 reread =3D false > =09 recorded =3D false > =09 polling_stopped_here =3D false > =09 orig_kboard =3D 0x5555564e3dc0 <<<<<<<<<<<<<<<<<<<<<<< > > So either the value of orig_kboard here is bogus (perhaps due to > optimizations), or somehow the variable C, which is supposed to hold > an input event, holds something very different instead, and then it's > a small surprise that we crash. I think this looks like a setjmp-related bug. If this sys_setjmp in read_char: specpdl_ref jmpcount =3D SPECPDL_INDEX (); if (sys_setjmp (local_getcjmp)) { /* Handle quits while reading the keyboard. */ returns true, we goto non_reread, where we test NILP (c). However, 'c' is not declared volatile, and it might have changed, which would lead to undefined behavior, including the possibility of holding another value like orig_kboard. I'm afraid the only way to know for sure whether there's anything to that theory is to look at the output of "disass/rs read_char" in gdb, using the exact same binary that crashed, and check it line by line (about 3,000 lines here...) Pip