Skip to content

Replace watcher threads with panic handlers - #10572

Merged
bors-servo merged 1 commit into
servo:masterfrom
Manishearth:and-now-his-watch-is-ended
Apr 15, 2016
Merged

bors-servo merged 1 commit into
servo:masterfrom
Manishearth:and-now-his-watch-is-ended

Conversation

@Manishearth

Copy link
Copy Markdown
Member

This change is Reviewable

@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Apr 13, 2016
@Manishearth
Manishearth force-pushed the and-now-his-watch-is-ended branch 2 times, most recently from 10e2d69 to 1d8072c Compare April 13, 2016 17:24
@asajeffrey asajeffrey assigned asajeffrey and unassigned glennw Apr 13, 2016
@asajeffrey

Copy link
Copy Markdown
Contributor

This change looks fine, but we probably want a more comprehensive story about error handling at some point.


Reviewed 1 of 1 files at r1.
Review status: all files reviewed at latest revision, 1 unresolved discussion.


components/util/thread.rs, line 64 [r1] (raw file):
We could make this dest: S rather than dest: Option<S>, and then pass in () in the case where we're not sending a message.


Comments from Reviewable

@Manishearth

Copy link
Copy Markdown
Member Author

Review status: all files reviewed at latest revision, 1 unresolved discussion.


components/util/thread.rs, line 64 [r1] (raw file):
The only issue is that the debug log will always print in that case. Is that okay?


Comments from Reviewable

@asajeffrey

Copy link
Copy Markdown
Contributor

Review status: all files reviewed at latest revision, 1 unresolved discussion.


components/util/thread.rs, line 64 [r1] (raw file):
I think that's fine, debug! messages aren't a performance worry.


Comments from Reviewable

@Manishearth
Manishearth force-pushed the and-now-his-watch-is-ended branch from 1d8072c to cbb265e Compare April 13, 2016 20:08
@asajeffrey

Copy link
Copy Markdown
Contributor

Review status: 0 of 1 files reviewed at latest revision, 2 unresolved discussions.


components/util/thread.rs, line 92 [r2] (raw file):
We should probably reword this debug message.


Comments from Reviewable

@asajeffrey

Copy link
Copy Markdown
Contributor

Reviewed 1 of 1 files at r2.
Review status: all files reviewed at latest revision, 2 unresolved discussions.


Comments from Reviewable

@asajeffrey asajeffrey added S-needs-code-changes Changes have not yet been made that were requested by a reviewer. and removed S-awaiting-review There is new code that needs to be reviewed. labels Apr 13, 2016
@Manishearth
Manishearth force-pushed the and-now-his-watch-is-ended branch from cbb265e to 594a67f Compare April 13, 2016 23:23
@highfive highfive added S-awaiting-review There is new code that needs to be reviewed. and removed S-needs-code-changes Changes have not yet been made that were requested by a reviewer. labels Apr 13, 2016
@asajeffrey

Copy link
Copy Markdown
Contributor

@bors-servo r+

@bors-servo

Copy link
Copy Markdown
Contributor

📌 Commit 594a67f has been approved by asajeffrey

@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-awaiting-review There is new code that needs to be reviewed. labels Apr 14, 2016
@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit 594a67f with merge 67d3bb1...

bors-servo pushed a commit that referenced this pull request Apr 14, 2016
@bors-servo

Copy link
Copy Markdown
Contributor

💔 Test failed - mac-rel-wpt

@highfive highfive added S-tests-failed The changes caused existing tests to fail. and removed S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. labels Apr 14, 2016
@KiChjang

Copy link
Copy Markdown
Contributor
Ran 4669 tests finished in 1070.0 seconds.
  • 4668 ran as expected. 1361 tests skipped.
  • 1 tests timed out unexpectedly

