public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/30935] New: Regression exposed by new gdb.python/py-progspace-events.exp  test and native-extended-gdbserver board
@ 2023-10-02 21:15 aburgess at redhat dot com
  2023-10-02 21:15 ` [Bug gdb/30935] " aburgess at redhat dot com
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: aburgess at redhat dot com @ 2023-10-02 21:15 UTC (permalink / raw)
  To: gdb-prs

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

            Bug ID: 30935
           Summary: Regression exposed by new
                    gdb.python/py-progspace-events.exp  test and
                    native-extended-gdbserver board
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: aburgess at redhat dot com
  Target Milestone: ---

New test gdb.python/py-progspace-events.exp was added with commit:

  commit 59912fb2d22f8a4bb0862487f12a5cc65b6a013f
  Date:   Tue Sep 19 11:45:36 2023 +0100

      gdb: add Python events for program space addition and removal

This test fails when run with the native-extended-gdbserver board.  The failure
mode is that GDB crashes when std::terminate is called while handling an
exception.

If the same test is run using GDB 13 then GDB doesn't crash -- obviously the
events part of the test which uses the new functionality from the above commit
FAILs, but GDB doesn't crash.

All the test does is arrange to follow the parent and child after a fork, and
then allows the child process to exit, before trying to step the parent, this
doesn't feel unreasonable.

The crash can be reproduced using these commands:

  set trace-commands on
  set height 0
  set width 0
  set sysroot
  target extended-remote | ./gdbserver/gdbserver --once --multi -
/tmp/build/gdb/testsuite/outputs/gdb.python/py-progspace-events/py-progspace-events
  file
/tmp/build/gdb/testsuite/outputs/gdb.python/py-progspace-events/py-progspace-events
  set remote exec-file
/tmp/build/gdb/testsuite/outputs/gdb.python/py-progspace-events/py-progspace-events
  break -qualified main
  run
  break breakpt
  continue
  set detach-on-fork off
  continue
  inferior 2
  continue
  continue
  inferior 1
  step

On master (59912fb2d22) I see this fail with:

  +step
  terminate called after throwing an instance of 'gdb_exception_error'


  Fatal signal: Aborted
  ... etc ...

Simon reported this issue here:
https://inbox.sourceware.org/gdb-patches/18e22709-5bec-4175-a057-09ee92415a46@simark.ca/

The crash backtrace from his report is:

    #4  0x000055a4a0fae18d in error (fmt=0x55a49adcd020 "Cannot execute this
command while the target is running.\nUse the \"interrupt\" command to stop the
target\nand then try again.") at
/home/smarchi/src/binutils-gdb/gdbsupport/errors.cc:46
    #5  0x000055a49ec2f495 in remote_target::putpkt_binary
(this=0x61b00003f080, buf=0x62d00371e400 "qXfer:auxv:read::0,1000", cnt=23) at
/home/smarchi/src/binutils-gdb/gdb/remote.c:9740
    #6  0x000055a49ec2efc4 in remote_target::putpkt (this=0x61b00003f080,
buf=0x62d00371e400 "qXfer:auxv:read::0,1000") at
/home/smarchi/src/binutils-gdb/gdb/remote.c:9698
    #7  0x000055a49ec8b287 in remote_target::putpkt (this=0x61b00003f080,
buf=std::__debug::vector of length 36862, capacity 36862 = {...}) at
/home/smarchi/src/binutils-gdb/gdb/remote.c:1211
    #8  0x000055a49ec45c59 in remote_target::remote_read_qxfer
(this=0x61b00003f080, object_name=0x55a49adced00 "auxv", annex=0x0,
readbuf=0x62100057f900 '\276' <repeats 200 times>..., offset=0,
len=3904966623561266976, xfered_len=0x7f5f31c5f220, which_packet=18) at
/home/smarchi/src/binutils-gdb/gdb/remote.c:11316
    #9  0x000055a49ec47573 in remote_target::xfer_partial (this=0x61b00003f080,
object=TARGET_OBJECT_AUXV, annex=0x0, readbuf=0x62100057f900 '\276' <repeats
200 times>..., writebuf=0x0, offset=0, len=4096, xfered_len=0x7f5f31c5f220) at
/home/smarchi/src/binutils-gdb/gdb/remote.c:11438
    #10 0x000055a49f4595b1 in target_xfer_partial (ops=0x61b00003f080,
object=TARGET_OBJECT_AUXV, annex=0x0, readbuf=0x62100057f900 '\276' <repeats
200 times>..., writebuf=0x0, offset=0, len=4096, xfered_len=0x7f5f31c5f220) at
/home/smarchi/src/binutils-gdb/gdb/target.c:1717
    #11 0x000055a49f45aed9 in target_read_partial (ops=0x61b00003f080,
object=TARGET_OBJECT_AUXV, annex=0x0, buf=0x62100057f900 '\276' <repeats 200
times>..., offset=0, len=4096, xfered_len=0x7f5f31c5f220) at
/home/smarchi/src/binutils-gdb/gdb/target.c:1951
    #12 0x000055a49f501472 in target_read_alloc_1<unsigned char>
(ops=0x61b00003f080, object=TARGET_OBJECT_AUXV, annex=0x0) at
/home/smarchi/src/binutils-gdb/gdb/target.c:2286
    #13 0x000055a49f45c9c2 in target_read_alloc (ops=0x61b00003f080,
object=TARGET_OBJECT_AUXV, annex=0x0) at
/home/smarchi/src/binutils-gdb/gdb/target.c:2315
    #14 0x000055a49c920733 in target_read_auxv_raw (ops=0x61b00003f080) at
/home/smarchi/src/binutils-gdb/gdb/auxv.c:379
    #15 0x000055a49c920501 in target_read_auxv () at
/home/smarchi/src/binutils-gdb/gdb/auxv.c:368
    #16 0x000055a49c920c06 in target_auxv_search (match=0, valp=0x7f5f31a2fc60)
at /home/smarchi/src/binutils-gdb/gdb/auxv.c:415
    #17 0x000055a49e13e669 in linux_is_uclinux () at
/home/smarchi/src/binutils-gdb/gdb/linux-tdep.c:433
    #18 0x000055a49e13e6fa in linux_has_shared_address_space
(gdbarch=0x61c00001e080) at /home/smarchi/src/binutils-gdb/gdb/linux-tdep.c:440
    #19 0x000055a49c720d6f in gdbarch_has_shared_address_space
(gdbarch=0x61c00001e080) at /home/smarchi/src/binutils-gdb/gdb/gdbarch.c:4889
    #20 0x000055a49e7ce076 in program_space::~program_space
(this=0x61300004af00, __in_chrg=<optimized out>) at
/home/smarchi/src/binutils-gdb/gdb/progspace.c:124
    #21 0x000055a49de5d91e in delete_inferior (inf=0x61800007f080) at
/home/smarchi/src/binutils-gdb/gdb/inferior.c:290
    #22 0x000055a49de604b7 in prune_inferiors () at
/home/smarchi/src/binutils-gdb/gdb/inferior.c:480
    #23 0x000055a49debd2d9 in fetch_inferior_event () at
/home/smarchi/src/binutils-gdb/gdb/infrun.c:4558

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

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

end of thread, other threads:[~2023-10-05 17:24 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-02 21:15 [Bug gdb/30935] New: Regression exposed by new gdb.python/py-progspace-events.exp test and native-extended-gdbserver board aburgess at redhat dot com
2023-10-02 21:15 ` [Bug gdb/30935] " aburgess at redhat dot com
2023-10-02 22:58 ` aburgess at redhat dot com
2023-10-03 13:56 ` simon.marchi at polymtl dot ca
2023-10-03 14:25 ` simon.marchi at polymtl dot ca
2023-10-03 16:23 ` aburgess at redhat dot com
2023-10-05 17:23 ` cvs-commit at gcc dot gnu.org
2023-10-05 17:24 ` simon.marchi at polymtl 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).