stress: locate panics per thread, and say when a panic is in a dependency - #2
Merged
Merged
Conversation
Panic sites were matched to callables by message text, so two sites that panic with the same message were filed under whichever printed first, and the second site never appeared as a finding. The driver now records, per native thread, which callable panicked and in what order, and keeps every distinct panic message per callable with a count. Rust prints the same thread id in its panic line, so the two sequences are joined in order: each site gets exactly the calls that panicked there, and a callable that panicked at two sites is counted at each. When Rust prints no thread id, a panic is located by message and a finding names every site that shares it. Signed-off-by: nimbrel <[email protected]>
…rame A panic inside a dependency (PyO3's conversions, any other crate, or the standard library) was located at the dependency's line with no stack, and the headline called it a panic "in your extension". The finding now says which dependency and version the site is in, names PyO3's argument conversion when it is there, and carries a `dependency` field; the headline counts such panics as "inside a dependency, reached from your extension". When the log holds a Rust backtrace, the first frame in the crate's own code becomes the location and the frames down to it become the stack; otherwise the message says to replay with RUST_BACKTRACE=1. Backtraces stay off by default: turned on for a whole run they slow each panicking call about tenfold, which changes the schedule being tested. Signed-off-by: nimbrel <[email protected]>
The single-threaded baseline never sees a mutator's transient state, so a call that panics on input a mutator made invalid read as a plain concurrency panic. When mutators ran, the stress/panic message now names them and restates the rule they must follow: keep the shared inputs valid at every instant. Signed-off-by: nimbrel <[email protected]>
Neither method panics on one thread; each panics at its own line once two threads overlap, with the same message. The sanitizer ground truth asserts one stress/panic finding per line, each naming only its own method. Signed-off-by: nimbrel <[email protected]>
Remove the message-matching limitation, describe the dependency label and the RUST_BACKTRACE replay, and add an Unreleased CHANGELOG section with the new JSON fields. Signed-off-by: nimbrel <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Panic findings from
stresswere matched to callables by message text, so two sites that panic with the same message could be filed under one callable, and a second site could disappear.RUST_BACKTRACE=1.stress/panicmessage says when mutators were running.stress.panics,stress.panic_threadsand adependencyfield on dependency panics.Always-on backtraces were measured and left off: they slowed calls about tenfold and changed the schedule under test.
New fixture
racy/stress-panic-two-sitesplus 10 tests.