public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/29251] New: gdb stuck asking to enable debuginfod
@ 2022-06-15 15:42 msebor at gmail dot com
  2022-07-04 20:41 ` [Bug gdb/29251] " amerey at redhat dot com
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: msebor at gmail dot com @ 2022-06-15 15:42 UTC (permalink / raw)
  To: gdb-prs

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

            Bug ID: 29251
           Summary: gdb stuck asking to enable debuginfod
           Product: gdb
           Version: 11.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: msebor at gmail dot com
  Target Milestone: ---

Between last night and today with no changes to my system that I know of my GDB
stopped working with the output below (I've been using GDB trunk to get around
a bug; the output below is with a fresh build of the latest GDB trunk as of
today).  The first 14 "Please answer..." prompts appear before I have a chance
to enter anything.  The rest are in response to typing n, that GDB doesn't seem
to understand.  I've seen this problem before but it went away on its own until
today.  Adding `set debuginfod enabled off` to .gdbinit avoids it, but that
seems like a workaround.

Current directory is /bin/
GNU gdb (GDB) 13.0.50.20220615-git
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /bin/opt...

This GDB supports auto-downloading debuginfo from the following URLs:
  <https://debuginfod.fedoraproject.org/>
Enable debuginfod for this session? (y or [n]) Please answer y or [n].
Enable debuginfod for this session? (y or [n]) Please answer y or [n].
Enable debuginfod for this session? (y or [n]) Please answer y or [n].
Enable debuginfod for this session? (y or [n]) Please answer y or [n].
Enable debuginfod for this session? (y or [n]) Please answer y or [n].
Enable debuginfod for this session? (y or [n]) Please answer y or [n].
Enable debuginfod for this session? (y or [n]) Please answer y or [n].
Enable debuginfod for this session? (y or [n]) Please answer y or [n].
Enable debuginfod for this session? (y or [n]) Please answer y or [n].
Enable debuginfod for this session? (y or [n]) Please answer y or [n].
Enable debuginfod for this session? (y or [n]) Please answer y or [n].
Enable debuginfod for this session? (y or [n]) Please answer y or [n].
Enable debuginfod for this session? (y or [n]) Please answer y or [n].
Enable debuginfod for this session? (y or [n]) Please answer y or [n].
Enable debuginfod for this session? (y or [n]) n
Please answer y or [n].
Enable debuginfod for this session? (y or [n]) n
Please answer y or [n].
Enable debuginfod for this session? (y or [n]) n
Please answer y or [n].
Enable debuginfod for this session? (y or [n]) n
Please answer y or [n].
Enable debuginfod for this session? (y or [n])

-- 
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 gdb/29251] gdb stuck asking to enable debuginfod
  2022-06-15 15:42 [Bug gdb/29251] New: gdb stuck asking to enable debuginfod msebor at gmail dot com
@ 2022-07-04 20:41 ` amerey at redhat dot com
  2022-07-05 16:08 ` msebor at gmail dot com
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: amerey at redhat dot com @ 2022-07-04 20:41 UTC (permalink / raw)
  To: gdb-prs

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

Aaron Merey <amerey at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |amerey at redhat dot com

--- Comment #1 from Aaron Merey <amerey at redhat dot com> ---
I was not able to reproduce this using a commit from June 15 (b9b66a3a5740df)
or the most recent commit (96c33f79ded35) at the time of writing. I was also
not able to reproduce this using gdb-12.1-1.fc35.x86_64. I ran 'gdb opt' with
'/bin' as the cwd, like your example output suggests.

You mentioned that you've seen this issue before and that it comes and goes
seemingly at random. I'm not sure what could be causing this. Maybe there is
some weird interaction happening with one of the commands in your .gdbinit,
would you be willing to provide that file?

Do you have issues with any of gdb's other y/n prompts? The debuginfod
first-use prompt uses the same function (nquery) used to implement the
following prompt:

(gdb) br foo
Function "foo" not defined.
Make breakpoint pending on future shared library load? (y or [n])

-- 
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 gdb/29251] gdb stuck asking to enable debuginfod
  2022-06-15 15:42 [Bug gdb/29251] New: gdb stuck asking to enable debuginfod msebor at gmail dot com
  2022-07-04 20:41 ` [Bug gdb/29251] " amerey at redhat dot com
@ 2022-07-05 16:08 ` msebor at gmail dot com
  2022-07-05 18:51 ` amerey at redhat dot com
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: msebor at gmail dot com @ 2022-07-05 16:08 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #2 from Martin Sebor <msebor at gmail dot com> ---
I can't reproduce with either of those today either (my output is below). 
Could it be triggered by the site being down or unreachable?

A separate question is why it's downloading these files again?  I imagine it
must have downloaded all of them at some point before, and I haven't updated my
machine in months.

Debuginfod has been enabled.
To make this setting permanent, add 'set debuginfod enabled on' to .gdbinit.
Downloading separate debug info for system-supplied DSO at 0x7ffff7fc8000...
Downloading separate debug info for /lib64/libstdc++.so.6...
Downloading separate debug info for
/home/msebor/.cache/debuginfod_client/455be2588680c3ff57e3a7defe212a13e2efdbd1/debuginfo...
Downloading separate debug info for /lib64/libm.so.6...
Downloading separate debug info for /lib64/libgcc_s.so.1...
Downloading separate debug info for /lib64/libc.so.6...
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Downloading separate debug info for /lib64/libz.so.1...
Downloading separate debug info for /lib64/libxml2.so.2...
Downloading separate debug info for /lib64/liblzma.so.5...
[Inferior 1 (process 29469) exited normally]
(gdb)

-- 
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 gdb/29251] gdb stuck asking to enable debuginfod
  2022-06-15 15:42 [Bug gdb/29251] New: gdb stuck asking to enable debuginfod msebor at gmail dot com
  2022-07-04 20:41 ` [Bug gdb/29251] " amerey at redhat dot com
  2022-07-05 16:08 ` msebor at gmail dot com
@ 2022-07-05 18:51 ` amerey at redhat dot com
  2023-01-31 16:34 ` chad.cassady at gmail dot com
  2023-02-01  0:03 ` amerey at redhat dot com
  4 siblings, 0 replies; 6+ messages in thread
From: amerey at redhat dot com @ 2022-07-05 18:51 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #3 from Aaron Merey <amerey at redhat dot com> ---
(In reply to Martin Sebor from comment #2)
> I can't reproduce with either of those today either (my output is below). 
> Could it be triggered by the site being down or unreachable?

If there was a network error you'd see something like:

  Downloading separate debug info for /lib64/libc.so.6...
  Download failed: No route to host.  Continuing without debug info for
/lib64/libc.so.6.

The logic for the y/n prompt is self-contained in gdb and does not depend on
the network at all so it would be unaffected by these kinds of errors.

> A separate question is why it's downloading these files again?  I imagine it
> must have downloaded all of them at some point before, and I haven't updated
> my machine in months.

Debuginfod's cache of downloaded files is periodically cleaned and, by default,
files that have gone unaccessed for at least a week are deleted during a
cleaning pass. The cleaning frequency and time limit for unaccessed files can
be controlled by the cache_clean_interval_s and max_unused_age_s files in the
cache. See 'man debuginfod' for more info.

-- 
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 gdb/29251] gdb stuck asking to enable debuginfod
  2022-06-15 15:42 [Bug gdb/29251] New: gdb stuck asking to enable debuginfod msebor at gmail dot com
                   ` (2 preceding siblings ...)
  2022-07-05 18:51 ` amerey at redhat dot com
@ 2023-01-31 16:34 ` chad.cassady at gmail dot com
  2023-02-01  0:03 ` amerey at redhat dot com
  4 siblings, 0 replies; 6+ messages in thread
From: chad.cassady at gmail dot com @ 2023-01-31 16:34 UTC (permalink / raw)
  To: gdb-prs

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

Chad Cassady <chad.cassady at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |chad.cassady at gmail dot com

--- Comment #4 from Chad Cassady <chad.cassady at gmail dot com> ---
I'm able to reproduce this by using gdb's machine interface (-i=mi). No matter
what I type into emacs' client (gud), it asks me to choose between yes and no.

To reproduce, I start the debugger in emacs and ask it to invoke gdb like this:
   coredumpctl --debugger-arguments='-i=mi' debug

I am unable to use the editor client to debug this way. So I just run it in a
terminal.

I suspect the interactive feature to confirm debuginfo downloads was not
developed to account for the machine interface, but have not done additional
research to validate this hypothesis. I also do not know what role, if any,
coredumpctl plays in handling the I/O to the gdb process, but I'm assuming it
just invokes GDB with the core file and gets out of the way.

I am happy to conduct further investigation if someone is working on this.

-- 
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 gdb/29251] gdb stuck asking to enable debuginfod
  2022-06-15 15:42 [Bug gdb/29251] New: gdb stuck asking to enable debuginfod msebor at gmail dot com
                   ` (3 preceding siblings ...)
  2023-01-31 16:34 ` chad.cassady at gmail dot com
@ 2023-02-01  0:03 ` amerey at redhat dot com
  4 siblings, 0 replies; 6+ messages in thread
From: amerey at redhat dot com @ 2023-02-01  0:03 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #5 from Aaron Merey <amerey at redhat dot com> ---
(In reply to Chad Cassady from comment #4) 
> I'm able to reproduce this by using gdb's machine interface (-i=mi). No
> matter what I type into emacs' client (gud), it asks me to choose between
> yes and no. 
> 
> To reproduce, I start the debugger in emacs and ask it to invoke gdb like
> this:
>    coredumpctl --debugger-arguments='-i=mi' debug
> 
> I am unable to use the editor client to debug this way. So I just run it in
> a terminal.
> 
> I suspect the interactive feature to confirm debuginfo downloads was not 
> developed to account for the machine interface, but have not done additional
> research to validate this hypothesis. I also do not know what role, if any,
> coredumpctl plays in handling the I/O to the gdb process, but I'm assuming
> it just invokes GDB with the core file and gets out of the way.
> 
> I am happy to conduct further investigation if someone is working on this.

Hi Chad, thanks for the reproducer. When I run 

  M-x gdb RET coredumpctl --debugger-arguments='-i=mi' debug

it looks like emacs isn't expecting the y/n prompt and instead sends gdb 
a sequence of commands '-inferior-tty-set /dev/pts/9', '-gdb-set height 0', 
etc.  Each of these commands is interpreted by gdb as a response to the y/n 
prompt.  Since the first letter isn't 'y' or 'n', gdb simply repeats
the prompt for each of these commands.  When the user tries to enter 'y' 
emacs sends gdb the command '-interpreter-exec console "y"' (likewise for 
'n'), making it impossible to answer the prompt.  If emacs runs gdb 
in a way that does not allow y/n prompts to be answered it should
probably disable gdb's interactive-mode.

However running gud-gdb with the same coredumpctl command worked for me.
The prompt only prints once and y/n inputs are received correctly. If you
want to skip this prompt you could also add 'set debuginfod enabled on/off'
to your .gdbinit file or include it as a command line argument with -iex.

-- 
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:[~2023-02-01  0:03 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-15 15:42 [Bug gdb/29251] New: gdb stuck asking to enable debuginfod msebor at gmail dot com
2022-07-04 20:41 ` [Bug gdb/29251] " amerey at redhat dot com
2022-07-05 16:08 ` msebor at gmail dot com
2022-07-05 18:51 ` amerey at redhat dot com
2023-01-31 16:34 ` chad.cassady at gmail dot com
2023-02-01  0:03 ` amerey at redhat dot com

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