Skip to content

Conversation

@bjorn3
Copy link
Member

@bjorn3 bjorn3 commented Oct 23, 2025

And if an allocation while printing the backtrace fails, don't try to print another backtrace as that will never succeed.

Split out of #147725 to allow landing this independently of a decision whether or not to remove -Zoom=panic.

@rustbot
Copy link
Collaborator

rustbot commented Oct 23, 2025

The Miri subtree was changed

cc @rust-lang/miri

@rustbot rustbot added 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. labels Oct 23, 2025
@rustbot
Copy link
Collaborator

rustbot commented Oct 23, 2025

r? @Mark-Simulacrum

rustbot has assigned @Mark-Simulacrum.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@RalfJung
Copy link
Member

Cc @Amanieu @m-ou-se

Copy link
Member

@Mark-Simulacrum Mark-Simulacrum left a comment

Choose a reason for hiding this comment

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

r=me with safety comment removed or clarified, if we don't want review from Mara or Amanieu. (Or think this needs libs-api signoff since it's sort of new public feature).

View changes since this review

let mut lock = crate::sys::backtrace::lock();

match crate::panic::get_backtrace_style() {
// SAFETY: we took out a lock just a second ago.
Copy link
Member

Choose a reason for hiding this comment

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

It's not clear to me what this safety comment is on - I don't see any unsafe code here?

Copy link
Member Author

Choose a reason for hiding this comment

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

This was copied from the default panic hook. This comment originates from 1c8f9bb, which doesn't have unsafe code either. cc @jyn514

Copy link
Member

@jyn514 jyn514 Nov 4, 2025

Choose a reason for hiding this comment

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

BacktraceLock::print is incorrectly marked as safe. It and all callers should be marked unsafe. See 1c8f9bb?w=1#diff-1b221b9e32f6143fdd8a5505c8893377e8e9eb1ff47b988716343c7e70393b1bR40.

Copy link
Member Author

Choose a reason for hiding this comment

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

Why is it not safe? The mere fact that you have a BacktraceLock (which you need to call print) means that no other thread can be printing a backtrace, right?

Copy link
Member

Choose a reason for hiding this comment

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

oh, right. probably the safety comment should just be moved inside that function then?

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

@Amanieu
Copy link
Member

Amanieu commented Nov 8, 2025

LGTM from the libs side

@bors r=Mark-Simulacrum

@bors
Copy link
Collaborator

bors commented Nov 8, 2025

📌 Commit 91ed7a6 has been approved by Mark-Simulacrum

It is now in the queue for this repository.

@bors bors 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 Nov 8, 2025
jhpratt added a commit to jhpratt/rust that referenced this pull request Nov 8, 2025
…acrum

Show backtrace on allocation failures when possible

And if an allocation while printing the backtrace fails, don't try to print another backtrace as that will never succeed.

Split out of rust-lang#147725 to allow landing this independently of a decision whether or not to remove `-Zoom=panic`.
bors added a commit that referenced this pull request Nov 8, 2025
Rollup of 15 pull requests

Successful merges:

 - #147404 (Fix issue with callsite inline attribute not being applied sometimes.)
 - #147534 (Implement SIMD funnel shifts in const-eval/Miri)
 - #147686 (update isolate_highest_one for NonZero<T>)
 - #148020 (Show backtrace on allocation failures when possible)
 - #148204 (Modify contributor email entries in .mailmap)
 - #148230 (rustdoc: Properly highlight shebang, frontmatter & weak keywords in source code pages and code blocks)
 - #148555 (Fix rust-by-example spanish translation)
 - #148556 (Fix suggestion for returning async closures)
 - #148585 ([rustdoc] Replace `print` methods with functions to improve code readability)
 - #148600 (re-use `self.get_all_attrs` result for pass indirectly attribute)
 - #148612 (Add note for identifier with attempted hygiene violation)
 - #148613 (Switch hexagon targets to rust-lld)
 - #148644 ([bootstrap] Make `--open` option work with `doc src/tools/error_index_generator`)
 - #148649 (don't completely reset `HeadUsages`)
 - #148675 (Remove eslint-js from npm dependencies)

r? `@ghost`
`@rustbot` modify labels: rollup
jhpratt added a commit to jhpratt/rust that referenced this pull request Nov 8, 2025
…acrum

Show backtrace on allocation failures when possible

And if an allocation while printing the backtrace fails, don't try to print another backtrace as that will never succeed.

Split out of rust-lang#147725 to allow landing this independently of a decision whether or not to remove `-Zoom=panic`.
bors added a commit that referenced this pull request Nov 8, 2025
Rollup of 16 pull requests

Successful merges:

 - #147534 (Implement SIMD funnel shifts in const-eval/Miri)
 - #147686 (update isolate_highest_one for NonZero<T>)
 - #148020 (Show backtrace on allocation failures when possible)
 - #148204 (Modify contributor email entries in .mailmap)
 - #148230 (rustdoc: Properly highlight shebang, frontmatter & weak keywords in source code pages and code blocks)
 - #148279 (rustc_builtin_macros: rename bench parameter to avoid collisions with user-defined function names)
 - #148555 (Fix rust-by-example spanish translation)
 - #148556 (Fix suggestion for returning async closures)
 - #148585 ([rustdoc] Replace `print` methods with functions to improve code readability)
 - #148600 (re-use `self.get_all_attrs` result for pass indirectly attribute)
 - #148612 (Add note for identifier with attempted hygiene violation)
 - #148613 (Switch hexagon targets to rust-lld)
 - #148619 (Enable std locking functions on AIX)
 - #148644 ([bootstrap] Make `--open` option work with `doc src/tools/error_index_generator`)
 - #148649 (don't completely reset `HeadUsages`)
 - #148675 (Remove eslint-js from npm dependencies)

r? `@ghost`
`@rustbot` modify labels: rollup
@Zalathar
Copy link
Member

Zalathar commented Nov 8, 2025

Failed in rollup: #148686 (comment)

@bors r-

@bors bors 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 Nov 8, 2025
@bjorn3
Copy link
Member Author

bjorn3 commented Nov 10, 2025

@bors try jobs=aarch64-msvc-1

rust-bors bot added a commit that referenced this pull request Nov 10, 2025
Show backtrace on allocation failures when possible

try-job: aarch64-msvc-1
@rust-bors

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-bors
Copy link

rust-bors bot commented Nov 10, 2025

💔 Test for 3b69a59 failed: CI. Failed jobs:

@rustbot
Copy link
Collaborator

rustbot commented Nov 24, 2025

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.

@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Nov 26, 2025
bors added a commit that referenced this pull request Nov 26, 2025
Show backtrace on allocation failures when possible

And if an allocation while printing the backtrace fails, don't try to print another backtrace as that will never succeed.

Split out of #147725 to allow landing this independently of a decision whether or not to remove `-Zoom=panic`.
@bors
Copy link
Collaborator

bors commented Nov 26, 2025

⌛ Testing commit 4627bff with merge 91c7271...

@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Collaborator

bors commented Nov 26, 2025

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Nov 26, 2025
The content of the baz function has always been on line 5, not line 15.
Presumably it previously accidentally worked as the call in the foo
function is on line 15, but now it likely tail calls to bar.
@bjorn3
Copy link
Member Author

bjorn3 commented Nov 27, 2025

Fixed a test that seems like it happened to work by accident before.

@Mark-Simulacrum
Copy link
Member

@bors r+ rollup=never

@bors
Copy link
Collaborator

bors commented Nov 27, 2025

📌 Commit 16c84f9 has been approved by Mark-Simulacrum

It is now in the queue for this repository.

@bors bors 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 Nov 27, 2025
bors added a commit that referenced this pull request Nov 28, 2025
Show backtrace on allocation failures when possible

And if an allocation while printing the backtrace fails, don't try to print another backtrace as that will never succeed.

Split out of #147725 to allow landing this independently of a decision whether or not to remove `-Zoom=panic`.
@bors
Copy link
Collaborator

bors commented Nov 28, 2025

⌛ Testing commit 16c84f9 with merge 66a677a...

@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-tools failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
warning ../../../../../package.json: License should be a valid SPDX license expression
warning No license field
[1/4] Resolving packages...
[2/4] Fetching packages...
error Error: https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz: Request failed "500 Internal Server Error"
    at ResponseError.ExtendableBuiltin (/node/lib/node_modules/yarn/lib/cli.js:696:66)
    at new ResponseError (/node/lib/node_modules/yarn/lib/cli.js:802:124)
    at Request.<anonymous> (/node/lib/node_modules/yarn/lib/cli.js:66750:16)
    at Request.emit (node:events:518:28)
    at module.exports.Request.onRequestResponse (/node/lib/node_modules/yarn/lib/cli.js:142287:10)
    at ClientRequest.emit (node:events:518:28)
    at HTTPParser.parserOnIncomingClient (node:_http_client:698:27)
    at HTTPParser.parserOnHeadersComplete (node:_http_common:119:17)
    at TLSSocket.socketOnData (node:_http_client:540:22)
    at TLSSocket.emit (node:events:518:28)
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
yarn install did not exit successfully

thread 'main' (59222) panicked at src/tools/rustdoc-gui-test/src/main.rs:63:10:
unable to install browser-ui-test: Custom { kind: Other, error: "yarn install returned exit code exit status: 1" }
stack backtrace:
   0: __rustc::rust_begin_unwind
             at /rustc/3b4dd9bf1410f8da6329baa36ce5e37673cbbd1f/library/std/src/panicking.rs:698:5
   1: core::panicking::panic_fmt
             at /rustc/3b4dd9bf1410f8da6329baa36ce5e37673cbbd1f/library/core/src/panicking.rs:80:14

@bors
Copy link
Collaborator

bors commented Nov 28, 2025

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Nov 28, 2025
@bjorn3
Copy link
Member Author

bjorn3 commented Nov 28, 2025

@bors retry yarnpkg returned an internal server error

@bors bors 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 Nov 28, 2025
@bors
Copy link
Collaborator

bors commented Nov 28, 2025

⌛ Testing commit 16c84f9 with merge 9050733...

@bors
Copy link
Collaborator

bors commented Nov 28, 2025

☀️ Test successful - checks-actions
Approved by: Mark-Simulacrum
Pushing 9050733 to main...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Nov 28, 2025
@bors bors merged commit 9050733 into rust-lang:main Nov 28, 2025
12 checks passed
@rustbot rustbot added this to the 1.93.0 milestone Nov 28, 2025
@bjorn3 bjorn3 deleted the oom_backtrace branch November 28, 2025 15:40
@github-actions
Copy link
Contributor

What is this? This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.

Comparing d645a4c (parent) -> 9050733 (this PR)

Test differences

Show 8 test diffs

Stage 1

  • [ui] tests/ui/alloc-error/alloc-error-backtrace.rs: [missing] -> pass (J0)

Stage 2

  • [ui] tests/ui/alloc-error/alloc-error-backtrace.rs: [missing] -> pass (J1)
  • [ui] tests/ui/alloc-error/alloc-error-backtrace.rs: [missing] -> ignore (gcc backend is marked as ignore) (J2)
  • [ui] tests/ui/alloc-error/alloc-error-backtrace.rs: [missing] -> ignore (ignored when the target environment is msvc (see Attempt to fix backtrace tests on i686-msvc #62897 and backtrace-debuginfo.rs test)) (J3)
  • [ui] tests/ui/alloc-error/alloc-error-backtrace.rs: [missing] -> ignore (ignored when the operating system is android (FIXME backtraces broken on the Android bot #17520)) (J4)
  • [ui] tests/ui/alloc-error/alloc-error-backtrace.rs: [missing] -> ignore (ignored when the operating system and target environment are windows-gnu) (J5)

Additionally, 2 doctest diffs were found. These are ignored, as they are noisy.

Job group index

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard 9050733395f7c10560d49f549e022f411fa28cea --output-dir test-dashboard

And then open test-dashboard/index.html in your browser to see an overview of all executed tests.

Job duration changes

  1. dist-aarch64-apple: 8503.9s -> 6925.0s (-18.6%)
  2. x86_64-gnu-gcc: 3454.0s -> 2820.6s (-18.3%)
  3. x86_64-gnu-llvm-20-1: 3459.3s -> 2933.1s (-15.2%)
  4. dist-apple-various: 3924.0s -> 4508.5s (+14.9%)
  5. dist-x86_64-apple: 7909.2s -> 6765.0s (-14.5%)
  6. x86_64-rust-for-linux: 3047.7s -> 2619.5s (-14.1%)
  7. x86_64-gnu-tools: 3734.0s -> 3231.2s (-13.5%)
  8. x86_64-gnu-llvm-20: 2862.0s -> 2526.4s (-11.7%)
  9. i686-gnu-1: 8157.6s -> 7260.6s (-11.0%)
  10. i686-gnu-nopt-1: 8199.4s -> 7302.1s (-10.9%)
How to interpret the job duration changes?

Job durations can vary a lot, based on the actual runner instance
that executed the job, system noise, invalidated caches, etc. The table above is provided
mostly for t-infra members, for simpler debugging of potential CI slow-downs.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (9050733): comparison URL.

Overall result: ❌ regressions - no action needed

@rustbot label: -perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.6% [0.5%, 0.8%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (primary -5.1%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-5.1% [-5.1%, -5.1%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -5.1% [-5.1%, -5.1%] 1

Cycles

Results (secondary -0.9%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
2.2% [2.2%, 2.2%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-4.0% [-4.0%, -4.0%] 1
All ❌✅ (primary) - - 0

Binary size

Results (primary 0.0%, secondary 0.1%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
0.0% [0.0%, 0.1%] 4
Regressions ❌
(secondary)
0.1% [0.1%, 0.2%] 35
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.0% [0.0%, 0.1%] 4

Bootstrap: 473.697s -> 473.019s (-0.14%)
Artifact size: 386.90 MiB -> 386.89 MiB (-0.00%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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.

10 participants