Closed Bug 1608372 Opened 4 years ago Closed 4 years ago

Eager Evaluation on about:config freezes devtools

Categories

(DevTools :: Console, defect, P2)

defect

Tracking

(firefox74 verified)

VERIFIED FIXED
Firefox 74
Tracking Status
firefox74 --- verified

People

(Reporter: nchevobbe, Assigned: bhackett1024)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Steps to reproduce

  1. Make sure you have the eager evaluation pref turned on
  2. Go to about:config
  3. Open the console
  4. Try to type 1 + 1

Expected results

I get 2 in the result

Actual results

DevTools freezes.


I see the following error in the terminal:

DBG-SERVER threw an exception: ReferenceError: isEvalSource is not defined
Stack: createSourceActor@resource://devtools/server/actors/utils/TabSources.js:299:17
_addSource@resource://devtools/server/actors/thread.js:2121:34
onNewScript@resource://devtools/server/actors/thread.js:2076:10
getEvalResult@resource://devtools/server/actors/webconsole/eval-with-debugger.js:173:28
exports.evalWithDebugger@resource://devtools/server/actors/webconsole/eval-with-debugger.js:140:31
evaluateJS@resource://devtools/server/actors/webconsole.js:1157:38
evaluateJSAsync/<@resource://devtools/server/actors/webconsole.js:1054:29
exports.makeInfallible/<@resource://devtools/shared/ThreadSafeDevToolsUtils.js:111:22
Line: 299, column: 17
JavaScript warning: resource://devtools/shared/ThreadSafeDevToolsUtils.js, line 89: DebuggeeWouldRun: debuggee `resource://devtools/shared/base-loader.js:172' would run
DBG-SERVER threw an exception: ReferenceError: isEvalSource is not defined
Stack: createSourceActor@resource://devtools/server/actors/utils/TabSources.js:299:17
_addSource@resource://devtools/server/actors/thread.js:2121:34
onNewScript@resource://devtools/server/actors/thread.js:2076:10
getEvalResult@resource://devtools/server/actors/webconsole/eval-with-debugger.js:173:28
exports.evalWithDebugger@resource://devtools/server/actors/webconsole/eval-with-debugger.js:140:31
evaluateJS@resource://devtools/server/actors/webconsole.js:1157:38
evaluateJSAsync/<@resource://devtools/server/actors/webconsole.js:1054:29
exports.makeInfallible/<@resource://devtools/shared/ThreadSafeDevToolsUtils.js:111:22
Line: 299, column: 17
JavaScript warning: resource://devtools/shared/ThreadSafeDevToolsUtils.js, line 89: DebuggeeWouldRun: debuggee `resource://devtools/shared/base-loader.js:172' would run
DBG-SERVER threw an exception: ReferenceError: isEvalSource is not defined
Stack: createSourceActor@resource://devtools/server/actors/utils/TabSources.js:299:17
_addSource@resource://devtools/server/actors/thread.js:2121:34
onNewScript@resource://devtools/server/actors/thread.js:2076:10
getEvalResult@resource://devtools/server/actors/webconsole/eval-with-debugger.js:173:28
exports.evalWithDebugger@resource://devtools/server/actors/webconsole/eval-with-debugger.js:140:31
evaluateJS@resource://devtools/server/actors/webconsole.js:1157:38
evaluateJSAsync/<@resource://devtools/server/actors/webconsole.js:1054:29
exports.makeInfallible/<@resource://devtools/shared/ThreadSafeDevToolsUtils.js:111:22
Line: 299, column: 17
JavaScript warning: resource://devtools/shared/ThreadSafeDevToolsUtils.js, line 89: DebuggeeWouldRun: debuggee `resource://devtools/shared/base-loader.js:172' would run
DBG-SERVER threw an exception: ReferenceError: isEvalSource is not defined
Stack: createSourceActor@resource://devtools/server/actors/utils/TabSources.js:299:17
_addSource@resource://devtools/server/actors/thread.js:2121:34
onNewScript@resource://devtools/server/actors/thread.js:2076:10
Line: 299, column: 17
JavaScript warning: resource://devtools/shared/ThreadSafeDevToolsUtils.js, line 89: DebuggeeWouldRun: debuggee `resource://devtools/shared/base-loader.js:172' would run
console.error: (new ReferenceError("isEvalSource is not defined", "resource://devtools/server/actors/utils/TabSources.js", 299))
DBG-SERVER threw an exception: ReferenceError: isEvalSource is not defined
Stack: createSourceActor@resource://devtools/server/actors/utils/TabSources.js:299:17
_addSource@resource://devtools/server/actors/thread.js:2121:34
onNewScript@resource://devtools/server/actors/thread.js:2076:10
Line: 299, column: 17
JavaScript warning: resource://devtools/shared/ThreadSafeDevToolsUtils.js, line 89: DebuggeeWouldRun: debuggee `resource://devtools/shared/base-loader.js:172' would run
console.error: (new ReferenceError("isEvalSource is not defined", "resource://devtools/server/actors/utils/TabSources.js", 299))

Brian, would you have a hint of what's going on?

Flags: needinfo?(bhackett1024)

The problem here is that while we prevent side effects when doing the evaluation, side effects are still not allowed during the parseErrorOutput call in getEvalResult, which we'll end up in when the eager input is "1 +". That parseErrorOutput() call has side effects in the devtools loader (trying to load reflect.jsm) and we end up force terminating JS execution during the load and the loader's state gets totally messed up. I don't know why this doesn't affect other pages, but the attached patch fixes about:config for me.

Flags: needinfo?(bhackett1024)
Assignee: nobody → bhackett1024
Status: NEW → ASSIGNED
Pushed by bhackett@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/fb7d64101b6a
Avoid parsing error output while side effects are not allowed, r=nchevobbe.
Pushed by malexandru@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/545510ffaab4
Fix lint issue in eval-with-debugger.js a=lint-fix
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 74
Flags: qe-verify+

Reproduced this issue on a Nightly 74.0a1 build from the 10th of January 2020 on Ubuntu 18.04 and Windows 10x64.
I can confirm this issue is fixed on Ubuntu 18.04, Windows 10 x64 and Mac OS X 10 .15 using the latest Firefox 74 beta 2 and the latest Nightly 75.0a1.

Status: RESOLVED → VERIFIED
Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: