public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/28017] New: Out of bounds vector access when setting breakpoint on mach-o (macOS) executable
@ 2021-06-27  2:11 simark at simark dot ca
  2021-06-27  2:45 ` [Bug gdb/28017] " simark at simark dot ca
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: simark at simark dot ca @ 2021-06-27  2:11 UTC (permalink / raw)
  To: gdb-prs

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

            Bug ID: 28017
           Summary: Out of bounds vector access when setting breakpoint on
                    mach-o (macOS) executable
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: simark at simark dot ca
  Target Milestone: ---

Created attachment 13514
  --> https://sourceware.org/bugzilla/attachment.cgi?id=13514&action=edit
Reproducer

This can be reproduced on Linux, with an all targets build.  When built with
-D_GLIBCXX_DEBUG (or just with ASan, but the reported error will be different)
and using the repro files I'll attach to this bug, we get:

$ tree repro 
repro
├── test
└── test.dSYM
    └── Contents
        ├── Info.plist
        └── Resources
            └── DWARF
                └── test

4 directories, 3 files
$ ./gdb -nx --data-directory=data-directory -q repro/test -ex "b main" -batch
/usr/include/c++/11.1.0/debug/vector:438:
In function:
    std::__debug::vector<_Tp, _Allocator>::reference 
    std::__debug::vector<_Tp, 
    _Allocator>::operator[](std::__debug::vector<_Tp, 
    _Allocator>::size_type) [with _Tp = long unsigned int; _Allocator = 
    std::allocator<long unsigned int>; std::__debug::vector<_Tp, 
    _Allocator>::reference = long unsigned int&; std::__debug::vector<_Tp, 
    _Allocator>::size_type = long unsigned int]

Error: attempt to subscript container with out-of-bounds index 13, but 
container only holds 13 elements.

Objects involved in the operation:
    sequence "this" @ 0x0x61300000a590 {
      type = std::__debug::vector<unsigned long, std::allocator<unsigned long>
>;
    }
[1]    4018955 abort (core dumped)  ./gdb -nx --data-directory=data-directory
-q repro/test -ex "b main" -batch

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

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

end of thread, other threads:[~2021-06-28 19:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-27  2:11 [Bug gdb/28017] New: Out of bounds vector access when setting breakpoint on mach-o (macOS) executable simark at simark dot ca
2021-06-27  2:45 ` [Bug gdb/28017] " simark at simark dot ca
2021-06-28 19:31 ` cvs-commit at gcc dot gnu.org
2021-06-28 19:32 ` 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).