Open Bug 1903728 Opened 8 months ago Updated 2 months ago

Firefox becomes unresponsive after using an infinite loop while visiting about:config page

Categories

(DevTools :: Console, defect)

Desktop
All
defect

Tracking

(firefox-esr115 affected, firefox127 affected, firefox128 affected, firefox129 affected)

Tracking Status
firefox-esr115 --- affected
firefox127 --- affected
firefox128 --- affected
firefox129 --- affected

People

(Reporter: bhidecuti, Unassigned)

References

Details

(Keywords: regressionwindow-wanted)

Attachments

(1 file)

Attached video video showing the issue

Found in

  • 128.0b5

Affected versions

  • 129.0a1 (2024-06-19)
  • 128.0b5
  • 127.0.1
  • 115.12.0esr

Preconditions

  • ‘devtools.chrome.enabled’ pref set to ‘true’

Tested platforms

  • Affected platforms: Windows 11, Ubuntu 22.04, MacOS 13 / 14
  • Unaffected platforms: none

Steps to reproduce

  1. Go to about:config and open the Web console (Ctrl + Shift + K)
  2. Paste ‘while(true);’ in web console and press ‘Enter’
  3. Interact with the browser

Expected result

  • Firefox functions as expected

Actual result

  • Firefox becomes unresponsive

Regression range

  • Will look for a regressions range ASAP

Additional notes

  • See the attached video
  • Also reproducing if pasting the expression in the Browser console
  • Not reproducing if about:config page was not opened in the current session. However, slowness occurs after running the expression in the current tab

Do you need devtools.webconsole.input.eagerEvaluation pref set to true ? In the STR, you say that Firefox becomes unresponsive when you hit Enter, which suggest this is not caused by eager evaluation.
At least if I do all the steps without pressing Enter, everything is fine for me.
I'm asking because we have a specific mechanism in eager evaluation to just bail out in case the evaluation takes too long (added in Bug 1610682): https://searchfox.org/mozilla-central/rev/74518d4f6979b088e28405ba7e6238f4707639cf/devtools/server/actors/webconsole/eval-with-debugger.js#476-484

const timeoutDuration = 100;
const endTime = Date.now() + timeoutDuration;
let count = 0;
function shouldCancel() {
  // To keep the evaled code as quick as possible, we avoid querying the
  // current time on ever single step and instead check every 100 steps
  // as an arbitrary count that seemed to be "often enough".
  return ++count % 100 === 0 && Date.now() > endTime;
}
Flags: needinfo?(bhidecuti)

(In reply to Nicolas Chevobbe [:nchevobbe] from comment #1)

Do you need devtools.webconsole.input.eagerEvaluation pref set to true ? In the STR, you say that Firefox becomes unresponsive when you hit Enter, which suggest this is not caused by eager evaluation.
At least if I do all the steps without pressing Enter, everything is fine for me.
I'm asking because we have a specific mechanism in eager evaluation to just bail out in case the evaluation takes too long (added in Bug 1610682): https://searchfox.org/mozilla-central/rev/74518d4f6979b088e28405ba7e6238f4707639cf/devtools/server/actors/webconsole/eval-with-debugger.js#476-484

const timeoutDuration = 100;
const endTime = Date.now() + timeoutDuration;
let count = 0;
function shouldCancel() {
  // To keep the evaled code as quick as possible, we avoid querying the
  // current time on ever single step and instead check every 100 steps
  // as an arbitrary count that seemed to be "often enough".
  return ++count % 100 === 0 && Date.now() > endTime;
}

Hi @nchevobbe,
You are correct. This is reproducing if devtools.webconsole.input.eagerEvaluation pref is set to 'false' as well, and only when pressing the 'Enter' key. I will update the prerequisites accordingly.

Please let me know if I can provide more details. Thanks!

Flags: needinfo?(bhidecuti)
See Also: → 1928670
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: