RESOLVED FIXED 131193
Web Replay: detect possible replay divergence from unexpected DOM event dispatches
https://bugs.webkit.org/show_bug.cgi?id=131193
Summary Web Replay: detect possible replay divergence from unexpected DOM event dispa...
Brian Burg
Reported 2014-04-03 17:02:20 PDT
We can assert the following invariant to find divergences: If a DOM event is dispatched and the page's EventLoopInputDispatcher::dispatching() is false, then replay divergence is possible. Let's unpack that: 1. For a web page's JS to execute deterministically, the engine must execute code blocks in the same order. 2. To run JS in the same order, DOM events must be dispatched in the same order. 3. For DOM events to be dispatched in the same order, the relevant run loops must be dispatched in the same order. 4. If we are not controlling the dispatch of a run loop that fired a DOM event, then it could potentially execute script in any order with respect to other run loops. In practice, this assertion finds more nondeterminism (and provides useful stack traces) than any other technique. In the short term, it will make it really hard to do replay in debug mode without asserting, so it should probably be put behind a guard that is normally compiled out. Once an error reporting mechanism is implemented, it could show a warning in the inspector UI.
Attachments
the patch (26.05 KB, patch)
2014-04-06 18:58 PDT, Brian Burg
no flags
Brian Burg
Comment 1 2014-04-06 18:58:07 PDT
Created attachment 228713 [details] the patch
Andreas Kling
Comment 2 2014-04-07 10:14:38 PDT
Comment on attachment 228713 [details] the patch r=me
WebKit Commit Bot
Comment 3 2014-04-07 12:58:33 PDT
Comment on attachment 228713 [details] the patch Clearing flags on attachment: 228713 Committed r166880: <http://trac.webkit.org/changeset/166880>
WebKit Commit Bot
Comment 4 2014-04-07 12:58:36 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.