Closed Bug 2084357 Opened 1 month ago Closed 1 month ago

Crash in [@ webrender::visibility::build_backdrop_capture_regions]

Categories

(Core :: Graphics: WebRender, defect)

defect

Tracking

()

RESOLVED FIXED
160 Branch
Tracking Status
firefox-esr153 --- unaffected
firefox158 --- unaffected
firefox159 --- unaffected
firefox160 --- fixed

People

(Reporter: clouseau-bot, Assigned: gw)

References

(Blocks 1 open bug, Regression)

Details

(Keywords: crash, regression)

Crash Data

Attachments

(1 external file)

Crash report: https://crash-stats.mozilla.org/report/index/57ef6ee6-53c5-4adf-8f77-8daeb0261020

MOZ_CRASH Reason:

index out of bounds: the len is 292 but the index is 292

Top 10 frames:

0  xul.dll  RustMozCrash(char const*, int, char const*)  mozglue/static/rust/wrappers.cpp:17
1  xul.dll  mozglue_static::panic_hook(std::panic::PanicHookInfo*)  mozglue/static/rust/lib.rs:99
2  xul.dll  core::ops::function::FnOnce::call_once<void (*)(ref$<std::panic::PanicHookInfo>)...
3  xul.dll  std::panicking::panic_with_hook()  library/std/src/panicking.rs:833
4  xul.dll  std::panicking::panic_handler::closure$0()  library/std/src/panicking.rs:698
5  xul.dll  std::sys::backtrace::__rust_end_short_backtrace<std::panicking::panic_handler::c...  library/std/src/sys/backtrace.rs:182
6  xul.dll  std::panicking::panic_handler()  library/std/src/panicking.rs:689
7  xul.dll  core::panicking::panic_fmt()  library/core/src/panicking.rs:80
8  xul.dll  core::panicking::panic_bounds_check()  library/core/src/panicking.rs:271
9  xul.dll  webrender::frame_builder::FrameBuilder::build(webrender::scene::BuiltScene*, boo...  gfx/wr/webrender/src/frame_builder.rs:726

There are 4 crashes (from 1 installation) in nightly 160 with buildid 20261019215902.

This signature is new: its first report anywhere is in build 20261019215902 (2026-10-19), the build above.

Hardware-error share of this signature: of its 4 reports on this channel over the last year, 100% come from the known-buggy Intel Raptor Lake (family 6 model 183 stepping 1, bug 1975808; Firefox-nightly population: 4%).

Clouseau analysis (automated, 72% worth investigating — a calibrated estimate that this is worth someone's time, not that the changeset below caused it). The mechanism below fits the evidence but is not proven end-to-end:

build_backdrop_capture_regions probably panics indexing this frame's surfaces with a surface index left in a picture's raster_config by an earlier frame (len 292, index 292).

  1. FrameBuilder::build clears scene.surfaces each frame, so a SurfaceIndex is only valid for the frame that assigned it.
  2. PictureInstance::raster_config is reset only in PictureInstance::assign_surface, which runs only for pictures that got an update pass this frame.
  3. assign_update_pass sets info.parent before PictureInstance::is_visible, so a backdrop chain picture hidden by Filter::Opacity near 0 or by backface culling keeps a parent while it, and the children it never visits, keep last frame's raster_config.
  4. ea745deba60c added build_backdrop_capture_regions, which gates only on picture_graph.parent(chain_pic_index) and the root's surface_index, accepts any non-None raster_config in the chain, and then indexes surfaces[raster_config.surface_index.0].
  5. When an earlier frame had more surfaces, that stale index is at or past this frame's surfaces.len(), and the bounds check panics.

The exact len==index panic, the frame (build_backdrop_capture_regions inlined into FrameBuilder::build) and the signature first appearing in the build that added this function all fit. Nothing in the report shows the hidden chain picture, the inlined frame has no line info to say which surfaces[...] read fired, and every report comes from a known-defective Raptor Lake CPU. Look first at the chain-walk gate (pic.raster_config.is_none()): requiring picture_graph.surface_index(pic_index).is_some() for each chain picture would skip chains not reached this frame.

The signature was first seen in build 20261019215902, the first build with the bug 2079474 series, which landed on 2026-10-18. Blame of visibility.rs lines 456-495 at the build rev is entirely ea745deba60c, which added the function and its call in FrameBuilder::build_layer_screen_rects_and_cull_layers. The crash frame is that inlined call at frame_builder.rs:726. The 4/4 Raptor Lake share is a real caveat, but the deterministic off-by-one bounds panic in brand-new code argues for a software cause.

Suspected regressor: ea745deba60c (gh) (bug 2079474) by :gw.

Code references:

What the automated skeptic pass checked

In its own words (a pass means the check succeeded, which is not always support for the conclusion):

  • unverifiable mechanism — No annotation shows a hidden chain picture. The inlined frame has no line info, so which surfaces[...] site fired cannot be pinned. Other index sites are in range, debug-only, or would panic with a different message.
  • unverifiable hardware — 4/4 reports come from Raptor Lake CPUs, but 4 is too few to tell a defect from population bias. An exact len==index panic in a function new in the first-seen build points at software.
  • unverifiable followups — Pt 2 (fb3b55d32e19), Pt 4 (17b22abfced1) and Pt 5 (59fe71d7c538) of the same bug touch the area but do not introduce the raster_config.is_none() gate. They are part of the same series and not singled out.
  • pass step1 — scene.surfaces.clear() runs every frame (frame_builder.rs:703, build rev). pic_info is rebuilt every frame, so only raster_config persists across frames.
  • pass step2_step3 — The only resets of raster_config are picture.rs:1125 and the constructor. info.parent is set before the is_visible check, and invisible pictures and their children skip assign_surface.
  • pass hunk0 — The chain walk tests only raster_config.is_none() and then indexes surfaces with the stored index. Blame of visibility.rs lines 456-495 at the build rev is entirely ea745deba60c.

:gw, can you have a look please?

Filed automatically by Clouseau, which analyses nightly 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?(mozilla)

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

A culled picture keeps the raster config of the last frame it was drawn in, whose surface index can be past the end of this frame's surfaces.

Assignee: nobody → mozilla
Status: NEW → ASSIGNED
Flags: needinfo?(mozilla)
Pushed by gwatson@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/0f3d43972e91 https://hg.mozilla.org/integration/autoland/rev/e48f23101298 Skip backdrop chains with a picture not drawn this frame. r=gfx-reviewers,bradwerth
Status: ASSIGNED → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 160 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: