Closed Bug 1852060 Opened 9 months ago Closed 7 months ago

Android Crash in [@ style::values::generics::calc::GenericCalcNode<T>::resolve_internal]

Categories

(Core :: Audio/Video: cubeb, defect)

Unspecified
Android
defect

Tracking

()

RESOLVED FIXED
121 Branch
Tracking Status
firefox-esr102 --- unaffected
firefox-esr115 --- unaffected
firefox117 --- wontfix
firefox118 --- wontfix
firefox119 --- fixed
firefox120 --- fixed
firefox121 --- fixed

People

(Reporter: aryx, Assigned: padenot)

References

Details

(Keywords: crash, csectype-wildptr, sec-high)

Crash Data

220+ crashes on 180+ Android devices with Firefox 117, no crashes for v116. 40+% of crashes during the first minute after launch, many reports for Android APIs 31 and 33.

Crash report: https://crash-stats.mozilla.org/report/index/1bbb0912-d8ae-421e-8fbd-d6f940230907

Reason: SIGSEGV / SEGV_MAPERR

Top 10 frames of crashing thread:

0  libxul.so  style::values::generics::calc::GenericCalcNode<L>::resolve_internal  servo/components/style/values/generics/calc.rs:758
1  libxul.so  style::values::generics::calc::GenericCalcNode<L>::resolve_map  servo/components/style/values/generics/calc.rs:751
1  libxul.so  style::values::computed::length_percentage::CalcLengthPercentage::resolve  servo/components/style/values/computed/length_percentage.rs:799
1  libxul.so  Servo_ResolveCalcLengthPercentage  servo/ports/geckolib/glue.rs:7127
2  libxul.so  mozilla::StyleCalcLengthPercentage::ResolveToCSSPixels const  layout/style/ServoStyleConstsInlines.h:684
2  libxul.so  mozilla::StyleLengthPercentageUnion::ResolveToCSSPixels const  layout/style/ServoStyleConstsInlines.h:697
2  libxul.so  mozilla::StyleLengthPercentageUnion::ResolveToCSSPixelsWith<nsStyleTransformMatrix::Convert2DPosition const  layout/style/ServoStyleConstsInlines.h:707
2  libxul.so  nsStyleTransformMatrix::Convert2DPosition  layout/style/nsStyleTransformMatrix.cpp:584
3  libxul.so  mozilla::MotionPathUtils::ResolveMotionPath  layout/base/MotionPathUtils.cpp:476
4  libxul.so  mozilla::nsDisplayTransform::FrameTransformProperties::FrameTransformProperties  layout/painting/nsDisplayList.cpp:6163
Flags: needinfo?(emilio)

This is basically bug 1628644 / bug 1849200, just with a different signature... The android spike mentioned there seems untouched, and seems ResolveMotionPath is still commonly involved here...

Have fuzzers seen anything like this by any chance? I see a bunch of the reports have accessibility active, that might be another clue...

Flags: needinfo?(emilio)

For the question above.

Flags: needinfo?(jkratzer)
Severity: -- → S3
Priority: -- → P3

I hit a few instances of this on Android trying to set up a video call desktop<->android on discord.com (android was in desktop mode), as I was trying to reproduce bug 1796564. I see the crash report in comment 0 has NativeAudioCall(back) as its most recent thread too. Paul, do you know anything that went into 117 that could affect this?

Marking as a security bug as it seems fishy if something in the audio stack could affect css.

Group: core-security
Flags: needinfo?(padenot)

