From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Knut Anders Hatlen Newsgroups: gmane.emacs.bugs Subject: bug#69327: 29.2.50; Emacs crashes when running gdb with comint-prompt-read-only Date: Fri, 23 Feb 2024 21:16:50 +0100 Message-ID: <875xyfndfx.fsf@oracle.com> References: <868r3b1943.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23200"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 69327@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Feb 23 21:56:09 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 1rdcaW-0005lJ-TO for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 23 Feb 2024 21:56:09 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rdca0-0001oN-Pl; Fri, 23 Feb 2024 15:55:40 -0500 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 1rdc0E-00060y-To for bug-gnu-emacs@gnu.org; Fri, 23 Feb 2024 15:18:38 -0500 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 1rdc0E-00072i-Jm for bug-gnu-emacs@gnu.org; Fri, 23 Feb 2024 15:18:38 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rdc0b-0003st-P7 for bug-gnu-emacs@gnu.org; Fri, 23 Feb 2024 15:19:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Knut Anders Hatlen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 23 Feb 2024 20:19:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69327 X-GNU-PR-Package: emacs Original-Received: via spool by 69327-submit@debbugs.gnu.org id=B69327.170871950614831 (code B ref 69327); Fri, 23 Feb 2024 20:19:01 +0000 Original-Received: (at 69327) by debbugs.gnu.org; 23 Feb 2024 20:18:26 +0000 Original-Received: from localhost ([127.0.0.1]:39494 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rdc01-0003r6-CS for submit@debbugs.gnu.org; Fri, 23 Feb 2024 15:18:26 -0500 Original-Received: from mail-lf1-f52.google.com ([209.85.167.52]:57693) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rdbzy-0003qb-Bi for 69327@debbugs.gnu.org; Fri, 23 Feb 2024 15:18:23 -0500 Original-Received: by mail-lf1-f52.google.com with SMTP id 2adb3069b0e04-512bce554a5so1102699e87.3 for <69327@debbugs.gnu.org>; Fri, 23 Feb 2024 12:17:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708719412; x=1709324212; darn=debbugs.gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=89Z5M6cQk8BkjNuaSTA0mnl0FUSqQsRdEE49DlGo1nQ=; b=kdJXfJqsj7Hx+9q1o+Ee4396wrVhjgogKUBzrY0DabwWTCb5k/1eyhc5EywbOBla9o O4ppUojCcSbqMFWWzACWyFSgzBfzQYKzPfPCgb5jJ9H5WK5N9OrTUr8jq7b9G6BRX7oa bBBqdC0NeCG6Ahih7XFi29VfjU9Of0DxdO+5prvq6pt2Cu3YTL2MSAipsrBDU+zOM/0s HL8SkwYjOolJ6YsDU7ZoJrbWp1us/o6Xqf4UXwTxN60JG7P6lO+dXyv52wnl+vG5XZSU ix8BB95rELX97BXB+ncYk1pVkCKWxCJg62sgs+DiYqX46jhNeYolACiMnF2yn+YAI7Cb VAgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708719412; x=1709324212; h=mime-version:user-agent: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=89Z5M6cQk8BkjNuaSTA0mnl0FUSqQsRdEE49DlGo1nQ=; b=QVBQCGu7cYL0uh+8/2WkyEY4SKvr7pkmtCpmRx+bJUP8OFTNdnkdRCpLK71P7AdV2V MghmGfI2F7+yiMgtrqvBgsgkZBy+NrmWeje7WeQTQsPPEyhf4RhkeY+Hew/bIILzDmm/ 6LRFNhjZ5+DFMxvLyLJXjMWh6WaLXi0YhFIfHhf/sLWcQqcqpXZV8HPSroWImr38n8w5 qipHqPc3M2cbIsw99Y010zFH52lCpUEyiU1+MmAl+3TrayWqaampfJEV0CC9YXenNpUB Je4KMoCOy+m1XgAUfEDN+oC2YbvmA88vXIAEIq+5NzQ4u4MAB7BZv1h8clqUeorFYsfG YS2Q== X-Gm-Message-State: AOJu0YxOhLGroqnfxTOl2qE3wJKPH5bMcyFIKxpntFvGcmjDIVQrPj4h XkytyrARKdUtmZnA/lNBiYpZlu/4QIYW2x+rBgto9kZ5ZQLgeQ61D4CKycSAtA== X-Google-Smtp-Source: AGHT+IHKJHE13P3lC5PdVh495NxYqsoybEKa777aQpFumIpP2TabpB3Z24zKliAx3lE68KeL4oP4ow== X-Received: by 2002:ac2:5388:0:b0:512:bc93:8640 with SMTP id g8-20020ac25388000000b00512bc938640mr478197lfh.24.1708719411296; Fri, 23 Feb 2024 12:16:51 -0800 (PST) Original-Received: from dell ([188.113.111.58]) by smtp.gmail.com with ESMTPSA id j9-20020a19f509000000b00512ebe08d7bsm222507lfb.290.2024.02.23.12.16.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Feb 2024 12:16:50 -0800 (PST) In-Reply-To: <868r3b1943.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 23 Feb 2024 17:41:16 +0200") 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:280513 Archived-At: Eli Zaretskii writes: >> From: Knut Anders Hatlen >> Date: Fri, 23 Feb 2024 10:12:25 +0000 >> >> Then run emacs -Q and evaluate: >> >> (progn >> (setopt gdb-debuginfod-enable-setting nil >> comint-prompt-read-only t) >> (gdb "gdb -i=mi a.out") >> (insert "r") >> (comint-send-input) >> (sit-for 2) >> (gdb "gdb -i=mi b.out")) > > Does gdb-mi.el really support several debugging sessions in parallel? I'm not sure, but I don't think so. But I sometimes forget that I already have a debugging session running in Emacs, and start a new one. I would be fine with getting an error if it's not supported. But preferably not a crash. :) >> According to git bisect, it has crashed since the >> gdb-debuginfod-enable-setting option was introduced in: >> >> commit ab417c8a6eeb7df7ccce3e5f8416f48544a5174e >> Author: Eli Zaretskii >> Date: Tue Mar 7 14:39:27 2023 +0200 >> >> Fix problem with debuginfod queries in "M-x gdb" >> >> * lisp/progmodes/gdb-mi.el (gdb-debuginfod-enable-setting): New >> defcustom. >> (gdb-debuginfod-message): New function. >> (gdb-init-1): Initialize gdb-debuginfod-enable. Ask the user >> about debuginfod queries and display any error messages. >> (Bug#61973) >> >> * etc/NEWS: Announce the change. > > Does replacing defvar with defvar-local for > gdb-debuginfod-enable-setting helps to resolve the problem? I assume you meant gdb-debuginfod-enable (the defvar), not gdb-debuginfod-enable-setting (the defcustom)? Unfortunately, no, it didn't seem to change anything. (For completeness, I also tried to change the defcustom to defvar-local, even though I don't think that's what you requested. That didn't help either.) > If not, please tell what are the errors that Emacs wants to report, > here: > > #10685 0x00005555557a971b in read_process_output_error_handler (error_val=) at ../../src/process.c:6140 > #10686 0x000055555575462c in internal_condition_case_1 (bfun=bfun@entry=0x5555557a97a0 , arg=XIL(0x7fffef130093), handlers=handlers@entry=XIL(0x90), hfun=hfun@entry=0x5555557a96e0 ) at ../../src/eval.c:1557 > val = > c = 0x555555ebab70 > #10687 0x00005555557ac215 in read_and_dispose_of_process_output (coding=, nbytes=157, chars=0x7fffffffc420 "=cmd-param-changed,param=\"debuginfod enabled\",value=\"off\"\n~\"Reading symbols from b.out...\\n\"\n~\"(No debugging symbols found in b.out)\\n\"\n(gdb) \n1^done\n(gdb) \nater \\nTh"..., p=0x5555561b66f8) at ../../src/process.c:6354 > > and here: > > #10679 0x00005555557a971b in read_process_output_error_handler (error_val=) at ../../src/process.c:6140 > #10680 0x000055555575462c in internal_condition_case_1 (bfun=bfun@entry=0x5555557a97a0 , arg=XIL(0x7fffef12d703), handlers=handlers@entry=XIL(0x90), hfun=hfun@entry=0x5555557a96e0 ) at ../../src/eval.c:1557 > val = > c = 0x555555ebab70 > #10681 0x00005555557ac215 in read_and_dispose_of_process_output (coding=, nbytes=14, chars=0x7fffffffae40 "1^done\n(gdb) \n", p=0x5555561b66f8) at ../../src/process.c:6354 > > I'm asking about the value of error_val with which > read_process_output_error_handler is called in these two frames. It > is possible that you will need to rebuild Emacs without optimizations, > to be able to show these values. The error_val argument is a Lisp > object, so please use the "pp" command to show it (if GDB says it > doesn't know about "pp", you need to "source .gdbinit" where .gdbinit > is the file that comes with the Emacs source tarball, in the 'src' > directory). It apparently tries to report "error in process filter: Text is read-only" in all of the read_process_output_error_handler() frames that I looked at. error_val contains the same in all of them: (gdb) pp error_val (text-read-only) >> When setting comint-prompt-read-only to nil, it seems to behave fine >> regardless of which value gdb-debuginfod-enable-setting has. > > Why are you setting comint-prompt-read-only non-nil? It's just a preference of mine. I like that the prompt is preserved even if I hit backspace a few times too many, or hit C-k in the wrong spot, in M-x shell or M-x gdb. Makes it feel a little more similar to running a shell in a terminal, without going all the way to term or vterm. Thanks, -- Knut Anders