public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug threads/27665] New: Remote X-Debugging Assertion `tp' failed
@ 2021-03-30 11:47 johannes.vilsmeier at de dot bosch.com
  2021-03-30 13:09 ` [Bug threads/27665] " johannes.vilsmeier at de dot bosch.com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: johannes.vilsmeier at de dot bosch.com @ 2021-03-30 11:47 UTC (permalink / raw)
  To: gdb-prs

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

            Bug ID: 27665
           Summary: Remote X-Debugging Assertion `tp' failed
           Product: gdb
           Version: 9.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: threads
          Assignee: unassigned at sourceware dot org
          Reporter: johannes.vilsmeier at de dot bosch.com
  Target Milestone: ---

Remote debugging a cross compiled binary results in reproducible disconnects
from gdb (gdbserver seems to stay active and waits for connections).
Reconnecting host to target aborts again with exactly same error message(s).

Error message on target:
"Remote side has terminated connection.  GDBserver will reopen the connection."

Error message on host:
"(gdb) target remote X.X.X.X:YYYY
Remote debugging using X.X.X.X:YYYY
../../gdb/thread.c:95: internal-error: thread_info* inferior_thread():
Assertion `tp' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable."



Binary on arm64 running with gdbserver
gdb running on host ubuntu 20.04 x64

gdb compiled from sources:

$ md5sum gdb-9.2.tar.gz 
3899ef01c672b19ec63ced445b8abc42  gdb-9.2.tar.gz

$ ../configure --target=aarch64-linux-gnu --enable-interwork --enable-multilib
--with-python

$ python --version
Python 2.7.18

(make and make install executed)

For clarification: system gdb is also present and not configured for cross
debugging. When seeing ./gdb it is the gdb for arm-targets and x64 host. 

More details:

#
######################################
##
######################################
Loading core dump:
#######################################
GNU gdb (Ubuntu 9.2-0ubuntu1~20.04) 9.2
Copyright (C) 2020 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-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://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 ./gdb...
[New LWP 2116321]
[New LWP 2116328]
[New LWP 2116330]
[New LWP 2116327]
[New LWP 2116325]
[New LWP 2116322]
[New LWP 2116324]
[New LWP 2116329]
[New LWP 2116326]
[New LWP 2116323]
[New LWP 2116332]
[New LWP 2116331]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `./gdb /home/XXXXXXXXXXXXXXXXXXXXXXXX'.
Program terminated with signal SIGABRT, Aborted.
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
50      ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
[Current thread is 1 (Thread 0x7ff270976b80 (LWP 2116321))]
warning: File "/home/XXXXXXXXXXXXXXXXXXXXXXXX/gdb-9.2/buildgdb/gdb/gdb-gdb.gdb"
auto-loading has been declined by your `auto-load safe-path' set to
"$debugdir:$datadir/auto-load".
To enable execution of this file add
        add-auto-load-safe-path
/home/XXXXXXXXXXXXXXXXXXXXXXXX/gdb-9.2/buildgdb/gdb/gdb-gdb.gdb
line to your configuration file "/home/user/.gdbinit".
To completely disable this security protection add
        set auto-load safe-path /
line to your configuration file "/home/user/.gdbinit".
For more information about this security protection see the
"Auto-loading safe path" section in the GDB manual.  E.g., run from the shell:
        info "(gdb)Auto-loading safe path"
