From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id DB8983851C13; Wed, 29 Jun 2022 14:10:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DB8983851C13 From: "nils at os dot inf.tu-dresden.de" To: gdb-prs@sourceware.org Subject: [Bug backtrace/29298] New: Internal error when debugging Rust programs Date: Wed, 29 Jun 2022 14:10:40 +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: nils at os dot inf.tu-dresden.de 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: Wed, 29 Jun 2022 14:10:41 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D29298 Bug ID: 29298 Summary: Internal error when debugging Rust programs Product: gdb Version: 12.1 Status: UNCONFIRMED Severity: normal Priority: P2 Component: backtrace Assignee: unassigned at sourceware dot org Reporter: nils at os dot inf.tu-dresden.de Target Milestone: --- With some Rust programs, generating a backtrace leads to an internal error = in GDB: $ gdb target/debug/test GNU gdb (GDB) 12.1 Copyright (C) 2022 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-pc-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: . Find the GDB manual and other documentation resources online at: . For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from target/debug/test... warning: Missing auto-load script at offset 0 in section .debug_gdb_scripts of file /home/hrniels/test/foo/target/debug/test. Use `info auto-load python-scripts [REGEXP]' to list them. (gdb) b main Breakpoint 1 at 0x9530 (gdb) run Starting program: /home/hrniels/test/foo/target/debug/test=20 This GDB supports auto-downloading debuginfo from the following URLs: https://debuginfod.archlinux.org Enable debuginfod for this session? (y or [n]) n Debuginfod has been disabled. To make this setting permanent, add 'set debuginfod enabled off' to .gdbini= t. [Thread debugging using libthread_db enabled] Using host libthread_db library "/usr/lib/libthread_db.so.1". Breakpoint 1, 0x000055555555d530 in main () (gdb) bt ../../gdb/frame.c:2434: internal-error: inside_main_func: Assertion `block = !=3D nullptr' failed. A problem internal to GDB has been detected, further debugging may prove unreliable. ----- Backtrace ----- 0x563c6fccbb6b ??? 0x563c70009d44 ??? 0x563c700ccce3 ??? 0x563c6fde3fa2 ??? 0x563c6fef057d ??? 0x563c6fef283d ??? 0x563c6fdc2615 ??? 0x563c6ff7ace7 ??? 0x563c6fd01d74 ??? 0x563c6ffd1812 ??? 0x563c6fdc7bfc ??? 0x563c6fdc7c9d ??? 0x563c6fdb901f ??? 0x7fcb3b36c9df ??? 0x563c6fdbca3b ??? 0x563c6fdbcc23 ??? 0x563c6fdc7b2f ??? 0x563c700cd955 ??? 0x563c700cdd39 ??? 0x563c6fe8bd24 ??? 0x563c6fc37c04 ??? 0x7fcb3a22928f ??? 0x7fcb3a229349 ??? 0x563c6fc3e1e4 ??? 0xffffffffffffffff ??? --------------------- ../../gdb/frame.c:2434: internal-error: inside_main_func: Assertion `block = !=3D nullptr' failed. A problem internal to GDB has been detected, further debugging may prove unreliable. Quit this debugging session? (y or n) n I'm not exactly sure what the cause is, but the following Rust program can (hopefully) be used to reproduce the behavior: fn main() { println!("{}", std::env::var("RUST_LOG").unwrap_or_else(|_| "error".to_string())); } Note also that the problem goes away if I use `unwrap_or("error".to_string(= ))` instead of `unwrap_or_else(|_| "error".to_string())`. So, maybe the closure plays a role here? In case it matters, I'm using Rust 1.61.0 (a028ae4 2022-04-29). --=20 You are receiving this mail because: You are on the CC list for the bug.=