GNU bug report logs - #69327
29.2.50; Emacs crashes when running gdb with comint-prompt-read-only

Previous Next

Package: emacs;

Reported by: Knut Anders Hatlen <knut.hatlen <at> oracle.com>

Date: Fri, 23 Feb 2024 13:41:01 UTC

Severity: normal

Found in version 29.2.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 69327 in the body.
You can then email your comments to 69327 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#69327; Package emacs. (Fri, 23 Feb 2024 13:41:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Knut Anders Hatlen <knut.hatlen <at> oracle.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 23 Feb 2024 13:41:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Knut Anders Hatlen <knut.hatlen <at> oracle.com>
To: "bug-gnu-emacs <at> gnu.org" <bug-gnu-emacs <at> gnu.org>
Subject: 29.2.50; Emacs crashes when running gdb with comint-prompt-read-only
Date: Fri, 23 Feb 2024 10:12:25 +0000
[Message part 1 (text/plain, inline)]
I'm seeing occasional crashes when debugging programs with M-x gdb. I'm
observing the crashes on head of both emacs-29 and master, and on
multiple platforms (Debian Bookworm, Debian Trixie, Oracle Linux 8,
Oracle Linux 9).

To reproduce, save this simple C program in a file main.c:

#include <stdio.h>
int main() {
  printf("Hello!\n");
}

Compile it and produce two binaries, a.out and b.out:

% gcc main.c
% cp a.out b.out

Make sure the contents of ~/.gdbinit are:

set debuginfod enabled off

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"))

This makes Emacs crash in my environment. The stack trace has 10700
frames, so I assume it's something like an infinite recursion bug.
The backtrace is available in the attached gdb.txt.

It also crashes if gdb-debuginfod-enable-setting is t, but not if it's
'ask. (However, if it's 'ask, the second invocation of gdb asks again
and again whether debuginfod should be enabled. After responding y or n,
a new prompt with the same question immediately reappears.)

When setting comint-prompt-read-only to nil, it seems to behave fine
regardless of which value gdb-debuginfod-enable-setting has.

According to git bisect, it has crashed since the
gdb-debuginfod-enable-setting option was introduced in:

commit ab417c8a6eeb7df7ccce3e5f8416f48544a5174e
Author: Eli Zaretskii <eliz <at> gnu.org>
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.



In GNU Emacs 29.2.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version
 3.24.38, cairo version 1.16.0) of 2024-02-22 built on atum07
Repository revision: f28a557c7d4b39f302630ed2b19a73fc375e7ff4
Repository branch: emacs-29
System Description: Debian GNU/Linux 12 (bookworm)

Configured using:
 'configure --with-json --with-xml2 --with-modules
 --prefix=/usr/local/stow/emacs-29 --with-pgtk --without-x
 --with-native-compilation --with-tree-sitter'

Configured features:
CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG JSON
LIBSELINUX LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PGTK PNG
SECCOMP SOUND THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER WEBP XIM GTK3
ZLIB

Important settings:
  value of $LANG: nn_NO.UTF-8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: utf-8-unix

Major mode: Group

Minor modes in effect:
  xterm-mouse-mode: t
  global-git-commit-mode: t
  shell-dirtrack-mode: t
  gnus-undo-mode: t
  corfu-terminal-mode: t
  midnight-mode: t
  desktop-save-mode: t
  savehist-mode: t
  winner-mode: t
  windmove-mode: t
  server-mode: t
  save-place-mode: t
  repeat-mode: t
  recentf-mode: t
  minibuffer-depth-indicate-mode: t
  marginalia-mode: t
  global-so-long-mode: t
  global-auto-revert-mode: t
  dynamic-completion-mode: t
  breadcrumb-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tab-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  buffer-read-only: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t

Load-path shadows:
/home/khatlen/.emacs.d/elpa/29/transient-0.5.3/transient hides /usr/local/stow/emacs-29/share/emacs/29.2.50/lisp/transient
/home/khatlen/.emacs.d/elpa/29/jsonrpc-1.0.24/jsonrpc hides /usr/local/stow/emacs-29/share/emacs/29.2.50/lisp/jsonrpc
/home/khatlen/.emacs.d/elpa/29/flymake-1.3.7/flymake hides /usr/local/stow/emacs-29/share/emacs/29.2.50/lisp/progmodes/flymake
/home/khatlen/.emacs.d/elpa/29/project-0.10.0/project hides /usr/local/stow/emacs-29/share/emacs/29.2.50/lisp/progmodes/project
/home/khatlen/.emacs.d/elpa/29/eglot-1.17/eglot hides /usr/local/stow/emacs-29/share/emacs/29.2.50/lisp/progmodes/eglot
/home/khatlen/.emacs.d/elpa/29/eldoc-1.15.0/eldoc hides /usr/local/stow/emacs-29/share/emacs/29.2.50/lisp/emacs-lisp/eldoc

Features:
(shadow emacsbug mailalias smtpmail ecomplete flow-fill xt-mouse
term/xterm xterm shr-color sort gnus-cite smiley mm-archive mail-extr
textsec uni-scripts idna-mapping ucs-normalize uni-confusable
textsec-check gnus-bcklg mule-util gdb-mi bindat gud help-fns radix-tree
eglot external-completion jsonrpc ert ewoc debug backtrace find-func
etags fileloop generator xref whitespace vc c++-ts-mode c-ts-mode
c-ts-common qp grep orderless vc-git vc-dispatcher sql view misearch
multi-isearch files-x magit-extras face-remap magit-submodule
magit-obsolete magit-blame magit-stash magit-reflog magit-bisect
magit-push magit-pull magit-fetch magit-clone magit-remote magit-commit
magit-sequence magit-notes magit-worktree magit-tag magit-merge
magit-branch magit-reset magit-files magit-refs magit-status magit
magit-repos magit-apply magit-wip magit-log which-func magit-diff
smerge-mode diff diff-mode easy-mmode git-commit log-edit pcvs-util
add-log magit-core magit-margin magit-transient magit-process
with-editor shell pcomplete magit-mode transient edmacro kmacro
gnus-async gnus-dup gnus-ml gnus-topic nndraft nnmh utf-7 nnml
format-spec nnfolder nnnil gnus-agent gnus-srvr gnus-score score-mode
nnvirtual gnus-msg nntp gnus-cache cus-start gnus-art mm-uu mml2015
mm-view mml-smime smime gnutls dig gnus-sum shr pixel-fill kinsoku
url-file svg dom gnus-group gnus-undo gnus-start gnus-dbus dbus xml
gnus-cloud nnimap nnmail mail-source utf7 nnoo parse-time iso8601
gnus-spec gnus-int gnus-range message sendmail yank-media dired
dired-loaddefs rfc822 mml mml-sec epa derived epg rfc6068 epg-config
mm-decode mm-bodies mm-encode mailabbrev gmm-utils mailheader gnus-win
gnus nnheader gnus-util range mail-utils comp comp-cstr flyspell ispell
hl-line elec-pair display-line-numbers elide-head corfu-terminal popon
corfu time-date checkdoc lisp-mnt flymake compile text-property-search
comint ansi-osc ansi-color warnings bug-reference cus-edit pp midnight
desktop frameset savehist yaml-ts-mode dockerfile-ts-mode cmake-ts-mode
treesit pcase network-stream url-http mail-parse rfc2231 rfc2047 rfc2045
mm-util ietf-drums mail-prsvr url-gw nsm puny url-cache url-auth rx ffap
thingatpt winner ring windmove disp-table server icons cl-extra
help-mode saveplace repeat recentf tree-widget wid-edit mb-depth
marginalia compat magit-autorevert magit-git magit-section magit-utils
crm dash so-long autorevert filenotify completion breadcrumb pulse color
project imenu cus-load boxquote-autoloads breadcrumb-autoloads
clang-format-autoloads corfu-terminal-autoloads corfu-autoloads
eglot-autoloads flymake-autoloads eldoc-autoloads
google-c-style-autoloads jsonrpc-autoloads magit-autoloads
git-commit-autoloads magit-section-autoloads dash-autoloads
marginalia-autoloads orderless-autoloads popon-autoloads
project-autoloads slime-autoloads macrostep-autoloads
transient-autoloads with-editor-autoloads info compat-autoloads package
browse-url url url-proxy url-privacy url-expand url-methods url-history
url-cookie generate-lisp-file url-domsuf url-util mailcap url-handlers
url-parse auth-source cl-seq eieio eieio-core cl-macs password-cache
json subr-x map byte-opt gv bytecomp byte-compile url-vars cl-loaddefs
cl-lib rmc iso-transl tooltip cconv eldoc paren electric uniquify
ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/pgtk-win
pgtk-win term/common-win pgtk-dnd tool-bar dnd fontset image regexp-opt
fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode
register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select
scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors
frame minibuffer nadvice seq simple cl-generic indonesian philippine
cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech
european ethiopic indian cyrillic chinese composite emoji-zwj charscript
charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure
cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp
files window text-properties overlay sha1 md5 base64 format env
code-pages mule custom widget keymap hashtable-print-readable backquote
threads dbusbind inotify dynamic-setting system-font-setting
font-render-setting cairo gtk pgtk multi-tty make-network-process
native-compile emacs)

Memory information:
((conses 16 784875 72679)
 (symbols 48 30984 0)
 (strings 32 143369 8872)
 (string-bytes 1 5136733)
 (vectors 16 102363)
 (vector-slots 8 2434741 119058)
 (floats 8 577 565)
 (intervals 56 15669 3720)
 (buffers 984 43))
[gdb.txt (text/plain, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#69327; Package emacs. (Fri, 23 Feb 2024 15:42:01 GMT) Full text and rfc822 format available.

Message #8 received at 69327 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Knut Anders Hatlen <knut.hatlen <at> oracle.com>
Cc: 69327 <at> debbugs.gnu.org
Subject: Re: bug#69327: 29.2.50;
 Emacs crashes when running gdb with comint-prompt-read-only
Date: Fri, 23 Feb 2024 17:41:16 +0200
> From: Knut Anders Hatlen <knut.hatlen <at> oracle.com>
> 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?

> According to git bisect, it has crashed since the
> gdb-debuginfod-enable-setting option was introduced in:
> 
> commit ab417c8a6eeb7df7ccce3e5f8416f48544a5174e
> Author: Eli Zaretskii <eliz <at> gnu.org>
> 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?

If not, please tell what are the errors that Emacs wants to report,
here:

  #10685 0x00005555557a971b in read_process_output_error_handler (error_val=<optimized out>) at ../../src/process.c:6140
  #10686 0x000055555575462c in internal_condition_case_1 (bfun=bfun <at> entry=0x5555557a97a0 <read_process_output_call>, arg=XIL(0x7fffef130093), handlers=handlers <at> entry=XIL(0x90), hfun=hfun <at> entry=0x5555557a96e0 <read_process_output_error_handler>) at ../../src/eval.c:1557
	  val = <optimized out>
	  c = 0x555555ebab70
  #10687 0x00005555557ac215 in read_and_dispose_of_process_output (coding=<optimized out>, 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 <http://gnu.org/licenses/gpl.html>\\nTh"..., p=0x5555561b66f8) at ../../src/process.c:6354

and here:

  #10679 0x00005555557a971b in read_process_output_error_handler (error_val=<optimized out>) at ../../src/process.c:6140
  #10680 0x000055555575462c in internal_condition_case_1 (bfun=bfun <at> entry=0x5555557a97a0 <read_process_output_call>, arg=XIL(0x7fffef12d703), handlers=handlers <at> entry=XIL(0x90), hfun=hfun <at> entry=0x5555557a96e0 <read_process_output_error_handler>) at ../../src/eval.c:1557
	  val = <optimized out>
	  c = 0x555555ebab70
  #10681 0x00005555557ac215 in read_and_dispose_of_process_output (coding=<optimized out>, 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).

> 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?

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#69327; Package emacs. (Fri, 23 Feb 2024 20:19:01 GMT) Full text and rfc822 format available.

Message #11 received at 69327 <at> debbugs.gnu.org (full text, mbox):

From: Knut Anders Hatlen <kahatlen <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 69327 <at> debbugs.gnu.org
Subject: Re: bug#69327: 29.2.50; Emacs crashes when running gdb with
 comint-prompt-read-only
Date: Fri, 23 Feb 2024 21:16:50 +0100
Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: Knut Anders Hatlen <knut.hatlen <at> oracle.com>
>> 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 <eliz <at> gnu.org>
>> 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=<optimized out>) at ../../src/process.c:6140
>   #10686 0x000055555575462c in internal_condition_case_1 (bfun=bfun <at> entry=0x5555557a97a0 <read_process_output_call>, arg=XIL(0x7fffef130093), handlers=handlers <at> entry=XIL(0x90), hfun=hfun <at> entry=0x5555557a96e0 <read_process_output_error_handler>) at ../../src/eval.c:1557
> 	  val = <optimized out>
> 	  c = 0x555555ebab70
>   #10687 0x00005555557ac215 in read_and_dispose_of_process_output (coding=<optimized out>, 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 <https://urldefense.com/v3/__http://gnu.org/licenses/gpl.html__;!!ACWV5N9M2RV99hQ!L1QMwwawGjh56jglEvTNy8xaiRP1Yrb2WvksE8JcbvnoIbAgcTriclAWSIQjJEZ0LLxIF3V4Tr-L$ >\\nTh"..., p=0x5555561b66f8) at ../../src/process.c:6354
>
> and here:
>
>   #10679 0x00005555557a971b in read_process_output_error_handler (error_val=<optimized out>) at ../../src/process.c:6140
>   #10680 0x000055555575462c in internal_condition_case_1 (bfun=bfun <at> entry=0x5555557a97a0 <read_process_output_call>, arg=XIL(0x7fffef12d703), handlers=handlers <at> entry=XIL(0x90), hfun=hfun <at> entry=0x5555557a96e0 <read_process_output_error_handler>) at ../../src/eval.c:1557
> 	  val = <optimized out>
> 	  c = 0x555555ebab70
>   #10681 0x00005555557ac215 in read_and_dispose_of_process_output (coding=<optimized out>, 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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#69327; Package emacs. (Sat, 24 Feb 2024 08:42:03 GMT) Full text and rfc822 format available.

Message #14 received at 69327 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Knut Anders Hatlen <kahatlen <at> gmail.com>
Cc: 69327 <at> debbugs.gnu.org
Subject: Re: bug#69327: 29.2.50; Emacs crashes when running gdb with
 comint-prompt-read-only
Date: Sat, 24 Feb 2024 10:40:35 +0200
> From: Knut Anders Hatlen <kahatlen <at> gmail.com>
> Cc: 69327 <at> debbugs.gnu.org
> Date: Fri, 23 Feb 2024 21:16:50 +0100
> 
> 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)

OK, so please try this change, it seems to fix the problem for me:

diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el
index d119eeb..312b71b 100644
--- a/lisp/progmodes/gdb-mi.el
+++ b/lisp/progmodes/gdb-mi.el
@@ -1849,7 +1849,8 @@ gdb-io-eof
 
 (defun gdb-clear-inferior-io ()
   (with-current-buffer (gdb-get-buffer-create 'gdb-inferior-io)
-    (erase-buffer)))
+    (let ((inhibit-read-only t))
+      (erase-buffer))))
 
 
 (defconst breakpoint-xpm-data
@@ -2819,7 +2820,8 @@ gdb-append-to-partial-output
 
 (defun gdb-clear-partial-output ()
   (with-current-buffer (gdb-get-buffer-create 'gdb-partial-output-buffer)
-    (erase-buffer)))
+    (let ((inhibit-read-only t))
+      (erase-buffer))))
 
 ;; Parse GDB/MI result records: this process converts
 ;;  list      [...]      ->  list




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#69327; Package emacs. (Sat, 24 Feb 2024 12:43:02 GMT) Full text and rfc822 format available.

Message #17 received at 69327 <at> debbugs.gnu.org (full text, mbox):

From: Knut Anders Hatlen <kahatlen <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 69327 <at> debbugs.gnu.org
Subject: Re: bug#69327: 29.2.50; Emacs crashes when running gdb with
 comint-prompt-read-only
Date: Sat, 24 Feb 2024 13:41:01 +0100
Eli Zaretskii <eliz <at> gnu.org> writes:

> OK, so please try this change, it seems to fix the problem for me:
>
> diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el
> index d119eeb..312b71b 100644
> --- a/lisp/progmodes/gdb-mi.el
> +++ b/lisp/progmodes/gdb-mi.el
> @@ -1849,7 +1849,8 @@ gdb-io-eof
>  
>  (defun gdb-clear-inferior-io ()
>    (with-current-buffer (gdb-get-buffer-create 'gdb-inferior-io)
> -    (erase-buffer)))
> +    (let ((inhibit-read-only t))
> +      (erase-buffer))))
>  
>  
>  (defconst breakpoint-xpm-data
> @@ -2819,7 +2820,8 @@ gdb-append-to-partial-output
>  
>  (defun gdb-clear-partial-output ()
>    (with-current-buffer (gdb-get-buffer-create 'gdb-partial-output-buffer)
> -    (erase-buffer)))
> +    (let ((inhibit-read-only t))
> +      (erase-buffer))))
>  
>  ;; Parse GDB/MI result records: this process converts
>  ;;  list      [...]      ->  list

It fixes the problem for me too. Thanks a lot!

-- 
Knut Anders




Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Sat, 24 Feb 2024 15:11:02 GMT) Full text and rfc822 format available.

Notification sent to Knut Anders Hatlen <knut.hatlen <at> oracle.com>:
bug acknowledged by developer. (Sat, 24 Feb 2024 15:11:03 GMT) Full text and rfc822 format available.

Message #22 received at 69327-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Knut Anders Hatlen <kahatlen <at> gmail.com>
Cc: 69327-done <at> debbugs.gnu.org
Subject: Re: bug#69327: 29.2.50; Emacs crashes when running gdb with
 comint-prompt-read-only
Date: Sat, 24 Feb 2024 15:14:27 +0200
> From: Knut Anders Hatlen <kahatlen <at> gmail.com>
> Cc: 69327 <at> debbugs.gnu.org
> Date: Sat, 24 Feb 2024 13:41:01 +0100
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> > OK, so please try this change, it seems to fix the problem for me:
> >
> > diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el
> > index d119eeb..312b71b 100644
> > --- a/lisp/progmodes/gdb-mi.el
> > +++ b/lisp/progmodes/gdb-mi.el
> > @@ -1849,7 +1849,8 @@ gdb-io-eof
> >  
> >  (defun gdb-clear-inferior-io ()
> >    (with-current-buffer (gdb-get-buffer-create 'gdb-inferior-io)
> > -    (erase-buffer)))
> > +    (let ((inhibit-read-only t))
> > +      (erase-buffer))))
> >  
> >  
> >  (defconst breakpoint-xpm-data
> > @@ -2819,7 +2820,8 @@ gdb-append-to-partial-output
> >  
> >  (defun gdb-clear-partial-output ()
> >    (with-current-buffer (gdb-get-buffer-create 'gdb-partial-output-buffer)
> > -    (erase-buffer)))
> > +    (let ((inhibit-read-only t))
> > +      (erase-buffer))))
> >  
> >  ;; Parse GDB/MI result records: this process converts
> >  ;;  list      [...]      ->  list
> 
> It fixes the problem for me too. Thanks a lot!

Thanks, installed on the emacs-29 branch, and closing the bug.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 24 Mar 2024 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 116 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.