warning: File "/home/XXXXXXXXXXXXXXXXXXXXXXXX/gdb-gdb.py" auto-loading has been
declined by your `auto-load safe-path' set to "$debugdir:$datadir/auto-load".
(gdb) bt
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1  0x00007ff270c90859 in __GI_abort () at abort.c:79
#2  0x0000563e58b7906d in dump_core () at ../../gdb/utils.c:203
#3  0x0000563e58b7e285 in internal_vproblem(internal_problem *, const char *,
int, const char *, typedef __va_list_tag __va_list_tag *)
(problem=0x563e58f1c800 <internal_error_problem>, 
    file=<optimized out>, line=<optimized out>, fmt=<optimized out>,
ap=<optimized out>) at ../../gdb/utils.c:413
#4  0x0000563e58b7e481 in internal_verror (file=<optimized out>,
line=<optimized out>, fmt=<optimized out>, ap=ap@entry=0x7fff4db9b5d0) at
../../gdb/utils.c:438
#5  0x0000563e589aba65 in internal_error (file=file@entry=0x563e58d73ae4
"../../gdb/thread.c", line=line@entry=95, fmt=<optimized out>) at
../../gdb/gdbsupport/errors.c:55
#6  0x0000563e58b489bd in inferior_thread () at ../../gdb/thread.c:92
#7  inferior_thread () at ../../gdb/thread.c:92
#8  0x0000563e58a407db in mi_about_to_proceed () at
../../gdb/mi/mi-interp.c:681
#9  0x0000563e589f3ab2 in std::function<void ()>::operator()() const
(this=0x563e593037c8) at /usr/include/c++/9/bits/std_function.h:683
#10 gdb::observers::observable<>::notify() const (this=<optimized out>) at
../../gdb/gdbsupport/observable.h:106
#11 clear_proceed_status (step=step@entry=0) at ../../gdb/infrun.c:2759
#12 0x0000563e589f3c06 in init_wait_for_inferior () at ../../gdb/infrun.c:3093
#13 0x0000563e58ac12c1 in remote_target::start_remote
(this=this@entry=0x563e599f2e10, from_tty=from_tty@entry=1,
extended_p=extended_p@entry=0) at ../../gdb/remote.c:4714
#14 0x0000563e58ac16e2 in remote_target::open_1 (name=<optimized out>,
from_tty=1, extended_p=0) at ../../gdb/remote.c:5590
#15 0x0000563e58b45768 in open_target (args=0x563e5b796a5e "X.X.X.X:YYYY",
from_tty=1, command=<optimized out>) at ../../gdb/target.c:254
#16 0x0000563e588df29a in cmd_func (cmd=<optimized out>, args=<optimized out>,
from_tty=<optimized out>) at ../../gdb/cli/cli-decode.c:1952
#17 0x0000563e58b4eba3 in execute_command (p=<optimized out>,
p@entry=0x563e5b796a50 "", from_tty=1) at ../../gdb/top.c:651
#18 0x0000563e58983035 in command_handler (command=0x563e5b796a50 "") at
../../gdb/event-top.c:587
#19 0x0000563e58983f21 in command_line_handler (rl=...) at
../../gdb/event-top.c:772
#20 0x0000563e589838bc in gdb_rl_callback_handler (rl=0x563e5b0ea5f0 "target
remote X.X.X.X:YYYY") at /usr/include/c++/9/bits/unique_ptr.h:153
#21 0x0000563e58bb9e28 in rl_callback_read_char () at
../../../readline/readline/callback.c:281
#22 0x0000563e58982b56 in gdb_rl_callback_read_char_wrapper_noexcept () at
../../gdb/event-top.c:176
#23 0x0000563e58983775 in gdb_rl_callback_read_char_wrapper
(client_data=<optimized out>) at ../../gdb/event-top.c:192
#24 0x0000563e58982a78 in stdin_event_handler (error=<optimized out>,
client_data=0x563e592a1810) at ../../gdb/event-top.c:515
#25 0x0000563e58981726 in gdb_wait_for_event (block=<optimized out>) at
../../gdb/event-loop.c:857
#26 gdb_wait_for_event (block=<optimized out>) at ../../gdb/event-loop.c:744
#27 0x0000563e58981c0c in gdb_do_one_event () at ../../gdb/event-loop.c:346
#28 0x0000563e58981d1e in gdb_do_one_event () at ../../gdb/event-loop.c:370
#29 start_event_loop () at ../../gdb/event-loop.c:370
#30 0x0000563e58a28fcb in captured_command_loop () at ../../gdb/main.c:359
#31 0x0000563e58a2aee5 in captured_main (data=<optimized out>) at
../../gdb/main.c:1202
#32 gdb_main (args=<optimized out>) at ../../gdb/main.c:1217
#33 0x0000563e588339a0 in main (argc=<optimized out>, argv=<optimized out>) at
../../gdb/gdb.c:32


(gdb) show configuration
This GDB was configured as follows:
   configure --host=x86_64-linux-gnu --target=x86_64-linux-gnu
             --with-auto-load-dir=$debugdir:$datadir/auto-load
             --with-auto-load-safe-path=$debugdir:$datadir/auto-load
             --with-expat
             --with-gdb-datadir=/usr/share/gdb (relocatable)
             --with-jit-reader-dir=/usr/lib/gdb (relocatable)
             --without-libunwind-ia64
             --with-lzma
             --with-babeltrace
             --without-intel-pt
             --with-mpfr
             --without-xxhash
             --with-python=/usr (relocatable)
             --without-guile
             --disable-source-highlight
             --with-separate-debug-dir=/usr/lib/debug (relocatable)
             --with-system-gdbinit=/etc/gdb/gdbinit



Sometimes this error does not occur at all (debugging same binary). But when it
hits, it hits all the time

-- 
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 threads/27665] Remote X-Debugging Assertion `tp' failed
  2021-03-30 11:47 [Bug threads/27665] New: Remote X-Debugging Assertion `tp' failed johannes.vilsmeier at de dot bosch.com
@ 2021-03-30 13:09 ` johannes.vilsmeier at de dot bosch.com
  2021-03-30 14:02 ` simark at simark dot ca
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: johannes.vilsmeier at de dot bosch.com @ 2021-03-30 13:09 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #1 from johannes.vilsmeier at de dot bosch.com ---
Additional note:
I can not give clear evidence, just a suspicion:

There is a call to popen() where I execute a call like "ps ax | grep ...".


When I set a breakpoint right before this call and step over it, the mentioned
problem does not occur.

When I remove the breakpoint, the problem always occurs in 5 of 5 tests.


-Maybe "polling" thread information (thread_info) gets stuck on this popen call
or its consequences (multiple threads/ fork / ...)

-- 
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 threads/27665] Remote X-Debugging Assertion `tp' failed
  2021-03-30 11:47 [Bug threads/27665] New: Remote X-Debugging Assertion `tp' failed johannes.vilsmeier at de dot bosch.com
  2021-03-30 13:09 ` [Bug threads/27665] " johannes.vilsmeier at de dot bosch.com
