public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/112491] New: std::deque<T,Allocator>::size xmethod output is wrong
@ 2023-11-12 12:21 ks1322 at gmail dot com
  2023-11-14  8:22 ` [Bug libstdc++/112491] " redi at gcc dot gnu.org
                   ` (13 more replies)
  0 siblings, 14 replies; 15+ messages in thread
From: ks1322 at gmail dot com @ 2023-11-12 12:21 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112491

            Bug ID: 112491
           Summary: std::deque<T,Allocator>::size xmethod output is wrong
           Product: gcc
           Version: 13.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ks1322 at gmail dot com
  Target Milestone: ---

For this code:
```
#include <deque>

int main()
{
    std::deque<int> d;

    d.push_front(0);
    return 0;
}
```
deque size xmethod produces wrong result
```
$ gdb -batch -ex "b 8" -ex r -ex "p d.size()" a.out
Breakpoint 1 at 0x4011f5: file /tmp/t.cpp, line 8.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".

Breakpoint 1, main () at /tmp/t.cpp:8
8           return 0;
$1 = 128
```

Expected result is 1 while actual result is 128.
As a workaround xmethods can be disabled with `disable xmethod`
```
$ gdb -batch -ex "b 8" -ex r -ex "disable xmethod" -ex "p d.size()" a.out
Breakpoint 1 at 0x4011f5: file /tmp/t.cpp, line 8.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".

Breakpoint 1, main () at /tmp/t.cpp:8
8           return 0;
$1 = 1
```

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

end of thread, other threads:[~2023-11-15 11:44 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-12 12:21 [Bug libstdc++/112491] New: std::deque<T,Allocator>::size xmethod output is wrong ks1322 at gmail dot com
2023-11-14  8:22 ` [Bug libstdc++/112491] " redi at gcc dot gnu.org
2023-11-14 14:56 ` redi at gcc dot gnu.org
2023-11-14 15:13 ` redi at gcc dot gnu.org
2023-11-14 15:58 ` cvs-commit at gcc dot gnu.org
2023-11-14 22:40 ` cvs-commit at gcc dot gnu.org
2023-11-14 22:43 ` cvs-commit at gcc dot gnu.org
2023-11-14 23:11 ` cvs-commit at gcc dot gnu.org
2023-11-14 23:12 ` redi at gcc dot gnu.org
2023-11-15 10:04 ` redi at gcc dot gnu.org
2023-11-15 11:28 ` cvs-commit at gcc dot gnu.org
2023-11-15 11:33 ` cvs-commit at gcc dot gnu.org
2023-11-15 11:35 ` cvs-commit at gcc dot gnu.org
2023-11-15 11:42 ` cvs-commit at gcc dot gnu.org
2023-11-15 11:44 ` redi at gcc dot gnu.org

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