Closed Bug 1870681 Opened 2 years ago Closed 2 years ago

Crash in [@ mozilla::gfx::MemWriter::write]

Categories

(Core :: Graphics: Canvas2D, defect, P3)

Unspecified
Windows 10
defect

Tracking

()

RESOLVED FIXED
123 Branch
Tracking Status
firefox-esr115 --- unaffected
firefox121 --- unaffected
firefox122 --- fixed
firefox123 --- fixed

People

(Reporter: aosmond, Assigned: aosmond)

References

(Blocks 1 open bug, Regression)

Details

(Keywords: crash, regression)

Crash Data

Attachments

(1 file)

Crash report: https://crash-stats.mozilla.org/report/index/d10d3586-99cd-42bc-8d64-8a6620231218

Reason: EXCEPTION_ACCESS_VIOLATION_WRITE

Top 10 frames of crashing thread:

0  xul.dll  mozilla::gfx::MemWriter::write  gfx/2d/RecordedEvent.h:219
0  xul.dll  mozilla::gfx::ElementStreamFormat<mozilla::gfx::MemWriter, mozilla::gfx::RecordedEvent::EventType>::Write  gfx/2d/RecordingTypes.h:21
0  xul.dll  mozilla::gfx::WriteElement  gfx/2d/RecordingTypes.h:52
0  xul.dll  mozilla::layers::CanvasDrawEventRecorder::WriteInternalEvent  gfx/layers/CanvasDrawEventRecorder.cpp:150
0  xul.dll  mozilla::layers::CanvasDrawEventRecorder::DropFreeBuffers  gfx/layers/CanvasDrawEventRecorder.cpp:234
1  xul.dll  mozilla::detail::RunnableMethodArguments<>::apply<nsMemoryReporterManager, nsresult  const  xpcom/threads/nsThreadUtils.h:1164
1  xul.dll  std::invoke  /builds/worker/fetches/vs/VC/Tools/MSVC/14.29.30133/include/type_traits:1524
1  xul.dll  std::_Apply_impl  /builds/worker/fetches/vs/VC/Tools/MSVC/14.29.30133/include/tuple:974
1  xul.dll  std::apply  /builds/worker/fetches/vs/VC/Tools/MSVC/14.29.30133/include/tuple:979
1  xul.dll  mozilla::detail::RunnableMethodArguments<>::apply  xpcom/threads/nsThreadUtils.h:1162
Flags: needinfo?(bobowencode)

Bug 1869822 landed but we still see this crash signature in nightly.

This is probably a consequence of bug 1869658 actually, just kicking the crash further down the line.

Assignee: nobody → aosmond
Status: NEW → ASSIGNED
Depends on: 1869658
Flags: needinfo?(bobowencode)

If we have no buffer, we have no need to write the drop event, since nothing is supposed to be waiting on it:
https://searchfox.org/mozilla-central/rev/91cc8848427fdbbeb324e6ca56a0d08d32d3c308/gfx/layers/CanvasDrawEventRecorder.cpp#234

The other path of using WriteInternalEvent is guarded checking for the sanity of the buffer:
https://searchfox.org/mozilla-central/rev/91cc8848427fdbbeb324e6ca56a0d08d32d3c308/gfx/layers/CanvasDrawEventRecorder.cpp#156

Severity: -- → S3
Priority: -- → P3
Pushed by aosmond@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/159cab18c3a7 Check for invalid buffers when clearing a canvas recorder's cached buffer pool. r=gfx-reviewers,lsalzman
Keywords: regression
Regressed by: 1863914
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 123 Branch

Set release status flags based on info from the regressing bug 1863914

:aosmond could you nominate this for a beta uplift?

Flags: needinfo?(aosmond)

Comment on attachment 9369266 [details]
Bug 1870681 - Check for invalid buffers when clearing a canvas recorder's cached buffer pool.

Beta/Release Uplift Approval Request

  • User impact if declined: Moderate volume content process crash
  • Is this code covered by automated tests?: Yes
  • Has the fix been verified in Nightly?: Yes
  • Needs manual test from QE?: No
  • If yes, steps to reproduce:
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): Trivial change to avoid writing events to invalid buffers
  • String changes made/needed:
  • Is Android affected?: No
Flags: needinfo?(aosmond)
Attachment #9369266 - Flags: approval-mozilla-beta?

Comment on attachment 9369266 [details]
Bug 1870681 - Check for invalid buffers when clearing a canvas recorder's cached buffer pool.

Approved for 122.0b6

Attachment #9369266 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Crash Signature: [@ mozilla::gfx::MemWriter::write] → [@ mozilla::gfx::MemWriter::write] [@ OOM | large | mozilla::gfx::MemWriter::write ]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: