Closed Bug 1579379 Opened 5 years ago Closed 5 years ago

Debugger infinite hang when hovering over variables

Categories

(DevTools :: Debugger, defect, P3)

defect

Tracking

(firefox71 fixed)

RESOLVED FIXED
Firefox 71
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?

  1. Debug an xpcshell-test that I'm writing.
  2. Stepped into a function
  3. I was hovering over various variables to see their values.
  4. 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;
    }

Here's a performance profile of the hang: https://perfht.ml/34vp7B9

So it looks like 99% of the time is spent on addHighlightToTargetSiblings, with Element.className access taking a third of that!

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.

The debugging I was doing was on the test in https://phabricator.services.mozilla.com/D44983

  • Add a debugger statement immediately after the shouldPrefer 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.
Priority: -- → P3
Summary: Debugger hung when hovering over variables → Debugger infinite hang when hovering over variables

Just to note I just got this in the browser toolbox debugging a mochitest. Unfortunately that doesn't have the slow script timeout.

Assignee: nobody → jlaster
Blocks: dbg-71
Status: NEW → ASSIGNED
Whiteboard: [debugger-reserve]
Pushed by jlaster@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/96405b0b1298
Debugger infinite hang when hovering over variables. r=davidwalsh
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 71
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: