From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 9695B3858D20; Sun, 12 Nov 2023 12:21:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9695B3858D20 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1699791672; bh=ONohkNOSeJvP6ctleS1Bn+OXN6GgSBPCYbN6qz90mjw=; h=From:To:Subject:Date:From; b=mVTm/1C1cSljPnZ20ZBfQzapfHeMXFA9A9pP9/YbKpqejM3o+vw1nu8LycwH1DGAX XlZ+fuixBfkEI0jycFYJpVqY6OHe8gG/1vOdi4/AsFQx7//YLcKfIfhvNxWgoLQsBS e5fPUQ02c1Oak1/VdB4MJyq0rLscZ0fMqt9Pl4W0= From: "ks1322 at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/112491] New: std::deque::size xmethod output is wrong Date: Sun, 12 Nov 2023 12:21:12 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 13.2.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: ks1322 at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D112491 Bug ID: 112491 Summary: std::deque::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 int main() { std::deque 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 =3D 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 =3D 1 ```=