(In reply to Andreas Pehrson [:pehrsons] from comment #3)

Marking as a security bug as it seems fishy if something in the audio stack could affect css.

Thanks, that's very useful info. Andreas, do you know if we have Android ASAN / TSAN builds? The only way something like that should happen is if the audio code was corrupting heap memory allocated by CSS somehow.

Flags: needinfo?(apehrson)
Group: core-security → layout-core-security

Not that I have used it but I see an asan mozconfig for x64 android on central.

Flags: needinfo?(apehrson)

I see this happening only on Android 31 and above. That correlates with the aaudio cubeb backend, which, as a sidenote, had some crash fix uplifts into 117. I think this is evidence enough that this is a cubeb issue.

Severity: S3 → --
Component: CSS Parsing and Computation → Audio/Video: cubeb
Priority: P3 → --
Group: layout-core-security → media-core-security

I had to re-check and will note that out of 4 crashes, 3 were this bug and 1 was in MediaTrackGraph.

Crash Signature: [@ style::values::generics::calc::GenericCalcNode<T>::resolve_internal] → [@ style::values::generics::calc::GenericCalcNode<T>::resolve_internal] [@ mozilla::MediaTrackGraphImpl::UpdateGraph ]
Flags: needinfo?(jkratzer)

The two bugs in comment 1 were duped to bug 1842404, which was fixed in Fx 117. The crash graph for those spiked in the previous release and then was indeed quelled in Fx 117. This one, however, seems to have started in fx 117.

Is it a regression from that one? Is it in fact the other one wasn't fixed but that change moved the signature slightly?

Flags: needinfo?(emilio)
See Also: → 1842404

It's not a regression from that one but a signature change, yeah. Our guess in those other bugs were bit flips, but given comment 6 and previous it is probably more like another part of Gecko stomping on our memory.

Flags: needinfo?(emilio)

Per :dbaker it seems like using a bluetooth audioinput with the aaudio cubeb backend is needed to trigger weird crashes (or perhaps it makes it much more likely), and not necessarily with the stack reported here.

It does seem like this is only reproducible using a bluetooth audioinput with the aaudio cubeb backend. I attempted to use an ASAN build for Android but was unsuccessful in getting one to build and run. If anyone has suggestions for an ASAN build I can reproduce this crash easily using my Pixel 6 Pro.

Keywords: stalled

The spike seems to have died down a bit, though the levels are still higher than they were before the spike.

I'm not sure what to do about the rating for this. I guess I'll mark it sec-high because there's some vague hint that this could be due to cubeb, but maybe it could be related to a hardware issue like the previous CSS thing? I guess somebody would have to look at what devices are hitting this to look into the latter problem.

Note I see a crash-report without the aaudio backend (using opensl). Here's also another without an audio thread listed. Not sure what to make of it, but the correlation still seems pretty strong, especially when you consider the timing in those cases we've been able to reproduce ourselves (time of crash correlates pretty closely with start of audio capture).

I have a patch in bug 1860423 that might address this. The input side of a cubeb stream was zeroing memory a bit past its buffer in some cases, :dbaker found the offending code.

This is upliftable as far as needed because it's very simple.

Flags: needinfo?(padenot)
Depends on: 1860423
See Also: → 1862662

Parent is fixed up to 120.

Severity: -- → S2
Duplicate of this bug: 1862662

Copying crash signatures from duplicate bugs.

Crash Signature: [@ style::values::generics::calc::GenericCalcNode<T>::resolve_internal] [@ mozilla::MediaTrackGraphImpl::UpdateGraph ] → [@ style::values::generics::calc::GenericCalcNode<T>::resolve_internal] [@ mozilla::MediaTrackGraphImpl::UpdateGraph ] [@ style::values::computed::length_percentage::CalcLengthPercentage::resolve]
Status: NEW → RESOLVED
Crash Signature: [@ style::values::generics::calc::GenericCalcNode<T>::resolve_internal] [@ mozilla::MediaTrackGraphImpl::UpdateGraph ] [@ style::values::computed::length_percentage::CalcLengthPercentage::resolve] → [@ style::values::generics::calc::GenericCalcNode<T>::resolve_internal] [@ mozilla::MediaTrackGraphImpl::UpdateGraph ] [@ style::values::computed::length_percentage::CalcLengthPercentage::resolve]
Closed: 7 months ago
Resolution: --- → FIXED

Since the bug is closed, the stalled keyword is now meaningless.
For more information, please visit BugBot documentation.

Keywords: stalled
Assignee: nobody → padenot
Group: media-core-security → core-security-release
Target Milestone: --- → 121 Branch
QA Whiteboard: [post-critsmash-triage]
QA Whiteboard: [post-critsmash-triage] → [fixed by bug 1860423[post-critsmash-triage]
Group: core-security-release
QA Whiteboard: [fixed by bug 1860423[post-critsmash-triage] → [fixed in bug 1860423][post-critsmash-triage]
See Also: 1862662
You need to log in before you can comment on or make changes to this bug.