Closed Bug 1708070 Opened 3 years ago Closed 3 years ago

Still having some crashes after having dom.input_events.strict_input_vsync_alignment enabled again

Categories

(Core :: Performance, defect)

defect

Tracking

()

RESOLVED FIXED
90 Branch
Tracking Status
firefox-esr78 --- unaffected
firefox88 --- unaffected
firefox89 --- disabled
firefox90 blocking disabled
firefox91 --- fixed

People

(Reporter: sefeng, Assigned: sefeng)

References

(Regression)

Details

(Keywords: crash, regression)

Crash Data

Attachments

(2 files, 1 obsolete file)

We still having these DidRunTask because an edge case, such that vsync -> rAF -> xhr triggers event loop -> runInput -> crash.

Blocks: 1705392

Currently, we use VsyncTaskManager::DidRunTask to change state from
RunVsync to NoPendingVsync, however, the issue is that if the vsync
starts an event loop (for instance, by using requestAnimationFrame), and
the event loop starts another input task, Firefox crashes because input
tasks don't expect the state to be RunVsync.

So instead of using DidRunTask, we start to use WillRunTask to fix
it.

Keywords: crash
Pushed by sefeng@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/57e445916fc9
Use VsyncTaskManager::WillRunTask to change InputVsyncState r=smaug
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 90 Branch
See Also: → 1713327

Reopen this due to still having the crashes

Status: RESOLVED → REOPENED
Keywords: leave-open
Resolution: FIXED → ---

Rarely, we sill see a input task was run when the expectation was a
vsync task. I am unable to find the root cause by looking at the code.
One possible case is the vsync was gone when the input task was run.
This patch added some assertions to see if that was the case.

Attachment #9225632 - Attachment is obsolete: true

Before this patch, we use InputPriorityController::DidRunTask to change
InputVsyncState which is problematic.

Consider this scenario

  1. Two events are in the queue, vsync(V1) and input(I1)
  2. I1 runs and starts an inner event loop (We only expect one input
    event to be run because there's only one input event)
  3. Another input event(I2) arrives
  4. Inner event loop picks I2 to run
  5. When I2 is finished, it sets the InputVsyncState to RunVsync
  6. I1's DidRunTask is called and crashed because the state shouldn't
    be RunVsync.

This patch moves the code which checks InputVsyncState from DidRunTask
to WillRunTask so that the state is correctly checked and updated
before the input task is about to run.

Pushed by sefeng@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/2f4a7cf1a8f7
Change InputVsyncState in InputPriorityController::WillRunTask r=smaug

There's no crashes on beta AFAICT.

Sefeng can you set a priority and severity for this bug? (I'm going through triage)

Flags: needinfo?(sefeng)

This can now be closed after landing https://phabricator.services.mozilla.com/D117336 because if we still get new crashes, the crash signature will be changed.

Severity: -- → S3
Status: REOPENED → RESOLVED
Closed: 3 years ago3 years ago
Flags: needinfo?(sefeng)
Resolution: --- → FIXED

dom.input_events.strict_input_vsync_alignment is disabled on Beta, so that's why we wouldn't see crashes there.

Has Regression Range: --- → yes
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: