Open Bug 2033796 Opened 7 months ago Updated 5 hours ago

Crash in [@ stackoverflow | to_computed_color]: repeatedly interrupted transitions of currentcolor-based colors nest color-mix() without bound

Categories

(Core :: CSS Parsing and Computation, defect, P3)

Firefox 152
defect

Tracking

()

Tracking Status
thunderbird_esr153 --- affected
firefox-esr140 --- unaffected
firefox150 --- unaffected
firefox151 --- unaffected
firefox152 --- fix-optional

People

(Reporter: mkmelin, Assigned: tlouw)

References

(Blocks 1 open bug, Regression)

Details

(Keywords: crash, regression, topcrash-thunderbird, Whiteboard: [tbird topcrash])

Crash Data

Attachments

(3 files, 2 external files, 1 obsolete file)

My Thunderbird Daily from today keeps crashing like crazy. Bug 2032954 touched the crashing lines so I'll assume from there.

Crash report: https://crash-stats.mozilla.org/report/index/bde93689-f56f-48c9-967f-c6c980260421

Reason:

SIGSEGV / SEGV_MAPERR

Top 10 frames:

0  libxul.so  style::values::specified::color::Color::to_computed_color  servo/components/style/values/specified/color.rs:858
1  libxul.so  style::values::specified::color::Color::to_computed_color  servo/components/style/values/specified/color.rs:905
2  libxul.so  style::values::specified::color::Color::to_computed_color  servo/components/style/values/specified/color.rs:905
3  libxul.so  style::values::specified::color::Color::to_computed_color  servo/components/style/values/specified/color.rs:905
4  libxul.so  style::values::specified::color::Color::to_computed_color  servo/components/style/values/specified/color.rs:905
5  libxul.so  style::values::specified::color::Color::to_computed_color  servo/components/style/values/specified/color.rs:905
6  libxul.so  style::values::specified::color::Color::to_computed_color  servo/components/style/values/specified/color.rs:905
7  libxul.so  style::values::specified::color::Color::to_computed_color  servo/components/style/values/specified/color.rs:905
8  libxul.so  style::values::specified::color::Color::to_computed_color  servo/components/style/values/specified/color.rs:905
9  libxul.so  style::values::specified::color::Color::to_computed_color  servo/components/style/values/specified/color.rs:905
Flags: needinfo?(emilio)

I don't understand that crash report. The crashing thread stack doesn't have a reasonable beginning... It's also... not a stack overflow? I'm confused. Gabriele am I missing something?

Flags: needinfo?(emilio) → needinfo?(gsvelto)
Whiteboard: [tbird crash]

The other crash I submitted was bp-4e0b73d6-a375-46f1-9d45-be98d0260421. I think I had one or two others that I ignored.
It's not crashed since.

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

Crashed again after upgrade to next Daily. bp-70b22a80-95de-48ab-a8ba-ff1a30260423

See Also: → 2034718

I crashed twice in the last hour with this signature after updating to 151.0b1, ex:
https://crash-stats.mozilla.org/report/index/fc023eb5-a2d0-4dd1-8b49-13c960260424

The macOS crashes have the full stack. On Linux we sometimes limit how much of the stack we put in the minidump to prevent it from being gigantic, I suspect that's what happened here and why the stack is cut short.

Flags: needinfo?(gsvelto)

I'm not sure this really is a new regression (though it may have become more frequent); e.g. https://crash-stats.mozilla.org/report/index/751dbc25-eeab-45e0-94b0-60b8c0251114 is from Fenix 145 back in November, and https://crash-stats.mozilla.org/report/index/d8157b35-93d3-494d-be82-79bf80251108 is from Fenix 144, but they both look like the same crash as the recent reports here.

I agree it may be from some other bug.

See Also: → 2035590

The severity field is not set for this bug.
:emilio, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(emilio)

It's not super clear if what causes this is a logic bug, a massively nested color on the front-end, or something else. I suspect the second, but without a repro or so it's hard to confirm...

Severity: -- → S3
Flags: needinfo?(emilio)
Priority: -- → P3
Summary: Crash in [@ style::values::specified::color::Color::to_computed_color] → Thunderbird Crash in [@ style::values::specified::color::Color::to_computed_color]

(In reply to Jonathan Kew [:jfkthame] from comment #7)

I'm not sure this really is a new regression (though it may have become more frequent); e.g. https://crash-stats.mozilla.org/report/index/751dbc25-eeab-45e0-94b0-60b8c0251114 is from Fenix 145 back in November, and https://crash-stats.mozilla.org/report/index/d8157b35-93d3-494d-be82-79bf80251108 is from Fenix 144, but they both look like the same crash as the recent reports here.

If not new, is it related to older Bug 1840573 - Thunderbird Crash in [@ stackoverflow | style::values::animated::impl$10::to_animated_value] via style::values::generics::color ... and more broadly https://crash-stats.mozilla.org/search/?proto_signature=~style%3A%3Avalues%3A&product=Thunderbird&date=%3E%3D2026-04-13T14%3A18%3A00.000Z&date=%3C2026-05-13T14%3A18%3A00.000Z&_facets=signature&_sort=-date&_columns=date&_columns=signature&_columns=product&_columns=version&_columns=build_id&_columns=platform#facet-signature ??

0 XUL style::values::specified::color::Color::to_computed_color servo/components/style/values/specified/color.rs:858

this is the first line in my crash string when TB crashed today after updating to 151.0b4

full report:
https://crash-stats.mozilla.org/report/index/c142fe83-c026-4786-9837-d00370260513

I am now on macOS 26.5 - TB did freeze when attempting to reboot and update, the macOS that is - been stable since

See Also: → 2039652
See Also: 2039652 →
Assignee: nobody → mozilla
Status: NEW → ASSIGNED

Duping all adjacent signatures of the different platforms here to get a better overview.

Crash Signature: [@ style::values::specified::color::Color::to_computed_color] → [@ style::values::specified::color::Color::to_computed_color] [@ stackoverflow | enum2$<T>::to_computed_color] [@ stackoverflow | style::values::animated::impl$10::to_animated_value] [@ stackoverflow | style::values::generics::color::impl$16::to_animat…

stackoverflow | enum2$<T>::to_computed_color is in fact the #3 ranked signature for Thunderbird esr153

Severity: S3 → S2
Whiteboard: [tbird crash] → [tbird topcrash]
Version: unspecified → Firefox 152
See Also: → 2083362

(In reply to Wayne Mery (:wsmwk) from comment #15)

stackoverflow | enum2$<T>::to_computed_color is in fact the #3 ranked signature for Thunderbird esr153

Still trying to fully wrap my head around, our CSS could be better but not something that should ever end in a crash.

Hi Emilio,

steps to reproduce.

  • Open crash_fill_raf.html
  • Keep in focus for ~60s (macOS 27, other platforms may differ)
  • Observe tab crash

Neither Chrome nor Safari crash even after an hour on the same page.

In Thunderbird, we are apparently doing something similar just in the main process taking the whole app down.

Thanks

Max

Flags: needinfo?(emilio)
Attached file crash_fill_raf.html —

FWIW, Took 1min40s for me to crash on latest linux Firefox Nightly loading the testcase comment 18.

Blocks: 1840573

I think it's best to split the discussion, keep Firefox/Gecko here and track Thunderbird CSS in bug 1840573.

FWIW it should be easy to see one of those long-running transitions in the Firefox profiler?

(In reply to Emilio Cobos Álvarez [:emilio] from comment #21)

FWIW it should be easy to see one of those long-running transitions in the Firefox profiler?

What do you need? Long running isn't the issue here, applying transitions on top of each other is. Each further transition nests the calculation one level deeper.

On a high level, both WebKit and Chromium/Blink resolve the current colour before moving on with the calculation; we should do the same. I do not care about the details, feel free to take over. As long as the repro no longer causes a crash, I am good.

(In reply to Max Emig [:maxe] from comment #22)

What do you need? Long running isn't the issue here, applying transitions on top of each other is. Each further transition nests the calculation one level deeper.

I don't need anything, I was just pointing out how to find out these with the profiler since it seems Thunderbird is hitting this.

On a high level, both WebKit and Chromium/Blink resolve the current colour before moving on with the calculation; we should do the same. I do not care about the details, feel free to take over. As long as the repro no longer causes a crash, I am good.

Well that's incorrect? You can use fill: inherit or change the current color on a child and it should not hard-code the parent's currentColor should it?

Flags: needinfo?(emilio)

Chrome and WebKit are broken here, TypedOM wise, which is unfortunate because it's the only way of observing this behavior via script rather than reading the final color.

Unassigning myself here, I will follow along.

Assignee: mozilla → nobody
Status: ASSIGNED → NEW
Attachment #9663981 - Attachment is obsolete: true

Better placeholder name than before, feel free to change.

Summary: Thunderbird Crash in [@ style::values::specified::color::Color::to_computed_color] → Crash in [@ stackoverflow | to_computed_color]: repeatedly interrupted transitions of currentcolor-based colors nest color-mix() without bound
Attached file Stress test —

Chrome also scales non-constantly which means they're probably doing something like the nested dance, but they clearly are faster than us... Tiaan maybe you can take a look? It's unclear what Chrome / WebKit are doing internally because of their TypedOM bug, but at a glance flattening like the proposed patch might work.

Flags: needinfo?(tlouw)

(In reply to Emilio Cobos Álvarez [:emilio] from comment #27)

Created attachment 9664061 [details]
Stress test

Chrome also scales non-constantly which means they're probably doing something like the nested dance, but they clearly are faster than us... Tiaan maybe you can take a look? It's unclear what Chrome / WebKit are doing internally because of their TypedOM bug, but at a glance flattening like the proposed patch might work.

For reference the most relevant sections, as-of today:

Chromium/Blink

WebKit

How it all works out together in practice is a different beast, not immediately obvious unless one happens to know the codebase.

Assignee: nobody → tlouw
Flags: needinfo?(tlouw)
Duplicate of this bug: 2083362

Append interpolation steps instead of nesting color-mix values. Evaluate
each step in order, preserving currentcolor dependencies.

Attachment #9668384 - Attachment description: Bug 2033796 - Store interrupted color interpolation as a flat sequence r=emilio,#layout → WIP: Bug 2033796 - Store interrupted color interpolation as a flat sequence r=emilio,#layout
Crash Signature: | style::values::generics::color::impl$11::to_animated_value<T] [@ stackoverflow | style::values::generics::color::impl$28::from_animated_value ] → | style::values::generics::color::impl$11::to_animated_value<T] [@ stackoverflow | style::values::generics::color::impl$28::from_animated_value ] [@ stackoverflow | style::values::generics::color::impl$30::from_animated_value ] [@ stackoverflow | sty…
Attachment #9678688 - Attachment description: WIP: Bug 2033796 - Represent color mix behavior with an enum r?#firefox-style-system-reviewers → Bug 2033796 - Represent color mix behavior with an enum r?#firefox-style-system-reviewers
Attachment #9668384 - Attachment description: WIP: Bug 2033796 - Store interrupted color interpolation as a flat sequence r=emilio,#layout → Bug 2033796 - Store interrupted color interpolation as a flat sequence r=emilio,#layout

Here's a testcase that claude generated that triggers this crash (after hanging for about 20 seconds, on my Surface 7 Pro with Ubuntu 26.04)

Two crashes from me using this testcase:
bp-ab53a695-7e70-4b47-aafa-c428e0261111
bp-b4158a6f-0343-4f6c-b523-d3fe50261111

Attachment #9679586 - Attachment description: testcase 3 → testcase 3 (loops forever, crashing with this bug's signature in affected Firefox versions)

(In reply to Daniel Holbert [:dholbert] from comment #32)

Created attachment 9679586 [details]
testcase 3 (loops forever, crashing with this bug's signature in affected Firefox versions)

Here's a testcase that claude generated that triggers this crash (after hanging for about 20 seconds, on my Surface 7 Pro with Ubuntu 26.04)

Two crashes from me using this testcase:
bp-ab53a695-7e70-4b47-aafa-c428e0261111
bp-b4158a6f-0343-4f6c-b523-d3fe50261111

10s on Nightly on macOS, 1/6 of the time my own took. But to be fair, I did not try to hillclimb mine into even shorter time once it was reliable.

And remember everyone, if this happens in the Thunderbird GUI due to some bulk action, we lose the entire app at the worst possible time while some move is ongoing.

Attachment #9668384 - Attachment description: Bug 2033796 - Store interrupted color interpolation as a flat sequence r=emilio,#layout → WIP: Bug 2033796 - Store repeated color interpolations as a flat color-mix(). r?#firefox-style-system-reviewers
Attachment #9668384 - Attachment description: WIP: Bug 2033796 - Store repeated color interpolations as a flat color-mix(). r?#firefox-style-system-reviewers → Bug 2033796 - Store repeated color interpolations as a flat color-mix(). r?#firefox-style-system-reviewers
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: