public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "vimacs.hacks at gmail dot com" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug mi/27770] crash with interpreter-exec
Date: Tue, 16 May 2023 06:04:12 +0000	[thread overview]
Message-ID: <bug-27770-4717-L7fqBIOTsh@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-27770-4717@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=27770

vimacs.hacks at gmail dot com <vimacs.hacks at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |vimacs.hacks at gmail dot com

--- Comment #2 from vimacs.hacks at gmail dot com <vimacs.hacks at gmail dot com> ---
I encountered the same problem when trying to use GDB in Eclipse (hardcoded to
mi2). I use valgrind to debug this problem, and found mi->raw_stdout is
uninitialised:

# start gdbserver with "gdbserver :9999 /bin/ls"

$ valgrind ./gdb/gdb --interpreter=mi2
...
GNU gdb (GDB) 14.0.50.20230516-git
...
1-target-select remote 127.0.0.1:9999
...
2-interpreter-exec mi "monitor set debug 1"
&"monitor set debug 1\n"
@"Debug output enabled.\n"
==80114== Use of uninitialised value of size 8
==80114==    at 0x9CA8BB: gdb_puts(char const*, ui_file*) (utils.c:1812)
==80114==    by 0x6DD25C: captured_mi_execute_command(ui_out*, mi_parse*)
(mi-main.c:1867)
==80114==    by 0x6DD573: mi_execute_command(char const*, int) (mi-main.c:1942)
==80114==    by 0x6C5B29: mi_execute_command_wrapper(char const*)
(mi-interp.c:274)
==80114==    by 0x6C5919: mi_interp::exec(char const*) (mi-interp.c:204)
==80114==    by 0x62D0E0: interp_exec(interp*, char const*) (interps.c:293)
==80114==    by 0x6C5A4C: mi_cmd_interpreter_exec(char const*, char**, int)
(mi-interp.c:241)
==80114==    by 0x6C2480: mi_command_mi::invoke(mi_parse*) const (mi-cmds.c:58)
==80114==    by 0x6DDC65: mi_cmd_execute(mi_parse*) (mi-main.c:2114)
==80114==    by 0x6DD0AA: captured_mi_execute_command(ui_out*, mi_parse*)
(mi-main.c:1818)
==80114==    by 0x6DD573: mi_execute_command(char const*, int) (mi-main.c:1942)
==80114==    by 0x6C5B29: mi_execute_command_wrapper(char const*)
(mi-interp.c:274)
==80114== 
==80114== Invalid read of size 8
==80114==    at 0x9CA8BB: gdb_puts(char const*, ui_file*) (utils.c:1812)
==80114==    by 0x6DD25C: captured_mi_execute_command(ui_out*, mi_parse*)
(mi-main.c:1867)
==80114==    by 0x6DD573: mi_execute_command(char const*, int) (mi-main.c:1942)
==80114==    by 0x6C5B29: mi_execute_command_wrapper(char const*)
(mi-interp.c:274)
==80114==    by 0x6C5919: mi_interp::exec(char const*) (mi-interp.c:204)
==80114==    by 0x62D0E0: interp_exec(interp*, char const*) (interps.c:293)
==80114==    by 0x6C5A4C: mi_cmd_interpreter_exec(char const*, char**, int)
(mi-interp.c:241)
==80114==    by 0x6C2480: mi_command_mi::invoke(mi_parse*) const (mi-cmds.c:58)
==80114==    by 0x6DDC65: mi_cmd_execute(mi_parse*) (mi-main.c:2114)
==80114==    by 0x6DD0AA: captured_mi_execute_command(ui_out*, mi_parse*)
(mi-main.c:1818)
==80114==    by 0x6DD573: mi_execute_command(char const*, int) (mi-main.c:1942)
==80114==    by 0x6C5B29: mi_execute_command_wrapper(char const*)
(mi-interp.c:274)
==80114==  Address 0x0 is not stack'd, malloc'd or (recently) free'd

-- 
You are receiving this mail because:
You are on the CC list for the bug.

  parent reply	other threads:[~2023-05-16  6:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-23 15:22 [Bug mi/27770] New: " tromey at sourceware dot org
2022-08-12 18:26 ` [Bug mi/27770] " tromey at sourceware dot org
2023-05-16  6:04 ` vimacs.hacks at gmail dot com [this message]
2023-12-14  6:37 ` vimacs.hacks at gmail dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-27770-4717-L7fqBIOTsh@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).