Skip to content

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

Open
JayanAXHF wants to merge 9 commits into
rust-lang:mainfrom
JayanAXHF:tests/porting-no-debuginfo
Open

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

Conversation

@JayanAXHF

@JayanAXHF JayanAXHF commented Feb 19, 2026

Copy link
Copy Markdown
Member

View all comments

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

rustbot commented Feb 19, 2026

Copy link
Copy Markdown
Collaborator

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

This comment has been minimized.

@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

rustbot commented Feb 19, 2026

Copy link
Copy Markdown
Collaborator

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 2 times, most recently from e93dd0f to 2ee2332 Compare February 19, 2026 19:12
@rust-log-analyzer

This comment has been minimized.

@JayanAXHF

Copy link
Copy Markdown
Member Author

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

@workingjubilee

Copy link
Copy Markdown
Member

that's weird.

Comment thread tests/ui/README.md
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Member

Choose a reason for hiding this comment

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

Huuuh.

Copy link
Copy Markdown
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
Copy Markdown
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?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It's unclear in the current state to which "known problem" this discussion is referring to. Is it about __libc_start_main one?

I don't see how #152870 would be relevant in that context.

@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
Copy Markdown
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
@rustbot

This comment has been minimized.

@rustbot

This comment has been minimized.

@JayanAXHF JayanAXHF force-pushed the tests/porting-no-debuginfo branch from 2379773 to 9a54d99 Compare July 3, 2026 06:00
@rustbot

rustbot commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator

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

rustbot commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator

⚠️ Warning ⚠️

@JayanAXHF JayanAXHF force-pushed the tests/porting-no-debuginfo branch from 9a54d99 to 0e93d64 Compare July 3, 2026 06:02
@rust-log-analyzer

This comment has been minimized.

@workingjubilee

Copy link
Copy Markdown
Member

tidy??? really???

@workingjubilee

Copy link
Copy Markdown
Member

@bors r+

@rust-bors

rust-bors Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

📌 Commit f1cedf9 has been approved by workingjubilee

It is now in the queue for this repository.

🌲 The tree is currently closed for pull requests below priority 1000. This pull request will be tested once the tree is reopened.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 3, 2026
jhpratt added a commit to jhpratt/rust that referenced this pull request Jul 3, 2026
…fo, r=workingjubilee

Port the `without_debuginfo` test from `backtrace-rs` to the testsuite

Part of rust-lang#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
rust-bors Bot pushed a commit that referenced this pull request Jul 5, 2026
Rollup of 18 pull requests

Successful merges:

 - #158692 (Add release notes for 1.96.1)
 - #134021 (Implement `IntoIterator` for `[&[mut]] Box<[T; N], A>`)
 - #152860 (Port the `without_debuginfo` test from `backtrace-rs` to the testsuite)
 - #155932 (MIR Call terminator: evaluate destination place before arguments)
 - #156777 (Add -Zautodiff_post_passes flag to limit which llvm passes to run after enzyme to make autodiff tests more robust)
 - #157151 (JSON target specs: remove 'x86-softfloat' compatibility alias)
 - #157835 (expand free alias types in the auto-trait orphan check)
 - #158377 (add `-Zforce-intrinsic-fallback` flag)
 - #158434 (delegation: refactor AST -> HIR lowering)
 - #158552 (make some tidy errors around python easier to understand)
 - #158624 (borrowck: Introduce BlameConstraint::to_obligation_cause_from_path())
 - #158704 (Optimize `ArrayChunks::try_rfold` with `DoubleEndedIterator::next_chunk_back`)
 - #158711 (library: Comment on libtest's dicey internal soundness)
 - #158539 (Move `SizeHint` and `IoHandle` to `core::io`)
 - #158659 (refactor the normalization in `coerce_shared_info`)
 - #158689 (resolver: don't use `Finalize` when resolving visibilities during AST expansion)
 - #158698 (Update TypeVisitable implementation)
 - #158706 (Tweaks to MIR building scope API)
@JonathanBrouwer

Copy link
Copy Markdown
Contributor

💔 I suspect this PR failed tests as part of a rollup
@bors r-

After fixing the problem, consider running a try job for the failed job before re-approving.

Link to failure: #158753 (comment)

@rust-bors rust-bors Bot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jul 5, 2026
@rust-bors

rust-bors Bot commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

This pull request was unapproved.

This PR was contained in a rollup (#158753), which was unapproved.

View changes since this unapproval

@JayanAXHF

Copy link
Copy Markdown
Member Author

@workingjubilee can you squash the changes with bors?

@JayanAXHF

Copy link
Copy Markdown
Member Author

@JonathanBrouwer we might've found another target where the missing symbol thing happens

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-author Status: This is awaiting some action (such as code changes or more information) from the author. 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.

6 participants