Skip to content

Port the without_debuginfo test from backtrace-rs to the testsuite#152860

Open
JayanAXHF wants to merge 7 commits intorust-lang:mainfrom
JayanAXHF:tests/porting-no-debuginfo
Open

Port the without_debuginfo test from backtrace-rs to the testsuite#152860
JayanAXHF wants to merge 7 commits intorust-lang:mainfrom
JayanAXHF:tests/porting-no-debuginfo

Conversation

@JayanAXHF
Copy link
Member

@JayanAXHF JayanAXHF commented Feb 19, 2026

Part of #122899

Ports over the without_debuginfo from backtrace-rs to the testsuite.
Caveat: I had to create a nightly feature backtrace_internals_accessors to access the internals of std::backtrace::Backtrace and std::backtrace::BacktraceFrames. It is not on the stabilisation track, since it doesn't have an ACP.

r? @workingjubilee

@JayanAXHF JayanAXHF added A-testsuite Area: The testsuite used to check the correctness of rustc C-enhancement Category: An issue proposing an enhancement or a PR with one. A-backtrace Area: Backtraces labels Feb 19, 2026
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 19, 2026
@rustbot
Copy link
Collaborator

rustbot commented Feb 19, 2026

workingjubilee is currently at their maximum review capacity.
They may take a while to respond.

@rustbot rustbot added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Feb 19, 2026
@rust-log-analyzer

This comment has been minimized.

@rustbot
Copy link
Collaborator

rustbot commented Feb 19, 2026

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@rustbot

This comment has been minimized.

@rustbot rustbot added has-merge-commits PR has merge commits, merge with caution. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Feb 19, 2026
@JayanAXHF JayanAXHF force-pushed the tests/porting-no-debuginfo branch from 6f4d672 to a7b8152 Compare February 19, 2026 18:58
@rustbot
Copy link
Collaborator

rustbot commented Feb 19, 2026

Some changes occurred in src/tools/cargo

cc @ehuss

@rustbot

This comment has been minimized.

@rustbot rustbot removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. has-merge-commits PR has merge commits, merge with caution. labels Feb 19, 2026
@JayanAXHF JayanAXHF force-pushed the tests/porting-no-debuginfo branch from 2afe45b to e93dd0f Compare February 19, 2026 19:11
@JayanAXHF JayanAXHF force-pushed the tests/porting-no-debuginfo branch from e93dd0f to 2ee2332 Compare February 19, 2026 19:12
@rust-log-analyzer

This comment has been minimized.

@JayanAXHF
Copy link
Member Author

@workingjubilee This CI failure seems unrelated to the test? Is this a known issue/regression?

@workingjubilee
Copy link
Member

that's weird.

Comment on lines +6 to +32
fn main() {
let mut missing_symbols = 0;
let mut has_symbols = 0;
let btrace = backtrace::Backtrace::force_capture();
let frames = btrace.frames();
for frame in frames {
let mut any = false;
for sym in frame.symbols() {
if sym.name().is_some() {
any = true;
break;
}
}
if any {
has_symbols += 1;
} else if !frame.ip().is_null() {
missing_symbols += 1;
}
}

// FIXME(#346) currently on MinGW we can't symbolize kernel32.dll and other
// system libraries, which means we miss the last few symbols.
if cfg!(windows) && cfg!(target_env = "gnu") {
assert!(missing_symbols < has_symbols && has_symbols > 4);
} else {
assert_eq!(missing_symbols, 0);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't a known problem, so we may need to determine how many frames are missing symbols and it may be aarch64-unknown-linux-gnu specific.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well it doesn't occur on my arm m2 mac so maybe it's specific? Might wanna check windows too to determine if it's x86

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huuuh.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops I misread the target. Do you mind if I rerun the CI for x86 Linux to try to repro the problem?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@workingjubilee I added some debug info to try to find the frame with the missing info. Also could #152870 be relevant to this?

@rust-log-analyzer

This comment has been minimized.

@JayanAXHF JayanAXHF force-pushed the tests/porting-no-debuginfo branch from 2f11378 to f245f10 Compare February 20, 2026 10:26
@JayanAXHF
Copy link
Member Author

--- stderr -------------------------------
missing symbol for frame 6: []
Full erroneous backtrace: Backtrace [
    { fn: "<std::backtrace::Backtrace>::create" },
    { fn: "all_frames_have_symbols::main" },
    { fn: "std::sys::backtrace::__rust_begin_short_backtrace::<fn(), ()>" },
    { fn: "std::rt::lang_start::<()>::{closure#0}" },
    { fn: "std::rt::lang_start_internal" },
    { fn: "main" },
    { fn: "__libc_start_main" },
    { fn: "_start" },
]
thread 'main' (117654) panicked at /checkout/tests/ui/no_debuginfo/all_frames_have_symbols.rs:37:9:
assertion `left == right` failed
  left: 1
 right: 0
stack backtrace:
   0: __rustc::rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::panicking::assert_failed_inner
   3: core::panicking::assert_failed::<i32, i32>
   4: all_frames_have_symbols::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
------------------------------------------

This is the relevant debug log. Apparently the __libc_start_main doesn't have a symbol

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@JayanAXHF JayanAXHF force-pushed the tests/porting-no-debuginfo branch from 60edd1c to a54b642 Compare February 24, 2026 11:15
@JayanAXHF
Copy link
Member Author

@workingjubilee do you have any time to look at this soon?

@JayanAXHF JayanAXHF requested a review from workingjubilee March 8, 2026 04:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-backtrace Area: Backtraces A-testsuite Area: The testsuite used to check the correctness of rustc C-enhancement Category: An issue proposing an enhancement or a PR with one. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants