public inbox for gdb-prs@sourceware.org help / color / mirror / Atom feed
From: "ks132 at yandex dot ru" <sourceware-bugzilla@sourceware.org> 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 [thread overview] Message-ID: <bug-29374-4717@http.sourceware.org/bugzilla/> (raw) https://sourceware.org/bugzilla/show_bug.cgi?id=29374 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 <map> #include <stdexcept> #include <sstream> class Handler { public: typedef int key_type; typedef std::map<key_type, int> 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 = data.find(key); if(it == 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 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=this@entry=0x7fffffffde90, ../../gdb/../gdbsupport/array-view.h:217: internal-error: copy: Assertion `dest.size () == 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: <https://www.gnu.org/software/gdb/bugs/>. Aborted (core dumped) -- You are receiving this mail because: You are on the CC list for the bug.
next reply other threads:[~2022-07-17 20:31 UTC|newest] Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-07-17 20:31 ks132 at yandex dot ru [this message] 2022-07-20 20:15 ` [Bug backtrace/29374] " ks132 at yandex dot ru 2022-07-23 13:53 ` ks132 at yandex dot ru 2022-07-24 1:55 ` simark at simark dot ca 2022-07-24 4:00 ` simark at simark dot ca 2022-07-28 2:34 ` simark at simark dot ca
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-29374-4717@http.sourceware.org/bugzilla/ \ --to=sourceware-bugzilla@sourceware.org \ --cc=gdb-prs@sourceware.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).