public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug cli/29223] New: gdb crashes with empty guile command in configuration file
@ 2022-06-02 10:54 nchatz314 at gmail dot com
  2022-06-03 17:20 ` [Bug cli/29223] " tromey at sourceware dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: nchatz314 at gmail dot com @ 2022-06-02 10:54 UTC (permalink / raw)
  To: gdb-prs

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

            Bug ID: 29223
           Summary: gdb crashes with empty guile command in configuration
                    file
           Product: gdb
           Version: HEAD
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: cli
          Assignee: unassigned at sourceware dot org
          Reporter: nchatz314 at gmail dot com
  Target Milestone: ---

If I create a configuration file with contents

    guile

and run gdb, it crashes. I'm trying to debug this to submit a patch, but in the
meantime I would like to at least submit this bug report, as gdb itself
instructs me to do so:

Fatal signal: Segmentation fault
----- Backtrace -----
0x55baf3e21e3f ???
0x55baf3f35928 ???
0x55baf3f35ae6 ???
0x7f2915ebda6f ???
0x55baf42282c4 ???
0x55baf3e69d3d ???
0x55baf3f76439 ???
0x55baf3e59074 ???
0x55baf41f25b7 ???
0x55baf3f35dac ???
0x55baf41efcfe ???
0x55baf3e68dce ???
0x55baf3e57f2a ???
0x55baf400e5b1 ???
0x55baf4010c2c ???
0x55baf401113e ???
0x55baf3d4fe6d ???
0x7f2915ea854f ???
0x7f2915ea8608 ???
0x55baf3d58744 ???
0xffffffffffffffff ???
---------------------
A fatal error internal to GDB has been detected, further
debugging is not possible.  GDB will now terminate.

This is a bug, please report it.  For instructions, see:
<https://www.gnu.org/software/gdb/bugs/>.

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug cli/29223] gdb crashes with empty guile command in configuration file
  2022-06-02 10:54 [Bug cli/29223] New: gdb crashes with empty guile command in configuration file nchatz314 at gmail dot com
@ 2022-06-03 17:20 ` tromey at sourceware dot org
  2022-06-04  1:17 ` nchatz314 at gmail dot com
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: tromey at sourceware dot org @ 2022-06-03 17:20 UTC (permalink / raw)
  To: gdb-prs

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

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tromey at sourceware dot org

--- Comment #1 from Tom Tromey <tromey at sourceware dot org> ---
I couldn't reproduce this with git master or gdb 11.
I tried:

murgatroyd. cd /tmp
murgatroyd. echo guile > .gdbinit
murgatroyd. ~/gdb/install/bin/gdb -iex 'add-auto-load-safe-path /tmp/.gdbinit'

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug cli/29223] gdb crashes with empty guile command in configuration file
  2022-06-02 10:54 [Bug cli/29223] New: gdb crashes with empty guile command in configuration file nchatz314 at gmail dot com
  2022-06-03 17:20 ` [Bug cli/29223] " tromey at sourceware dot org
@ 2022-06-04  1:17 ` nchatz314 at gmail dot com
  2022-06-04  5:43 ` nchatz314 at gmail dot com
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: nchatz314 at gmail dot com @ 2022-06-04  1:17 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #2 from Nikolaos Chatzikonstantinou <nchatz314 at gmail dot com> ---
(In reply to Tom Tromey from comment #1)
> I couldn't reproduce this with git master or gdb 11.
> I tried:
> 
> murgatroyd. cd /tmp
> murgatroyd. echo guile > .gdbinit
> murgatroyd. ~/gdb/install/bin/gdb -iex 'add-auto-load-safe-path
> /tmp/.gdbinit'

Is the `add-auto-load-safe-path` used correctly? Doesn't seem to load anything
for me. E.g. if the file only contains `set startup-quietly on`, the splash
still shows.

The way I obtain the crash is by

    echo guile > ~/.config/gdb/gdbearlyinit

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug cli/29223] gdb crashes with empty guile command in configuration file
  2022-06-02 10:54 [Bug cli/29223] New: gdb crashes with empty guile command in configuration file nchatz314 at gmail dot com
  2022-06-03 17:20 ` [Bug cli/29223] " tromey at sourceware dot org
  2022-06-04  1:17 ` nchatz314 at gmail dot com
@ 2022-06-04  5:43 ` nchatz314 at gmail dot com
  2022-06-04 10:26 ` nchatz314 at gmail dot com
  2022-06-04 16:06 ` tromey at sourceware dot org
  4 siblings, 0 replies; 6+ messages in thread
From: nchatz314 at gmail dot com @ 2022-06-04  5:43 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #3 from Nikolaos Chatzikonstantinou <nchatz314 at gmail dot com> ---
I've narrowed it down to a null dereference of ui_out->current_uiout, here is a
backtrace:

#0  ui_out::is_mi_like_p (this=0x0) at ui-out.c:820
#1  0x00000000004fdeba in execute_control_command (cmd=0xe7b640, from_tty=0) at
cli/cli-script.c:699
#2  0x00000000005f9ee3 in guile_command (arg=<optimized out>,
from_tty=<optimized out>) at /usr/include/c++/12/bits/shared_ptr_base.h:1665
#3  0x00000000004f2d55 in cmd_func (cmd=<optimized out>, args=<optimized out>,
from_tty=<optimized out>) at cli/cli-decode.c:2514
#4  0x00000000007c7aeb in execute_command (p=<optimized out>, p@entry=0xe86ad0
"guile", from_tty=0) at top.c:699
#5  0x00000000005c053d in command_handler (command=0xe86ad0 "guile") at
event-top.c:598
#6  0x00000000007c894f in read_command_file (stream=stream@entry=0xd9b5d0) at
top.c:468
#7  0x00000000004fc088 in script_from_file (stream=stream@entry=0xd9b5d0,
file=file@entry=0xe86aa0 "/home/fox/.config/gdb/gdbearlyinit") at
cli/cli-script.c:1625
#8  0x00000000004efcab in source_script_from_stream (file_to_open=0xe86af0
"/home/fox/.config/gdb/gdbearlyinit", file=0xe86aa0
"/home/fox/.config/gdb/gdbearlyinit", stream=0xd9b5d0) at cli/cli-cmds.c:715
#9  source_script_with_search (file=0xe86aa0
"/home/fox/.config/gdb/gdbearlyinit", file@entry=<error reading variable: value
has been optimized out>, from_tty=<error reading variable: value has been
optimized out>, 
    search_path=<error reading variable: value has been optimized out>) at
cli/cli-cmds.c:760
#10 0x000000000066f652 in catch_command_errors (command=<optimized out>,
arg=<optimized out>, from_tty=<optimized out>, do_bp_actions=<optimized out>)
at main.c:515
#11 0x0000000000671ba1 in captured_main_1 (context=<optimized out>) at
/usr/include/c++/12/bits/basic_string.h:234
#12 0x0000000000671feb in captured_main (data=data@entry=0x7fffffffdd70) at
main.c:1325
#13 gdb_main (args=args@entry=0x7fffffffdda0) at main.c:1350
#14 0x0000000000432d25 in main (argc=<optimized out>, argv=<optimized out>) at
gdb.c:32

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug cli/29223] gdb crashes with empty guile command in configuration file
  2022-06-02 10:54 [Bug cli/29223] New: gdb crashes with empty guile command in configuration file nchatz314 at gmail dot com
                   ` (2 preceding siblings ...)
  2022-06-04  5:43 ` nchatz314 at gmail dot com
@ 2022-06-04 10:26 ` nchatz314 at gmail dot com
  2022-06-04 16:06 ` tromey at sourceware dot org
  4 siblings, 0 replies; 6+ messages in thread
From: nchatz314 at gmail dot com @ 2022-06-04 10:26 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #4 from Nikolaos Chatzikonstantinou <nchatz314 at gmail dot com> ---
I have just realized the error is a bit more nuanced:

The crash occurs with GNU gdb (GDB) Fedora 12.1-1.fc36, which is configured
with --with-guile and it also occurs for HEAD configured with --without-guile.

I don't seem to be able to get gdb working with --with-guile. It compiles but
I'm greeted with

Exception caught while booting Guile.
Error in function "make_objcode_from_file":
bad header on object file:
"\x7fELF\x02\x01\x01ÿ\x00\x00\x00\x00\x00\x00\x00\x00"
./gdb/gdb: warning: Could not complete Guile gdb module initialization from:
/usr/share/gdb/guile/gdb/boot.scm.
Limited Guile support is available.
Suggest passing --data-directory=/path/to/gdb/data-directory.
GNU gdb (GDB) 13.0.50.20220602-git

Apologies for the unorganized bug report, I haven't done many bug reports.

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug cli/29223] gdb crashes with empty guile command in configuration file
  2022-06-02 10:54 [Bug cli/29223] New: gdb crashes with empty guile command in configuration file nchatz314 at gmail dot com
                   ` (3 preceding siblings ...)
  2022-06-04 10:26 ` nchatz314 at gmail dot com
@ 2022-06-04 16:06 ` tromey at sourceware dot org
  4 siblings, 0 replies; 6+ messages in thread
From: tromey at sourceware dot org @ 2022-06-04 16:06 UTC (permalink / raw)
  To: gdb-prs

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

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2022-06-04
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1

--- Comment #5 from Tom Tromey <tromey at sourceware dot org> ---
(In reply to Nikolaos Chatzikonstantinou from comment #2)

> Is the `add-auto-load-safe-path` used correctly? Doesn't seem to load
> anything
> for me. E.g. if the file only contains `set startup-quietly on`, the splash
> still shows.

I think 'startup-quietly' takes effect too late in this case.

> 
> The way I obtain the crash is by
> 
>     echo guile > ~/.config/gdb/gdbearlyinit

I can reproduce it this way, thank you.

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-06-04 16:06 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-02 10:54 [Bug cli/29223] New: gdb crashes with empty guile command in configuration file nchatz314 at gmail dot com
2022-06-03 17:20 ` [Bug cli/29223] " tromey at sourceware dot org
2022-06-04  1:17 ` nchatz314 at gmail dot com
2022-06-04  5:43 ` nchatz314 at gmail dot com
2022-06-04 10:26 ` nchatz314 at gmail dot com
2022-06-04 16:06 ` tromey at sourceware dot org

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