Repository navigation
Skip printing the backtrace for RecvError/SendError - #10329
Conversation
| let new_handler = move |info: &PanicInfo| { | ||
| let payload = info.payload(); | ||
| if let Some(s) = payload.downcast_ref::<String>() { | ||
| if s.contains("SendError") { |
There was a problem hiding this comment.
We could perhaps improve this check with a better regex match.
8be0ce5 to
9e75d23
Compare
We currently get tons of useless backtraces clogging up the output when we have a panic cascade. This adds a handler that outputs a single line when a thread panics due to a sender or receiver hanging up, since this is almost always due to a panic cascade.
9e75d23 to
ed3f7f5
Compare
|
We still get panic cascades with IPC, however I'm not sure if that's due to #10260 or is a general thing/ |
| use std::thread::Builder; | ||
| use thread_state; | ||
|
|
||
| #[allow(unused_must_use)] |
There was a problem hiding this comment.
I skip the result of write!. I don't want to panic within a panic handler, and if stderr is broken I don't see much point of trying to output an error either.
dc32046 to
9142fab
Compare
9142fab to
1aa6d55
Compare
|
My fear is that this will suppress useful backtraces for errors that are not part of a panic cascade that happen to involve sending or receiving on an invalid sender/receiver. |
|
That's the only time you can get SendError/RecvError |
|
Can't you get a SendError/RecvError if the other half of the channel has been reclaimed? So this would eat the stack trace even in cases where there's not a panic cascade. In production use, there's a request (#10334) to send an event to the chrome, which can determine how best to present panics to the user. We might want to rely on that for the UX of panics, rather than trying to do a regex-based edit. Reviewed 1 of 2 files at r1, 1 of 1 files at r3. Comments from the review on Reviewable.io |
|
I could add a cmdline option to get it back. I'm not sure how #10334 can be handled. By the time you reach a panic handler, that thread is effectively gone already -- the relevant machinery to report that error is already missing. |
|
I added a commandline option. As far as #10334, one way to handle this might be to have a global privileged "parent window". Windows corresponding to browser.html and those using that API have this. On Servo's side we store a global once-initialized static channel to its script task, and in the panic handler if we find such a channel and sending messages to the window works (use The alternative is to have each |
|
IRC conversation at http://logs.glob.uno/?c=mozilla%23servo#c399939 Reviewed 2 of 2 files at r4. Comments from Reviewable |
71e27e2 to
a2c82a0
Compare
|
@bors-servo r+ |
|
📌 Commit a2c82a0 has been approved by |
Skip printing the backtrace for RecvError/SendError We currently get tons of useless backtraces clogging up the output when we have a panic cascade. This adds a handler that outputs a single line when a thread panics due to a sender or receiver hanging up, since this is almost always due to a panic cascade. We could add a commandline arg that gets us back the old behavior, though I'm not sure if this is necessary. r? @asajeffrey <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10329) <!-- Reviewable:end -->
|
💔 Test failed - linux-rel |
|
@bors-servo retry this sounds like a problem with the infra, let's see if it's intermittent |
|
⚡ Previous build results for android, arm32, linux-dev, mac-dev-unit, mac-rel-css, mac-rel-wpt, status-appveyor are reusable. Rebuilding only linux-rel... |
|
@Manishearth That's #10398. |
|
💔 Test failed - linux-rel |
|
⚡ Previous build results for android, arm32, linux-dev, mac-dev-unit, mac-rel-css, mac-rel-wpt, status-appveyor are reusable. Rebuilding only linux-rel... |
|
💔 Test failed - linux-rel |
|
Huh, looks like github search can't find that if I search for XFree |
Skip printing the backtrace for RecvError/SendError We currently get tons of useless backtraces clogging up the output when we have a panic cascade. This adds a handler that outputs a single line when a thread panics due to a sender or receiver hanging up, since this is almost always due to a panic cascade. We could add a commandline arg that gets us back the old behavior, though I'm not sure if this is necessary. r? @asajeffrey <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10329) <!-- Reviewable:end -->
|
☀️ Test successful - android, arm32, linux-dev, linux-rel, mac-dev-unit, mac-rel-css, mac-rel-wpt, status-appveyor |
We currently get tons of useless backtraces clogging up the output when we have a panic cascade. This adds a handler that outputs a single line when a thread panics due to a sender or receiver hanging up, since this is almost always due to a panic cascade.
We could add a commandline arg that gets us back the old behavior, though I'm not sure if this is necessary.
r? @asajeffrey
This change is