Tests with unexpected results:
  ▶ TIMEOUT [expected CRASH] /html/semantics/embedded-content/the-img-element/update-the-image-data/fail-to-resolve.html
  │ 
  │ thread 'ScriptThread PipelineId { namespace_id: PipelineNamespaceId(0), index: PipelineIndex(0) }' panicked at 'called `Result::unwrap()` on an `Err` value: InvalidIpv6Address', ../src/libcore/result.rs:746
  │ stack backtrace:
  │    1:        0x10b6e82c8 - std::sys::backtrace::tracing::imp::write::h714760a4c8c0cdd8
  │    2:        0x10b6ee5b5 - std::panicking::default_hook::_$u7b$$u7b$closure$u7d$$u7d$::hff309ab1d83ffd90
  │    3:        0x10b6ee1cc - std::panicking::default_hook::h08ad3bb09872855b
  │    4:        0x10a95e1ed - util::thread::spawn_named_with_send_on_failure_maybe::_$u7b$$u7b$closure$u7d$$u7d$::_$u7b$$u7b$closure$u7d$$u7d$::h42c597ffe8d62528
  │    5:        0x10a95e1ed - util::thread::spawn_named_with_send_on_failure_maybe::_$u7b$$u7b$closure$u7d$$u7d$::_$u7b$$u7b$closure$u7d$$u7d$::h42c597ffe8d62528
  │    6:        0x10a95e1ed - util::thread::spawn_named_with_send_on_failure_maybe::_$u7b$$u7b$closure$u7d$$u7d$::_$u7b$$u7b$closure$u7d$$u7d$::h42c597ffe8d62528
  │    7:        0x10a95e1ed - util::thread::spawn_named_with_send_on_failure_maybe::_$u7b$$u7b$closure$u7d$$u7d$::_$u7b$$u7b$closure$u7d$$u7d$::h42c597ffe8d62528
  │    8:        0x10a95e1ed - util::thread::spawn_named_with_send_on_failure_maybe::_$u7b$$u7b$closure$u7d$$u7d$::_$u7b$$u7b$closure$u7d$$u7d$::h42c597ffe8d62528
  │    9:        0x10ac28f0d - util::thread::spawn_named_with_send_on_failure_maybe::_$u7b$$u7b$closure$u7d$$u7d$::_$u7b$$u7b$closure$u7d$$u7d$::h7b909c316fd96a1b
  │   10:        0x10ac28f0d - util::thread::spawn_named_with_send_on_failure_maybe::_$u7b$$u7b$closure$u7d$$u7d$::_$u7b$$u7b$closure$u7d$$u7d$::h7b909c316fd96a1b
  │   11:        0x10b6d5dc8 - std::sys_common::unwind::begin_unwind_inner::h406d5f1a330b854b
  │   12:        0x10b6d76fe - std::sys_common::unwind::begin_unwind_fmt::h57ea3fbee1a40196
  │   13:        0x10b6e7597 - rust_begin_unwind
  │   14:        0x10b715ff0 - core::panicking::panic_fmt::ha6b3c19493c123b3
  │   15:        0x10a4a5a92 - core::result::unwrap_failed::h0c839604c267a932
  │   16:        0x10a4a8f9d - _<dom..htmlimageelement..HTMLImageElement as dom..virtualmethods..VirtualMethods>::attribute_mutated::hca84433617991a25
  │   17:        0x10a1f5052 - script::dom::element::Element::push_attribute::h66f97a220dd374a5
  │   18:        0x10a1f4d3d - script::dom::element::Element::push_new_attribute::h1ec092485ab1d84c
  │   19:        0x10a1f582a - script::dom::element::Element::set_attribute_from_parser::h8b3a181ebd69b869
  │   20:        0x10a236c8d - script::parse::html::_<impl html5ever..tree_builder..TreeSink for dom..servohtmlparser..Sink>::create_element::h89dbe4111d373de7
  │   21:        0x10a4d09f2 - _<html5ever..tree_builder..TreeBuilder<Handle, Sink> as html5ever..tree_builder..actions..TreeBuilderActions<Handle>>::insert_element::hf6309733f5e7b254
  │   22:        0x10a4e017e - _<html5ever..tree_builder..TreeBuilder<Handle, Sink> as html5ever..tree_builder..rules..TreeBuilderStep>::step::h93ab3bfcf1691622
  │   23:        0x10a4c9c8c - _<html5ever..tree_builder..TreeBuilder<Handle, Sink> as html5ever..tokenizer..TokenSink>::process_token::h2ab46857f7deb4ad
  │   24:        0x10a4c9351 - _<html5ever..tokenizer..Tokenizer<Sink>>::process_token::h9af6f4ff4f9b91c3
  │   25:        0x10a4f707c - _<html5ever..tokenizer..Tokenizer<Sink>>::emit_current_tag::ha3a7e889987621fc
  │   26:        0x10a4f4960 - _<html5ever..tokenizer..Tokenizer<Sink>>::step::h6d0c3ad36918d153
  │   27:        0x10a4ecf87 - _<html5ever..tokenizer..Tokenizer<Sink>>::run::hd992ab6f97dc045a
  │   28:        0x10a4c393a - script::dom::servohtmlparser::ServoHTMLParser::parse_sync::h46474db81a0f7e9d
  │   29:        0x10a5adf06 - script::dom::document::Document::finish_load::hcfd8a11ed8391a31
  │   30:        0x10a5d83e8 - _<dom..htmlscriptelement..ScriptContext as net_traits..AsyncResponseListener>::response_complete::h40072aa6124e07ae
  │   31:        0x10acda1d5 - net_traits::ResponseAction::process::h0f42bbdc19738906
  │   32:        0x10a5dba01 - _<network_listener..ListenerRunnable<T> as script_thread..Runnable>::handler::h4eee1cf024ddf8d5
  │   33:        0x10a2558ce - script::script_thread::ScriptThread::handle_msg_from_script::hf5b489b6a847acd7
  │   34:        0x10a2a6dc8 - script::script_thread::ScriptThread::handle_msgs::_$u7b$$u7b$closure$u7d$$u7d$::h73eff2b1fdf241f0
  │   35:        0x10a294695 - script::script_thread::ScriptThread::handle_msgs::h56b62e268fb8eb5a
  │   36:        0x10a247d47 - std::sys_common::unwind::try::try_fn::h0857d23e95acfabe
  │   37:        0x10b6e752b - __rust_try
  │   38:        0x10b6e74b3 - std::sys_common::unwind::inner_try::h4e97625a08807651
  │   39:        0x10a24953a - _<F as std..boxed..FnBox<A>>::call_box::hfdc004bdc48c980d
  │   40:        0x10b6ed628 - std::sys::thread::Thread::new::thread_start::h74af400293164137
  │   41:     0x7fff86bcf059 - _pthread_body
  └   42:     0x7fff86bcefd6 - _pthread_start

