New issue
Advanced search Search tips

Issue 711325 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Apr 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug

Blocked on:
issue 600773

Blocking:
issue 625701



Sign in to add a comment

Re-entrancy in PassthroughTouchEventQueue fragile.

Project Member Reported by tdres...@chromium.org, Apr 13 2017

Issue description

I'm attempting to fix the way we deal with unique touch event ids, and it's causing the PassThroughTouchEventQueue to break.

In particular, when InputRouterImpl::SendGestureEvent receives a gesture scroll begin, it calls PassThroughTouchEventQueue::PrependTouchScrollNotification, and then queues the event. However, the call to PrependTouchScrollNotification can cause later gestures to be dispatched, resulting in out of order gesture dispatch.

I've attached the patch which tickles this behavior.


 
fix_touch_event_id.patch
2.0 KB Download
Example failure:

[134697:134697:0413/125955.787874:FATAL:event_with_latency_info.h(53)] Check failed: other.latency.trace_id() > latency.trace_id() (8
589934633 vs. 8589934635)
#0 0x7f2c955cf177 base::debug::StackTrace::StackTrace()
#1 0x7f2c955f489b logging::LogMessage::~LogMessage()
#2 0x7f2c92f87000 content::EventWithLatencyInfo<>::CoalesceWith()
#3 0x7f2c92f856ea content::GestureEventQueue::QueueScrollOrPinchAndForwardIfNecessary()
#4 0x7f2c92f84dd2 content::GestureEventQueue::QueueEvent()
#5 0x7f2c92f890f9 content::InputRouterImpl::SendGestureEvent()
#6 0x7f2c9300d0e8 content::RenderWidgetHostImpl::ForwardGestureEventWithLatencyInfo()
#7 0x7f2c9300cf25 content::RenderWidgetHostImpl::ForwardGestureEvent()
#8 0x7f2c92f9d458 content::TouchEmulator::OnGestureEvent()
#9 0x7f2c8aa1930b ui::TouchDispositionGestureFilter::SendGesture()
#10 0x7f2c8aa17e4d ui::TouchDispositionGestureFilter::FilterAndSendPacket()
#11 0x7f2c8aa1890c ui::TouchDispositionGestureFilter::SendAckedEvents()
#12 0x7f2c8aa183f4 ui::TouchDispositionGestureFilter::OnTouchEventAck()
#13 0x7f2c92f9d0e9 content::TouchEmulator::HandleTouchEventAck()
#14 0x7f2c9301127e content::RenderWidgetHostImpl::OnTouchEventAck()
#15 0x7f2c92f8ad72 content::InputRouterImpl::OnTouchEventAck()
#16 0x7f2c92f915c0 content::PassthroughTouchEventQueue::AckCompletedEvents()
#17 0x7f2c92f91ccd content::PassthroughTouchEventQueue::ProcessTouchAck()
#18 0x7f2c92f8b239 content::InputRouterImpl::ProcessInputEventAck()
#19 0x7f2c92f89e54 content::InputRouterImpl::OnInputEventAck()
#20 0x7f2c92f89c99 _ZN3IPC8MessageTI38InputHostMsg_HandleInputEvent_ACK_MetaSt5tupleIJN7content13InputEventAckEEEvE8DispatchINS3_15In
putRouterImplES8_vMS8_FvRKS4_EEEbPKNS_7MessageEPT_PT0_PT1_T2_
#21 0x7f2c92f897ae content::InputRouterImpl::OnMessageReceived()
#22 0x7f2c930074a5 content::RenderWidgetHostImpl::OnMessageReceived()
#23 0x7f2c92ff4f5d content::RenderProcessHostImpl::OnMessageReceived()
#24 0x7f2c95a40b55 IPC::ChannelProxy::Context::OnDispatchMessage()
#25 0x7f2c95a43aba _ZN4base8internal7InvokerINS0_9BindStateIMN3IPC12ChannelProxy7ContextEFvRKNS3_7MessageEEJ13scoped_refptrIS5_ES6_EE
EFvvEE3RunEPNS0_13BindStateBaseE
#26 0x7f2c955cfc61 _ZNO4base8CallbackIFvvELNS_8internal8CopyModeE0ELNS2_10RepeatModeE0EE3RunEv
#27 0x7f2c955cfa93 base::debug::TaskAnnotator::RunTask()
#28 0x7f2c95600edd base::MessageLoop::RunTask()
#29 0x7f2c95601188 base::MessageLoop::DeferOrRunPendingTask()
#30 0x7f2c95601636 base::MessageLoop::DoWork()
#31 0x7f2c956037ea base::(anonymous namespace)::WorkSourceDispatch()
#32 0x7f2c8e5ffe04 g_main_context_dispatch
#33 0x7f2c8e600048 <unknown>
#34 0x7f2c8e6000ec g_main_context_iteration
#35 0x7f2c95603546 base::MessagePumpGlib::Run()
#36 0x7f2c95600c3e base::MessageLoop::RunHandler()
#37 0x7f2c95632bbc base::RunLoop::Run()
#38 0x5572103c95c4 ChromeBrowserMainParts::MainMessageLoopRun()
#39 0x7f2c92cec283 content::BrowserMainLoop::RunMainMessageLoopParts()
#40 0x7f2c92cef327 content::BrowserMainRunnerImpl::Run()
#41 0x7f2c92ce77d8 content::BrowserMain()
#42 0x7f2c934ec4ff content::RunNamedProcessTypeMain()
#43 0x7f2c934ed222 content::ContentMainRunnerImpl::Run()
#44 0x7f2c8aa28eff service_manager::Main()
#45 0x7f2c934ebd72 content::ContentMain()
#46 0x55720fcb61a1 ChromeMain
#47 0x7f2c8b9ebf45 __libc_start_main
#48 0x55720fcb6019 <unknown>

Comment 2 by mustaq@chromium.org, Apr 13 2017

Blockedon: 600773
 Issue 600773  (which I closed because it was about an old code) has some debug dump some of which could still be useful here.
I don't think this patch actually works because you will end up double ack'ng non-blocking events that have already been ack'd. Perhaps that is causing the issue.
Project Member

Comment 5 by bugdroid1@chromium.org, Apr 19 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/401d48085b5a5db8bab875c9a6732f61f23a42b1

commit 401d48085b5a5db8bab875c9a6732f61f23a42b1
Author: dtapuska <dtapuska@chromium.org>
Date: Wed Apr 19 01:28:38 2017

Fix latency info tracking for coalesced events.

Keep the oldest touch event id so the latency info will be associated
with that object. Don't adjust the dispatch type for an event that
gets coalesced since it it should carry the same type as the touch id
ack.

BUG= 711325 

Review-Url: https://codereview.chromium.org/2822293002
Cr-Commit-Position: refs/heads/master@{#465457}

[modify] https://crrev.com/401d48085b5a5db8bab875c9a6732f61f23a42b1/content/renderer/input/main_thread_event_queue.cc
[modify] https://crrev.com/401d48085b5a5db8bab875c9a6732f61f23a42b1/content/renderer/input/main_thread_event_queue_unittest.cc
[modify] https://crrev.com/401d48085b5a5db8bab875c9a6732f61f23a42b1/ui/events/blink/blink_event_util.cc

Status: Fixed (was: Assigned)

Sign in to add a comment