Indexed DB events dispatched in nested message loop while paused in debugger |
||
Issue descriptionRepro: (1) load attached page (2) open devtools/sources tab, put breakpoint on `r1.onsuccess` line (3) Click "go" on page (4) Advance the debugger (step over) to `const r2` line (4) Advance the debugger (step over) Expected: Works OK Actual: Exception on the second get(): Uncaught DOMException: Failed to execute 'get' on 'IDBObjectStore': The transaction has finished. In a Debug build, a DCHECK is hit even earlier (step 2): [1:1:0612/130802.014015:FATAL:IDBTransaction.cpp(350)] Check failed: active != (state_ == kActive) (1 vs. 1) Reason: The debugger is spinning up a nested event loop while paused. This causes the first event to be dispatched and (since no further work is queued) the transaction commits while paused. In a debug build the DCHECK occurs because the transaction is still active (creation scope) when the first success is dispatched.
,
Jun 13 2017
From initial poking about... many systems just don't bother dispatching when paused in the debugger, e.g. https://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/dom/IntersectionObserverController.cpp?type=cs&l=64 https://cs.chromium.org/chromium/src/third_party/WebKit/Source/modules/battery/BatteryManager.cpp?type=cs&l=74 Some have custom resume logic: https://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/dom/Document.cpp?type=cs&l=6120 IDB is an interesting case. Since the events are how more work gets queued we can't not dispatch them, so they really need to get queued. FileSystem has some logic here: https://cs.chromium.org/chromium/src/third_party/WebKit/Source/modules/filesystem/FileSystemCallbacks.cpp?type=cs&l=83 ... which causes the events to be queued as bound closures. I haven't traced through what eventually runs them - maybe it's just that the nested loop can't pick them up?
,
Jun 13 2017
per offline discussion, assigning to pwnall@ to investigate further
,
Sep 25 2017
Issue 747671 has been merged into this issue. |
||
►
Sign in to add a comment |
||
Comment 1 by jsb...@chromium.org
, Jun 12 2017