@asajeffrey

Copy link
Copy Markdown
Contributor

@bors-servo retry

  • testing to see if html/semantics/embedded-content/the-img-element/update-the-image-data/fail-to-resolve.html is a new intermittent

@bors-servo

Copy link
Copy Markdown
Contributor

⚡ Previous build results for android, arm32, arm64, linux-dev, mac-dev-unit, mac-rel-css are reusable. Rebuilding only linux-rel, mac-rel-wpt...

@Manishearth
Manishearth force-pushed the and-now-his-watch-is-ended branch from b306581 to da2f044 Compare April 14, 2016 16:38
@Manishearth

Copy link
Copy Markdown
Member Author

Moved to panicking.rs. r?

@asajeffrey

Copy link
Copy Markdown
Contributor

Reviewed 5 of 5 files at r6.
Review status: all files reviewed at latest revision, 5 unresolved discussions.


components/servo/main.rs, line 55 [r6] (raw file):
Can we replace this by set_hook(Box::new(panic_hook)) and have servo::util::panicking just export panic_hook?


components/util/panicking.rs, line 27 [r6] (raw file):
This seems over-complex compared to just exporting a function panic_hook and letting the main program decide how/when to register it.


components/util/thread.rs, line 85 [r6] (raw file):
I really don't like this, since it's adding some completely unknown code to the panic hook. We should try to avoid any potential source of double-panic.


ports/gonk/src/main.rs, line 65 [r6] (raw file):
Same comment as for servo/main.rs.


Comments from Reviewable

@asajeffrey asajeffrey added S-awaiting-answer Someone asked a question that requires an answer. and removed S-awaiting-review There is new code that needs to be reviewed. labels Apr 14, 2016
@Manishearth

Copy link
Copy Markdown
Member Author

Review status: all files reviewed at latest revision, 5 unresolved discussions, some commit checks failed.


components/servo/main.rs, line 55 [r6] (raw file):
We can't, because the new hook will need to capture the old hook. This is why the panic hook is a closure in the first place.


components/util/panicking.rs, line 27 [r6] (raw file):
It needs to capture the old hook.


components/util/thread.rs, line 85 [r6] (raw file):
This function is private, the public function above uses implementors of SendOnFailure which can be verified for double panics above


Comments from Reviewable

@asajeffrey

Copy link
Copy Markdown
Contributor

Review status: all files reviewed at latest revision, 5 unresolved discussions, some commit checks failed.


components/servo/main.rs, line 55 [r6] (raw file):
Why does it? Shouldn't this be up to the main program?


components/util/thread.rs, line 85 [r6] (raw file):
I still prefer the original, it was easier to see which code is being executed.


Comments from Reviewable

@bors-servo

Copy link
Copy Markdown
Contributor

☔ The latest upstream changes (presumably #10589) made this pull request unmergeable. Please resolve the merge conflicts.

@highfive highfive added the S-needs-rebase There are merge conflict errors. label Apr 14, 2016
@Manishearth
Manishearth force-pushed the and-now-his-watch-is-ended branch from da2f044 to f02fd63 Compare April 14, 2016 20:23
@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Apr 14, 2016
@asajeffrey

asajeffrey commented Apr 15, 2016 •

Copy link
Copy Markdown
Contributor

OK, we're agreed (in IRC) that in the long term, the call to initialize the panic hook will be replaced by having the constellation panic handler printing the backtrace. So this can go through as-is.

@asajeffrey

Copy link
Copy Markdown
Contributor

@bors-servo r+

@bors-servo

Copy link
Copy Markdown
Contributor

📌 Commit f02fd63 has been approved by asajeffrey

@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-awaiting-review There is new code that needs to be reviewed. S-needs-rebase There are merge conflict errors. S-awaiting-answer Someone asked a question that requires an answer. labels Apr 15, 2016
@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit f02fd63 with merge ccfd768...

bors-servo pushed a commit that referenced this pull request Apr 15, 2016
@bors-servo

Copy link
Copy Markdown
Contributor

☀️ Test successful - android, arm32, arm64, linux-dev, linux-rel, mac-dev-unit, mac-rel-css, mac-rel-wpt

@bors-servo
bors-servo merged commit f02fd63 into servo:master Apr 15, 2016
@highfive highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Apr 15, 2016
@Manishearth
Manishearth deleted the and-now-his-watch-is-ended branch April 16, 2016 03:08
bors-servo pushed a commit that referenced this pull request Apr 19, 2016
Dedicated panic channel

Added a dedicated panic channel, and removed the panic messages for the script and layout threads. This is needed so that other threads can report panics, which is part of #10334.

Note that this PR includes the commit from #10572, so should land after it lands.

r? @Manishearth

<!-- 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/10641)
<!-- Reviewable:end -->
bors-servo pushed a commit that referenced this pull request Apr 19, 2016
Dedicated panic channel

Added a dedicated panic channel, and removed the panic messages for the script and layout threads. This is needed so that other threads can report panics, which is part of #10334.

Note that this PR includes the commit from #10572, so should land after it lands.

r? @Manishearth

<!-- 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/10641)
<!-- Reviewable:end -->
@kaksmet kaksmet mentioned this pull request Apr 26, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants