Debugger infinite hang when hovering over variables
Categories
(DevTools :: Debugger, defect, P3)
Tracking
(firefox71 fixed)
Tracking | Status | |
---|---|---|
firefox71 | --- | fixed |
People
(Reporter: standard8, Assigned: jlast)
References
(Blocks 1 open bug)
Details
(Whiteboard: [debugger-reserve])
Attachments
(1 file)
What were you doing?
- Debug an xpcshell-test that I'm writing.
- Stepped into a function
- I was hovering over various variables to see their values.
- I had just hovered over one and was moving or had moved to another.
What happened?
Firefox hung for a long period of time (30 seconds?) with 100% CPU on the main process before the slow script dialog came up. I stopped the code, and checked the browser console.
I had to restart the debugging session to continue debugging.
On the console was this output:
uncaught exception: Object
uncaught exception: Object 3
uncaught exception: Object
Discarding onCreatedNavigationTarget for 191: received source tab data without any created tab data available
OpenGL compositor Initialized Succesfully.
Version: 2.1 ATI-2.11.20
Vendor: ATI Technologies Inc.
Renderer: AMD Radeon Pro 560X OpenGL Engine
FBO Texture Target: TEXTURE_2D
Error: Script terminated by timeout at:
addHighlightToTargetSiblings@resource://devtools/client/debugger/src/components/Editor/Preview/Popup.js:253:12
addHighlightToToken@resource://devtools/client/debugger/src/components/Editor/Preview/Popup.js:99:35
componentDidMount@resource://devtools/client/debugger/src/components/Editor/Preview/Popup.js:87:10
commitLifeCycles@resource://devtools/client/shared/vendor/react-dom.js:12949:22
commitAllLifeCycles@resource://devtools/client/shared/vendor/react-dom.js:14174:23
commitRoot@resource://devtools/client/shared/vendor/react-dom.js:14380:28
completeRoot/<@resource://devtools/client/shared/vendor/react-dom.js:15731:15
unstable_runWithPriority@resource://devtools/client/shared/vendor/react.js:617:12
completeRoot@resource://devtools/client/shared/vendor/react-dom.js:15730:27
performWorkOnRoot@resource://devtools/client/shared/vendor/react-dom.js:15659:21
performWork@resource://devtools/client/shared/vendor/react-dom.js:15567:24
performSyncWork@resource://devtools/client/shared/vendor/react-dom.js:15541:14
requestWork@resource://devtools/client/shared/vendor/react-dom.js:15410:5
scheduleWork@resource://devtools/client/shared/vendor/react-dom.js:15224:16
enqueueSetState@resource://devtools/client/shared/vendor/react-dom.js:8192:17
Component.prototype.setState@resource://devtools/client/shared/vendor/react.js:328:16
onStateChange@resource://devtools/client/shared/vendor/react-redux.js:1412:16
notify@resource://devtools/client/shared/vendor/react-redux.js:1159:21
notifyNestedSubs@resource://devtools/client/shared/vendor/react-redux.js:1198:20
onStateChange@resource://devtools/client/shared/vendor/react-redux.js:1409:16
notify@resource://devtools/client/shared/vendor/react-redux.js:1159:21
notifyNestedSubs@resource://devtools/client/shared/vendor/react-redux.js:1198:20
onStateChange@resource://devtools/client/shared/vendor/react-redux.js:1409:16
dispatch@resource://devtools/client/shared/vendor/redux.js:416:7
waitUntilService/</<@resource://devtools/client/debugger/src/actions/utils/middleware/wait-service.js:71:24
promiseMiddleware/</<@resource://devtools/client/debugger/src/actions/utils/middleware/promise.js:46:14
context/</<@resource://devtools/client/debugger/src/actions/utils/middleware/context.js:35:12
thunk/</</<@resource://devtools/client/debugger/src/actions/utils/middleware/thunk.js:29:100
dispatch@resource://devtools/client/shared/vendor/redux.js:755:18
setPreview/<@resource://devtools/client/debugger/src/actions/preview.js:150:13
What should have happened?
No hang.
Anything else we should know?
Using the latest Mac nightly (20190905215710)
Code I was debugging shouldn't have been anything special:
function shouldPrefer(setting, hasCurrentDefault, currentDefaultSetting) {
if (
setting == "yes" &&
(!hasCurrentDefault || currentDefaultSetting == "yes-if-no-other")
) {
return true;
}
return setting == "yes-if-no-other" && !hasCurrentDefault;
}
Reporter | ||
Comment 1•5 years ago
|
||
Here's a performance profile of the hang: https://perfht.ml/34vp7B9
Comment 2•5 years ago
|
||
So it looks like 99% of the time is spent on addHighlightToTargetSiblings
, with Element.className
access taking a third of that!
Reporter | ||
Comment 3•5 years ago
|
||
Just to be clear, the only reason the hang stops is because of the stop script dialog and me stopping it. This seems to be an infinite loop.
Reporter | ||
Comment 4•5 years ago
|
||
The debugging I was doing was on the test in https://phabricator.services.mozilla.com/D44983
- Add a
debugger
statement immediately after theshouldPrefer
function and before the for loop. - Run the test (
./mach xpcshell-test toolkit/components/search/SearchEngineSelector.jsm --jsdebugger
) - Hook the debugger into the test via about:debugging.
- Move your mouse reasonably quickly over the variables in the
shouldPrefer
function. I'm not 100% sure, but it seemed worse over the variables within the function rather than the function arguments.
Updated•5 years ago
|
Comment 5•5 years ago
|
||
The looping part is https://perfht.ml/2UxkUsc , probably the 2 while loops in the addHighlightToTargetSiblings
function: https://searchfox.org/mozilla-central/source/devtools/client/debugger/src/components/Editor/Preview/Popup.js#225
Reporter | ||
Comment 6•5 years ago
|
||
Just to note I just got this in the browser toolbox debugging a mochitest. Unfortunately that doesn't have the slow script timeout.
Assignee | ||
Comment 7•5 years ago
|
||
Updated•5 years ago
|
Pushed by jlaster@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/96405b0b1298 Debugger infinite hang when hovering over variables. r=davidwalsh
Comment 9•5 years ago
|
||
bugherder |
Description
•