From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id DA8B73858C50; Sun, 17 Jul 2022 20:31:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DA8B73858C50 From: "ks132 at yandex dot ru" To: gdb-prs@sourceware.org Subject: [Bug backtrace/29374] New: Internal-error when printing exception backtrace Date: Sun, 17 Jul 2022 20:31:45 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: backtrace X-Bugzilla-Version: 12.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: ks132 at yandex dot ru X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot 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://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gdb-prs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-prs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jul 2022 20:31:46 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D29374 Bug ID: 29374 Summary: Internal-error when printing exception backtrace Product: gdb Version: 12.1 Status: UNCONFIRMED Severity: normal Priority: P2 Component: backtrace Assignee: unassigned at sourceware dot org Reporter: ks132 at yandex dot ru Target Milestone: --- For this code: #include #include #include class Handler { public: typedef int key_type; typedef std::map map_type; public: void operator()(const key_type& key) const { find(key); } private: int find( const key_type& key ) const { typename map_type::const_iterator it =3D data.find(key); if(it =3D=3D data.end()) { std::ostringstream ost; throw std::runtime_error(ost.str()); } return it->second; } private: map_type data; }; class State { public: void find( int type ) { handlers( type ); } private: Handler handlers; }; int main() { State state; state.find( 0 ); } built with GCC 12.1.1 with optimization: g++ -O1 -g repro.cpp GDB crashes with internal-error: $ gdb -batch -ex "catch throw" -ex r -ex bt a.out=20 Catchpoint 1 (throw) [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib64/libthread_db.so.1". Catchpoint 1 (exception thrown), 0x00007ffff7e256d1 in __cxa_throw () from /lib64/libstdc++.so.6 #0 0x00007ffff7e256d1 in __cxa_throw () from /lib64/libstdc++.so.6 #1 0x0000000000401430 in Handler::find (this=3Dthis@entry=3D0x7fffffffde90, ../../gdb/../gdbsupport/array-view.h:217: internal-error: copy: Assertion `dest.size () =3D=3D src.size ()' failed. A problem internal to GDB has been detected, further debugging may prove unreliable. ----- Backtrace ----- 0x55895414fe3f ??? 0x558954589ab4 ??? 0x558954589d50 ??? 0x55895472cbf4 ??? 0x5589541f729d ??? 0x55895420f912 ??? 0x558954214239 ??? 0x55895421434a ??? 0x55895421446a ??? 0x5589544b2e88 ??? 0x5589544b36d0 ??? 0x5589544b80cc ??? 0x5589544b9277 ??? 0x558954187074 ??? 0x5589545205b7 ??? 0x55895433c5b1 ??? 0x55895433c681 ??? 0x55895433e613 ??? 0x55895433f13e ??? 0x55895407de6d ??? 0x7f1fbff9754f ??? 0x7f1fbff97608 ??? 0x558954086744 ??? 0xffffffffffffffff ??? --------------------- This is a bug, please report it. For instructions, see: . Aborted (core dumped) --=20 You are receiving this mail because: You are on the CC list for the bug.=