@ 2021-03-30 14:02 ` simark at simark dot ca
  2021-03-30 14:02 ` simark at simark dot ca
  2021-03-30 14:10 ` simark at simark dot ca
  3 siblings, 0 replies; 5+ messages in thread
From: simark at simark dot ca @ 2021-03-30 14:02 UTC (permalink / raw)
  To: gdb-prs

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

Simon Marchi <simark at simark dot ca> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |simark at simark dot ca

--- Comment #2 from Simon Marchi <simark at simark dot ca> ---
Thanks for the detailed info.  This looks like a dup of 24187, but I'm going to
mark 24187 as a dup of this one because this one as more info.

-- 
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 threads/27665] Remote X-Debugging Assertion `tp' failed
  2021-03-30 11:47 [Bug threads/27665] New: Remote X-Debugging Assertion `tp' failed johannes.vilsmeier at de dot bosch.com
  2021-03-30 13:09 ` [Bug threads/27665] " johannes.vilsmeier at de dot bosch.com
  2021-03-30 14:02 ` simark at simark dot ca
@ 2021-03-30 14:02 ` simark at simark dot ca
  2021-03-30 14:10 ` simark at simark dot ca
  3 siblings, 0 replies; 5+ messages in thread
From: simark at simark dot ca @ 2021-03-30 14:02 UTC (permalink / raw)
  To: gdb-prs

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

Simon Marchi <simark at simark dot ca> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |zl29ah at gmail dot com

--- Comment #3 from Simon Marchi <simark at simark dot ca> ---
*** Bug 24187 has been marked as a duplicate of this bug. ***

-- 
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 threads/27665] Remote X-Debugging Assertion `tp' failed
  2021-03-30 11:47 [Bug threads/27665] New: Remote X-Debugging Assertion `tp' failed johannes.vilsmeier at de dot bosch.com
                   ` (2 preceding siblings ...)
  2021-03-30 14:02 ` simark at simark dot ca
@ 2021-03-30 14:10 ` simark at simark dot ca
  3 siblings, 0 replies; 5+ messages in thread
From: simark at simark dot ca @ 2021-03-30 14:10 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #4 from Simon Marchi <simark at simark dot ca> ---
Johannes, can you first make sure the issue is still present in the master
branch?  I'm thinking that this commit (introduced after 9.2) might have solved
it:

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

-- 
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:[~2021-03-30 14:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-30 11:47 [Bug threads/27665] New: Remote X-Debugging Assertion `tp' failed johannes.vilsmeier at de dot bosch.com
2021-03-30 13:09 ` [Bug threads/27665] " johannes.vilsmeier at de dot bosch.com
2021-03-30 14:02 ` simark at simark dot ca
2021-03-30 14:02 ` simark at simark dot ca
2021-03-30 14:10 ` simark at simark dot ca

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