New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Intermittent "no entry found for key" error in infrastructure/testdriver tests #23964
Comments
Looks like you're seeing the same backtrace segfault that @mmatyas reported in #23966 (comment). As for the actual panic, we've seen this before in #21480. |
I can reproduce this panic with |
This happens for these tests when a webdriver operation that performs a hit test occurs before the first layout operation occurs. This layout operation is what populates the fields that the hit test relies upon, and when the testdriver code executes immediately during the initial page parse, layout can be suppressed as a performance optimization so the hit test has no information to rely upon. |
To demonstrate this, add |
Similarly, I can reproduce this if I refresh a page and click really fast as it starts loading. |
Interestingly, I think that this may be distinct from #21480, since APIs like Document::ElementsFromPoint should be triggering a layout operation before the hit test query occurs. I am unable to reproduce this panic with: <button>hi there</button>
<script>console.log(document.elementFromPoint(30, 30))</script> |
diff --git a/components/layout_thread/lib.rs b/components/layout_thread/lib.rs
index f03ca9f9d0..0289175af6 100644
--- a/components/layout_thread/lib.rs
+++ b/components/layout_thread/lib.rs
@@ -561,6 +561,20 @@ impl LayoutThread {
let font_cache_receiver =
ROUTER.route_ipc_receiver_to_new_crossbeam_receiver(ipc_font_cache_receiver);
+ // Let webrender know about this pipeline by sending an empty display list.
+ let mut epoch = Epoch(0);
+ let webrender_api = webrender_api_sender.create_api();
+ let mut txn = webrender_api::Transaction::new();
+ txn.set_display_list(
+ webrender_api::Epoch(epoch.0),
+ None,
+ Default::default(),
+ (id.to_webrender(), Default::default(), Default::default()),
+ false,
+ );
+ webrender_api.send_transaction(webrender_document, txn);
+ epoch.next();
+
LayoutThread {
id: id,
top_level_browsing_context_id: top_level_browsing_context_id,
@@ -588,9 +602,9 @@ impl LayoutThread {
document_shared_lock: None,
running_animations: ServoArc::new(RwLock::new(Default::default())),
expired_animations: ServoArc::new(RwLock::new(Default::default())),
- epoch: Cell::new(Epoch(0)),
+ epoch: Cell::new(epoch),
viewport_size: Size2D::new(Au(0), Au(0)),
- webrender_api: webrender_api_sender.create_api(),
+ webrender_api,
webrender_document,
stylist: Stylist::new(device, QuirksMode::NoQuirks),
rw_data: Arc::new(Mutex::new(LayoutThreadData { This patch makes the panic disappear, but I'm pretty sure it just hides the symptom - any click event will still be relying on a nonexistent display list so it won't end up clicking anything. I think the right solution is to force an up-to-date display list to be generated whenever an event occurs that requires interacting with a display list. |
no entry found for key (thread WRRenderBackend#0, at src/libcore/option.rs:1166)
appears most of the time when running theinfrastructure/testdriver
tests. I haven't been able to reproduce the error outside the test environment, but instead manage to tweak the test runner to use a debugging version of Servo in order to get access to the stacktrace.Stacktrace
This is where the panick happens. After some more debugging I found the contents of
self.spatial_nodes
,self.pipeline_root_nodes
andpipeline_id
:self.spatial_nodes
pipeline_root_nodes
}
pipeline_id
This should be easily reproducible:
./mach test-wpt --product=servodriver tests/wpt/web-platform-tests/infrastructure/testdriver/bless.html
The text was updated successfully, but these errors were encountered: