public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/26631] New: "thread find" with multiple inferiors => internal error
@ 2020-09-17 16:05 palves at redhat dot com
  2020-09-17 16:06 ` [Bug gdb/26631] " palves at redhat dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: palves at redhat dot com @ 2020-09-17 16:05 UTC (permalink / raw)
  To: gdb-prs

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

            Bug ID: 26631
           Summary: "thread find" with multiple inferiors => internal
                    error
           Product: gdb
           Version: unknown
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: palves at redhat dot com
  Target Milestone: ---

"thread find" with multiple inferiors regressed with the multi-target work:

$ gdb -nx \
   -ex "set breakpoint pending on" \
   -ex "b write" \
   -ex "run" \
   -ex "add-inferior -exec /bin/ls" \
   -ex "inferior 2" \
   -ex "thread find 1" \
   -batch \
   /bin/ls
Function "write" not defined.
Breakpoint 1 (write) pending.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

Breakpoint 1, 0x00007ffff7e9d040 in write () from
/lib/x86_64-linux-gnu/libc.so.6
[New inferior 2]
Added inferior 2 on connection 1 (native)
[Switching to inferior 2 [<null>] (/usr/bin/ls)]
../../src/gdb/target.c:2035: internal-error: const char*
target_thread_name(thread_info*): Assertion `info->inf == current_inferior ()'
failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n) [answered Y; input not from terminal]

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

../../src/gdb/target.c:2035: internal-error: const char*
target_thread_name(thread_info*): Assertion `info->inf == current_inferior ()'
failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.

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

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

* [Bug gdb/26631] "thread find" with multiple inferiors => internal error
  2020-09-17 16:05 [Bug gdb/26631] New: "thread find" with multiple inferiors => internal error palves at redhat dot com
@ 2020-09-17 16:06 ` palves at redhat dot com
  2020-09-18 12:40 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: palves at redhat dot com @ 2020-09-17 16:06 UTC (permalink / raw)
  To: gdb-prs

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

Pedro Alves <palves at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at sourceware dot org   |palves at redhat dot com

--- Comment #1 from Pedro Alves <palves at redhat dot com> ---
I've got a patch.

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

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

* [Bug gdb/26631] "thread find" with multiple inferiors => internal error
  2020-09-17 16:05 [Bug gdb/26631] New: "thread find" with multiple inferiors => internal error palves at redhat dot com
  2020-09-17 16:06 ` [Bug gdb/26631] " palves at redhat dot com
@ 2020-09-18 12:40 ` cvs-commit at gcc dot gnu.org
  2020-09-18 13:00 ` cvs-commit at gcc dot gnu.org
  2020-09-18 13:02 ` palves at redhat dot com
  3 siblings, 0 replies; 5+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-09-18 12:40 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #2 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Pedro Alves <palves@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=e8ef12b99666ef6f84f4c7601dc76ae351e453f2

commit e8ef12b99666ef6f84f4c7601dc76ae351e453f2
Author: Pedro Alves <pedro@palves.net>
Date:   Fri Sep 18 13:40:18 2020 +0100

    Fix "thread find" with multiple inferiors/targets (PR gdb/26631)

    "thread find" with multiple inferiors got broken with the multi-target
    work:

     Thread 1 "gdb" hit Breakpoint 1, internal_error (...) at
../../src/gdbsupport/errors.cc:51
     51      {
     (top-gdb) bt
     #0  internal_error (file=0xffffd4d0 <error: Cannot access memory at
address 0xffffd4d0>, line=0, fmt=0x555556330320 "en_US.UTF-8") at
../../src/gdbsupport/errors.cc:51
     #1  0x0000555555bca4c7 in target_thread_name (info=0x555556801290) at
../../src/gdb/target.c:2035
     #2  0x0000555555beb07a in thread_find_command (arg=0x7fffffffe08e "1",
from_tty=0) at ../../src/gdb/thread.c:1959
     #3  0x000055555572ec49 in do_const_cfunc (c=0x555556786bc0,
args=0x7fffffffe08e "1", from_tty=0) at ../../src/gdb/cli/cli-decode.c:95
     #4  0x0000555555732abd in cmd_func (cmd=0x555556786bc0,
args=0x7fffffffe08e "1", from_tty=0) at ../../src/gdb/cli/cli-decode.c:2181
     #5  0x0000555555bf1245 in execute_command (p=0x7fffffffe08e "1",
from_tty=0) at ../../src/gdb/top.c:664
     #6  0x00005555559cad10 in catch_command_errors (command=0x555555bf0c31
<execute_command(char const*, int)>, arg=0x7fffffffe082 "thread find 1",
from_tty=0) at ../../src/gdb/main.c:457
     #7  0x00005555559cc33d in captured_main_1 (context=0x7fffffffdb60) at
../../src/gdb/main.c:1218
     #8  0x00005555559cc571 in captured_main (data=0x7fffffffdb60) at
../../src/gdb/main.c:1243
     #9  0x00005555559cc5e8 in gdb_main (args=0x7fffffffdb60) at
../../src/gdb/main.c:1268
     #10 0x0000555555623816 in main (argc=17, argv=0x7fffffffdc78) at
../../src/gdb/gdb.c:32

    The problem is that we're not switching to the inferior/target before
    calling target methods, which trips on an assertion put in place
    exactly to catch this sort of problem.

    gdb/testsuite/ChangeLog:

            PR gdb/26631
            * gdb.multi/multi-target-thread-find.exp: New file.

    gdb/ChangeLog:

            PR gdb/26631
            * thread.c (thread_find_command): Switch inferior before calling
            target methods.

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

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

* [Bug gdb/26631] "thread find" with multiple inferiors => internal error
  2020-09-17 16:05 [Bug gdb/26631] New: "thread find" with multiple inferiors => internal error palves at redhat dot com
  2020-09-17 16:06 ` [Bug gdb/26631] " palves at redhat dot com
  2020-09-18 12:40 ` cvs-commit at gcc dot gnu.org
@ 2020-09-18 13:00 ` cvs-commit at gcc dot gnu.org
  2020-09-18 13:02 ` palves at redhat dot com
  3 siblings, 0 replies; 5+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-09-18 13:00 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #3 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The gdb-10-branch branch has been updated by Pedro Alves
<palves@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=5573f8461bffd948141044f3b4ecfba09a71d336

commit 5573f8461bffd948141044f3b4ecfba09a71d336
Author: Pedro Alves <pedro@palves.net>
Date:   Fri Sep 18 13:40:55 2020 +0100

    Fix "thread find" with multiple inferiors/targets (PR gdb/26631)

    "thread find" with multiple inferiors got broken with the multi-target
    work:

     Thread 1 "gdb" hit Breakpoint 1, internal_error (...) at
../../src/gdbsupport/errors.cc:51
     51      {
     (top-gdb) bt
     #0  internal_error (file=0xffffd4d0 <error: Cannot access memory at
address 0xffffd4d0>, line=0, fmt=0x555556330320 "en_US.UTF-8") at
../../src/gdbsupport/errors.cc:51
     #1  0x0000555555bca4c7 in target_thread_name (info=0x555556801290) at
../../src/gdb/target.c:2035
     #2  0x0000555555beb07a in thread_find_command (arg=0x7fffffffe08e "1",
from_tty=0) at ../../src/gdb/thread.c:1959
     #3  0x000055555572ec49 in do_const_cfunc (c=0x555556786bc0,
args=0x7fffffffe08e "1", from_tty=0) at ../../src/gdb/cli/cli-decode.c:95
     #4  0x0000555555732abd in cmd_func (cmd=0x555556786bc0,
args=0x7fffffffe08e "1", from_tty=0) at ../../src/gdb/cli/cli-decode.c:2181
     #5  0x0000555555bf1245 in execute_command (p=0x7fffffffe08e "1",
from_tty=0) at ../../src/gdb/top.c:664
     #6  0x00005555559cad10 in catch_command_errors (command=0x555555bf0c31
<execute_command(char const*, int)>, arg=0x7fffffffe082 "thread find 1",
from_tty=0) at ../../src/gdb/main.c:457
     #7  0x00005555559cc33d in captured_main_1 (context=0x7fffffffdb60) at
../../src/gdb/main.c:1218
     #8  0x00005555559cc571 in captured_main (data=0x7fffffffdb60) at
../../src/gdb/main.c:1243
     #9  0x00005555559cc5e8 in gdb_main (args=0x7fffffffdb60) at
../../src/gdb/main.c:1268
     #10 0x0000555555623816 in main (argc=17, argv=0x7fffffffdc78) at
../../src/gdb/gdb.c:32

    The problem is that we're not switching to the inferior/target before
    calling target methods, which trips on an assertion put in place
    exactly to catch this sort of problem.

    gdb/testsuite/ChangeLog:

            PR gdb/26631
            * gdb.multi/multi-target-thread-find.exp: New file.

    gdb/ChangeLog:

            PR gdb/26631
            * thread.c (thread_find_command): Switch inferior before calling
            target methods.

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

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

* [Bug gdb/26631] "thread find" with multiple inferiors => internal error
  2020-09-17 16:05 [Bug gdb/26631] New: "thread find" with multiple inferiors => internal error palves at redhat dot com
                   ` (2 preceding siblings ...)
  2020-09-18 13:00 ` cvs-commit at gcc dot gnu.org
@ 2020-09-18 13:02 ` palves at redhat dot com
  3 siblings, 0 replies; 5+ messages in thread
From: palves at redhat dot com @ 2020-09-18 13:02 UTC (permalink / raw)
  To: gdb-prs

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

Pedro Alves <palves at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |10.1
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED

--- Comment #4 from Pedro Alves <palves at redhat dot com> ---
Fixed.

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

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

end of thread, other threads:[~2020-09-18 13:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-17 16:05 [Bug gdb/26631] New: "thread find" with multiple inferiors => internal error palves at redhat dot com
2020-09-17 16:06 ` [Bug gdb/26631] " palves at redhat dot com
2020-09-18 12:40 ` cvs-commit at gcc dot gnu.org
2020-09-18 13:00 ` cvs-commit at gcc dot gnu.org
2020-09-18 13:02 ` palves 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).