Closed Bug 2087939 Opened 21 days ago Closed 20 days ago

Crash in [@ abort | common_assert_to_stderr<T>]

Categories

(Core :: Graphics: Cairo, defect)

defect

Tracking

()

RESOLVED WONTFIX
Tracking Status
firefox-esr153 --- unaffected
firefox159 --- wontfix
firefox160 --- unaffected
firefox161 --- unaffected

People

(Reporter: clouseau-bot, Unassigned)

References

(Blocks 1 open bug, Regression)

Details

(Keywords: crash, regression)

Crash Data

Crash report: https://crash-stats.mozilla.org/report/index/0ead672a-e7d1-4ce8-b631-45b2a0261030

Crash Reason:

EXCEPTION_STACK_BUFFER_OVERRUN / FAST_FAIL_FATAL_APP_EXIT at 0x00007ffea0a3527e

Top 10 frames:

0  ucrtbase.dll  abort
1  ucrtbase.dll  common_assert_to_stderr<wchar_t>
2  ucrtbase.dll  wassert
3  xul.dll  _paint_page(_cairo_paginated_surface*)  gfx/cairo/cairo/src/cairo-paginated-surface.c:489
4  xul.dll  _cairo_paginated_surface_show_page(void*)  gfx/cairo/cairo/src/cairo-paginated-surface.c:602
5  xul.dll  _moz_cairo_surface_show_page(_cairo_surface*)  gfx/cairo/cairo/src/cairo-surface.c:2584
6  xul.dll  mozilla::gfx::PrintTargetWindows::EndPage()  gfx/thebes/PrintTargetWindows.cpp:155
7  xul.dll  nsDeviceContext::EndPage()  gfx/src/nsDeviceContext.cpp:353
8  xul.dll  mozilla::layout::RemotePrintJobParent::PrintPage(mozilla::gfx::IntSizeTyped<mozi...  layout/printing/ipc/RemotePrintJobParent.cpp:230
9  xul.dll  mozilla::layout::RemotePrintJobParent::FinishProcessingPage(mozilla::gfx::IntSiz...  layout/printing/ipc/RemotePrintJobParent.cpp:203

There are 58 crashes (from 50 installations) in 159.0 with buildid 20261022150525.

In the last 30 days, Firefox has 58 crashes (from 50 installations) on release and 13 crashes (from 8 installations) on beta/DevEdition with this signature.

This signature has been reported since build 20230328155238 (2023-03-28), 1304 days before the build above.

This bug looks actionable because:

  • The parent process aborts at assert (status != CAIRO_INT_STATUS_UNSUPPORTED) in _paint_page (cairo-paginated-surface.c:489) when the native replay of a remote print page onto the Windows printing surface returns UNSUPPORTED.

    1. RemotePrintJobParent::PrintPage finishes a page and calls nsDeviceContext::EndPage, which calls PrintTargetWindows::EndPage and then cairo_surface_show_page(mCairoSurface).
    2. _cairo_paginated_surface_show_page calls _paint_page, which replays the recorded page through an analysis surface and sets has_supported because at least one operation was classified as natively supported by the target.
    3. With the target switched to CAIRO_PAGINATED_MODE_RENDER, _cairo_recording_surface_replay_region(..., CAIRO_RECORDING_REGION_NATIVE) replays those operations onto the Windows printing surface, and one of them returns CAIRO_INT_STATUS_UNSUPPORTED.
    4. The assert at line 489 fires, and the release build aborts there.

    Frames 3-8 match the pinned source exactly: line 489 is the assert directly after the native replay, and PrintTargetWindows.cpp:155 is the cairo_surface_show_page call. The owner should look first at the Windows printing surface backend: it accepts an operation during the analysis pass that it then rejects at render time. Which operation (glyphs, pattern type, clip) cannot be determined from this report.

  • The failing code comes from df253072d285 by vladimir.

Impact

The parent process crashes, so the whole browser closes.

Possible fixes

  • Find the operation the Windows printing surface accepts in CAIRO_PAGINATED_MODE_ANALYZE but rejects in CAIRO_PAGINATED_MODE_RENDER, and make the two modes agree, for example by reporting it unsupported during analysis so it goes through the image fallback.
  • Possibly make _paint_page treat an UNSUPPORTED status from the native replay as a recoverable error (set an error on the surface, or fall back to an image for the page) instead of asserting; PrintTargetWindows::EndPage already checks cairo_surface_status and returns NS_ERROR_FAILURE.

How to confirm

Log in _paint_page which recorded command type (paint/mask/stroke/fill/show_glyphs) and source pattern or font type makes _cairo_recording_surface_replay_region return UNSUPPORTED in native mode, then reproduce by printing affected pages to a GDI printer on Windows.

:lsalzman, as triage owner, can you have a look please?

Filed automatically by Clouseau with an LLM, from a submitted crash report: not an independent Mozilla discovery

Filed automatically by Clouseau, which analyses release crashes with an LLM. Nothing above was written or checked by a human. Please close it as INVALID if it is wrong — that is useful feedback, not a nuisance.

This is not an independent Mozilla discovery: the crash is known here only because somebody submitted the crash report linked at the top. If this duplicates an existing report, please resolve THIS bug as the duplicate and leave the credit with the earlier reporter.

Flags: needinfo?(lsalzman)
Flags: needinfo?(lsalzman)
Keywords: regression
Regressed by: 2063318

Emilio, it looks like bug 2063318 (159) which always builds Cairo with assertions wired to trigger even on release has caused this fallout. However, we should now be printing with Skia as of bug 2079470 (160). So this should be a non-issue going forward, but 159 remains affected. 160 is going to ship very soon, though, so it seems maybe not worth attempting to fix this issue?

Flags: needinfo?(emilio)
Depends on: 2079470

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

Yeah I agree with that, specially if volume is not crazy.

Flags: needinfo?(emilio)

:mdauer, since you are the author of the regressor, bug 2063318, could you take a look? Also, could you set the severity field?

For more information, please visit BugBot documentation.

Flags: needinfo?(mdauer)

Crash volume is low on Release and I'm building 159.0.1 today anyway. If this doesn't affect 160, I agree that this bug is inactionable from a practical standpoint.

Status: NEW → RESOLVED
Closed: 20 days ago
Flags: needinfo?(mdauer)
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.