public inbox for gdb-prs@sourceware.org help / color / mirror / Atom feed
From: "roidinev at gmail dot com" <sourceware-bugzilla@sourceware.org> To: gdb-prs@sourceware.org Subject: [Bug gdb/30224] New: Rust bt fail after the fix Fix "start" for D, Rust, etc Date: Mon, 13 Mar 2023 03:19:20 +0000 [thread overview] Message-ID: <bug-30224-4717@http.sourceware.org/bugzilla/> (raw) https://sourceware.org/bugzilla/show_bug.cgi?id=30224 Bug ID: 30224 Summary: Rust bt fail after the fix Fix "start" for D, Rust, etc Product: gdb Version: 13.1 Status: UNCONFIRMED Severity: critical Priority: P2 Component: gdb Assignee: unassigned at sourceware dot org Reporter: roidinev at gmail dot com Target Milestone: --- Before the commit, gdb use plain main for rust program. Now it use full name such as binaryname::main to lookup. But if fun in main have clousure , or linked with ffi. Once bt , then get_prev_frame-->inside_main_func(this_frame) will be called. In inside main_func, will use the full name binaryname::main to lookup, which will be not found, lead to the error: ``` ../../gdb/frame.c:2555: internal-error: inside_main_func: Assertion `block != nullptr' failed. A problem internal to GDB has been detected, further debugging may prove unreliable. ----- Backtrace ----- 0x5631a7be9279 gdb_internal_backtrace_1 ../../gdb/bt-utils.c:122 0x5631a7be9326 _Z22gdb_internal_backtracev ../../gdb/bt-utils.c:168 0x5631a824ac99 internal_vproblem ../../gdb/utils.c:401 0x5631a824b0b0 _Z15internal_verrorPKciS0_P13__va_list_tag ../../gdb/utils.c:481 0x5631a84100b5 _Z18internal_error_locPKciS0_z ../../gdbsupport/errors.cc:58 0x5631a7e1de86 inside_main_func ../../gdb/frame.c:2555 0x5631a7e1e1e2 _Z14get_prev_frame14frame_info_ptr ../../gdb/frame.c:2620 0x5631a800bef6 _Z26frame_info_to_frame_object14frame_info_ptr ../../gdb/python/py-frame.c:360 ``` I want to fix this issue and submit a pr. Need some explanation and help. One method: when lookup symbol , if we get full name and main language is rust, then fallback to use plain main to lookup. It is known before the commit, rust still use the plain main. One method: if we insist with full name after the new dwarf indexer, then where should the fix go? Note: if empty main fn or if main fn did not have closure in it, will not crash. ``` fn main() { println!("{}", std::env::var("RUST_LOG").unwrap_or_else(|_| "error1".to_string())); //crash //println!("{}", std::env::var("RUST_LOG").unwrap_or("error2".to_string())); //this is ok } ``` -- You are receiving this mail because: You are on the CC list for the bug.
next reply other threads:[~2023-03-13 3:19 UTC|newest] Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-03-13 3:19 roidinev at gmail dot com [this message] 2023-03-13 3:22 ` [Bug gdb/30224] " roidinev at gmail dot com 2023-03-13 12:15 ` [Bug rust/30224] " roidinev at gmail dot com 2023-03-13 20:14 ` tromey at sourceware dot org
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-30224-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).