public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "pedro at palves dot net" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug gdb/28093] New: set language unknown -> print "foo" -> GDB crash
Date: Thu, 15 Jul 2021 13:41:51 +0000	[thread overview]
Message-ID: <bug-28093-4717@http.sourceware.org/bugzilla/> (raw)

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

            Bug ID: 28093
           Summary: set language unknown -> print "foo" -> GDB crash
           Product: gdb
           Version: unknown
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: pedro at palves dot net
  Target Milestone: ---

(gdb) set language unknown 
(gdb) p "foo"
Aborted (core dumped)

Thread 1 "gdb" received signal SIGSEGV, Segmentation fault.
parse_exp_in_context (stringptr=0x7fffffffd370, pc=0x0, block=0x0, comma=0,
void_context_p=false, tracker=0x7fffffffd270, cstate=0x0) at
/home/pedro/gdb/binutils-gdb/src/gdb/parse.c:522
522       result->op->set_outermost ();

(top-gdb) p result->op
$1 = std::unique_ptr<expr::operation> = {get() = 0x0}
(top-gdb) p result
$2 = std::unique_ptr<expression> = {get() = 0x5555564dbcd0}
(top-gdb) p *result
$3 = {language_defn = 0x55555649ea90 <unknown_language_defn>, gdbarch =
0x55555659e5e0, op = std::unique_ptr<expr::operation> = {get() = 0x0}}

(top-gdb) bt
#0  parse_exp_in_context (stringptr=0x7fffffffd370, pc=0x0, block=0x0, comma=0,
void_context_p=false, tracker=0x7fffffffd270, cstate=0x0) at
/home/pedro/gdb/binutils-gdb/src/gdb/parse.c:522
#1  0x0000555555b03f20 in parse_expression (During symbol reading: .debug_line
address at offset 0x48fdc7 is 0 [in module
/home/pedro/gdb/binutils-gdb/build/gdb/gdb]
string=0x5555564db182 "\"foo\"", tracker=0x0, void_context_p=false) at
/home/pedro/gdb/binutils-gdb/src/gdb/parse.c:546
#2  0x0000555555b09762 in process_print_command_args (args=0x5555564db182
"\"foo\"", print_opts=0x7fffffffd450, voidprint=true) at
/home/pedro/gdb/binutils-gdb/src/gdb/printcmd.c:1304
#3  0x0000555555b0982d in print_command_1 (args=0x5555564db182 "\"foo\"",
voidprint=1) at /home/pedro/gdb/binutils-gdb/src/gdb/printcmd.c:1318
#4  0x0000555555b09c72 in print_command (exp=0x5555564db182 "\"foo\"",
from_tty=1) at /home/pedro/gdb/binutils-gdb/src/gdb/printcmd.c:1435
#5  0x00005555557a0164 in do_const_cfunc (c=0x55555654a610, args=0x5555564db182
"\"foo\"", from_tty=1) at
/home/pedro/gdb/binutils-gdb/src/gdb/cli/cli-decode.c:102
#6  0x00005555557a4a38 in cmd_func (cmd=0x55555654a610, args=0x5555564db182
"\"foo\"", from_tty=1) at
/home/pedro/gdb/binutils-gdb/src/gdb/cli/cli-decode.c:2160
#7  0x0000555555cbfdc2 in execute_command (p=0x5555564db186 "\"", from_tty=1)
at /home/pedro/gdb/binutils-gdb/src/gdb/top.c:674
#8  0x000055555592494b in command_handler (command=0x5555564db180 "p \"foo\"")
at /home/pedro/gdb/binutils-gdb/src/gdb/event-top.c:588
#9  0x0000555555924dd3 in command_line_handler (rl=...) at
/home/pedro/gdb/binutils-gdb/src/gdb/event-top.c:773
#10 0x0000555555cef958 in tui_command_line_handler (rl=...) at
/home/pedro/gdb/binutils-gdb/src/gdb/tui/tui-interp.c:268
#11 0x0000555555923fe4 in gdb_rl_callback_handler (rl=0x5555564dc340 "p
\"foo\"") at /home/pedro/gdb/binutils-gdb/src/gdb/event-top.c:218
#12 0x0000555555dd1342 in rl_callback_read_char () at
/home/pedro/gdb/binutils-gdb/src/readline/readline/callback.c:281
#13 0x0000555555923e00 in gdb_rl_callback_read_char_wrapper_noexcept () at
/home/pedro/gdb/binutils-gdb/src/gdb/event-top.c:176
#14 0x0000555555923eae in gdb_rl_callback_read_char_wrapper
(client_data=0x5555564daeb0) at
/home/pedro/gdb/binutils-gdb/src/gdb/event-top.c:193
#15 0x000055555592474b in stdin_event_handler (error=0,
client_data=0x5555564daeb0) at
/home/pedro/gdb/binutils-gdb/src/gdb/event-top.c:515
#16 0x0000555555f16c27 in handle_file_event (file_ptr=0x555556659160,
ready_mask=1) at /home/pedro/gdb/binutils-gdb/src/gdbsupport/event-loop.cc:575
#17 0x0000555555f171d9 in gdb_wait_for_event (block=1) at
/home/pedro/gdb/binutils-gdb/src/gdbsupport/event-loop.cc:701
#18 0x0000555555f15f84 in gdb_do_one_event () at
/home/pedro/gdb/binutils-gdb/src/gdbsupport/event-loop.cc:237
#19 0x0000555555a74503 in start_event_loop () at
/home/pedro/gdb/binutils-gdb/src/gdb/main.c:421
#20 0x0000555555a7464e in captured_command_loop () at
/home/pedro/gdb/binutils-gdb/src/gdb/main.c:481
#21 0x0000555555a760b5 in captured_main (data=0x7fffffffdb30) at
/home/pedro/gdb/binutils-gdb/src/gdb/main.c:1353
#22 0x0000555555a76127 in gdb_main (args=0x7fffffffdb30) at
/home/pedro/gdb/binutils-gdb/src/gdb/main.c:1368
#23 0x000055555563fd16 in main (argc=2, argv=0x7fffffffdc48) at
/home/pedro/gdb/binutils-gdb/src/gdb/gdb.c:32

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

             reply	other threads:[~2021-07-15 13:41 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-15 13:41 pedro at palves dot net [this message]
2021-07-15 13:43 ` [Bug gdb/28093] " pedro at palves dot net
2021-07-15 14:47 ` tromey at sourceware dot org
2021-07-15 15:44 ` tromey at sourceware dot org
2021-07-15 15:52 ` tromey at sourceware dot org
2021-07-15 16:16 ` tromey at sourceware dot org
2021-07-15 19:54 ` cvs-commit at gcc dot gnu.org
2021-07-19 17:08 ` cvs-commit at gcc dot gnu.org
2021-07-19 17:09 ` tromey at sourceware dot org

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-28093-4717@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).