Closed Bug 1780134 Opened 2 years ago Closed 2 years ago

completion of : await browser.stora… crashed the console

Categories

(DevTools :: Console, defect)

Firefox 104
defect

Tracking

(firefox-esr91 unaffected, firefox-esr102 unaffected, firefox102 unaffected, firefox103 unaffected, firefox104 verified)

VERIFIED FIXED
104 Branch
Tracking Status
firefox-esr91 --- unaffected
firefox-esr102 --- unaffected
firefox102 --- unaffected
firefox103 --- unaffected
firefox104 --- verified

People

(Reporter: sdescarpentries, Assigned: nchevobbe)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 file)

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:104.0) Gecko/20100101 Firefox/104.0

Steps to reproduce:

Typing "await browser.storage.sync.get()

Actual results:

Console DevTools crashed during "storage" word typing.

Expected results:

Being able to finish my typing.
It worked a few minutes before.
I'm using Firefox-ASAN : 104.0a1 (2022-07-18) (64-bit)

Got hinted to create this bug report.

TypeError: can't access property "getGrip", terminalEagerResult is undefined
React Component Stack

componentStack

in EagerEvaluation

in Connect(EagerEvaluation)

in div

in div

in App

in VisibilityHandler

in Unknown

in Connect(Component)

in AppErrorBoundary

in Provider

in Provider
Stacktrace

renderRepsResult@resource://devtools/client/webconsole/components/Input/EagerEvaluation.js:84:20

render@resource://devtools/client/webconsole/components/Input/EagerEvaluation.js:111:20

finishClassComponent@resource://devtools/client/shared/vendor/react-dom.js:10638:31

updateClassComponent@resource://devtools/client/shared/vendor/react-dom.js:10601:44

beginWork@resource://devtools/client/shared/vendor/react-dom.js:11419:16

performUnitOfWork@resource://devtools/client/shared/vendor/react-dom.js:14702:12

workLoop@resource://devtools/client/shared/vendor/react-dom.js:14720:24

renderRoot@resource://devtools/client/shared/vendor/react-dom.js:14803:15

performWorkOnRoot@resource://devtools/client/shared/vendor/react-dom.js:15655:17

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

dispatch@resource://devtools/client/shared/vendor/redux.js:265:7

eventTelemetryMiddleware/</<@resource://devtools/client/webconsole/middleware/event-telemetry.js:25:21

historyPersistenceMiddleware/</<@resource://devtools/client/webconsole/middleware/history-persistence.js:37:21

thunk/</</<@resource://devtools/client/shared/redux/middleware/thunk.js:18:11

ignore/</<@resource://devtools/client/shared/redux/middleware/ignore.js:31:12

createPerformanceMarkerMiddleware/</</<@resource://devtools/client/shared/redux/middleware/performance-marker.js:50:28

dispatch@resource://devtools/client/shared/vendor/redux.js:681:28

terminalInputChanged/<@resource://devtools/client/webconsole/actions/input.js:425:12

Reproducible bug if I type :

await bro

But no problem if type :

let a = await browser.storage.sync.get()

(I'm developing a WebExtension for Firefox : Meta-Press.es)

Thanks for the report! I could reproduce on nightly. Works fine on Dev Edition, might be a recent regression.

Status: UNCONFIRMED → NEW
Ever confirmed: true

mozregression only got me to the following pushlog: https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=720d5125a9b4aa6750806ed9b51fbd0811da10c4&tochange=315e476ecf385fa0c9fd395aa1423a26b6a1e1b1

When switching to autoland builds, all the binaries I downloaded crashed on startup (maybe because I am on M1?)

When this crashes, the Browser Console shows breakpoint is not allowed for this opcode, so it might be Bug 1776376.

Throwing at https://searchfox.org/mozilla-central/rev/f6a2ef2f028b8f1eb82fa5dc5cb1e39a3baa8feb/devtools/server/actors/webconsole/eval-with-debugger.js#377-380

    const offsets = script.getEffectfulOffsets();
    for (const offset of offsets) {
      script.setBreakpoint(offset, handler);
    }

Confirmed regressed by Bug 1776376

Regressed by: 1776376
See Also: → 1780152
Depends on: 1780158

:arai, since you are the author of the regressor, bug 1776376, could you take a look?
For more information, please visit auto_nag documentation.

Flags: needinfo?(arai.unmht)

There are 2 issues:

  • setBreakpoint called above throws (this will be handled in bug 1780158), but this is not actually a root cause of the crash here
  • now async functions runs in eager evaluation, and top-level await case isn't handled properly, this will be handled here
Flags: needinfo?(arai.unmht)

This was only not rendering when terminalEagerResult was null, but with
Bug 1776376, we're getting undefined results in some case, which was crashing
the component.
While this should be fixed at an upper level, this patch makes the component a bit
more robust so we don't crash the whole console client.
A node test is added for basic rendering with various result values, and proper
mochitest will be added in follow-up patches in this queue.

Assignee: nobody → nchevobbe
Status: NEW → ASSIGNED
Pushed by nchevobbe@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/471094237607
[devtools] Guard EagerEvaluation rendering on undefined `terminalEagerResult`. r=jdescottes.
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 104 Branch
Regressions: 1780418
QA Whiteboard: [qa-104b-p2]

I was able to reproduce this issue on a 2022-07-18 Nightly build on Ubuntu 22.04 using the STR from the Description. Verified as fixed on Firefox 104.0(build ID: 20220818191623) and Nightly 106.0a1(build ID: 20220822190304) on Ubuntu 22.04, macOS 12 and Windows 10.

Status: RESOLVED → VERIFIED
QA Whiteboard: [qa-104b-p2]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: