Closed Bug 1844622 Opened 3 years ago Closed 2 years ago

Crash in [@ java.lang.RuntimeException: at android.media.MediaCodecList.native_getCodecCount(Native Method)] "cannot get MediaCodecList"

Categories

(GeckoView :: Media, defect, P2)

Unspecified
Android
defect

Tracking

(firefox115 wontfix, firefox116 fixed, firefox117 fixed)

RESOLVED FIXED
117 Branch
Tracking Status
firefox115 --- wontfix
firefox116 --- fixed
firefox117 --- fixed

People

(Reporter: cpeterson, Assigned: az)

References

Details

(Keywords: crash)

Crash Data

Attachments

(1 file)

Crash report: https://crash-stats.mozilla.org/report/index/3369bfe2-f697-4d1e-a913-472b20230719

This is not a new crash: we have crash reports going back to at least Fenix 92, but there volume of reports has increased from ~10 in Fenix 108 to 100+ in Fenix 109 and steadily increasing to 700+ in Fenix 114.

100% of the crashes are from Android version <= 7.0 (API 28). 76% are from Android 7.0 (API 24).

Java stack trace:

java.lang.RuntimeException: cannot get MediaCodecList
	at android.media.MediaCodecList.native_getCodecCount(Native Method)
	at android.media.MediaCodecList.initCodecList(MediaCodecList.java:82)
	at android.media.MediaCodecList.getCodecCount(MediaCodecList.java:43)
	at org.mozilla.gecko.util.HardwareCodecCapabilityUtils.getHWCodecCapability(HardwareCodecCapabilityUtils.java:3)
	at org.mozilla.gecko.util.HardwareCodecCapabilityUtils.hasHWH264(HardwareCodecCapabilityUtils.java:2)
	at org.mozilla.gecko.mozglue.GeckoLoader.nativeRun(Native Method)
	at org.mozilla.gecko.GeckoThread.run(GeckoThread.java:613)
Assignee: nobody → azebrowski
Status: NEW → ASSIGNED

Interestingly, it looks like we ran into something similar in 1357287. According to the notes, it looks like it was an Android bug on certain devices, though I'm not sure why we'd have a spike in reports recently. I've submitted a patch that makes a similar fix to 1357287 by bailing out if there's a Android failure querying for codec support. The submitted patch will also use getCodecInfos if supported instead of getCodecCount in the loop where the crashes were occurring, which may be more reliable.

Flags: needinfo?(jolin)
Keywords: crash
See Also: → 1357287

We might want to uplift this crash fix to a 116.x dot release (currently scheduled for 2023-08-07). With 116.0 being released next week, it's too late to uplift to a 115.x dot release.

Re-adding the crash keyword, looks like my previous update removed it.

Keywords: crash
Pushed by azebrowski@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/a074374f33de Catch and ignore runtime exception during media codec query on Android if MediaCodecInfo cannot be retrieved. r=jolin,geckoview-reviewers,owlish
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 117 Branch

Comment on attachment 9345143 [details]
Bug 1844622 - Catch and ignore runtime exception during media codec query on Android if MediaCodecInfo cannot be retrieved. r=jolin

Beta/Release Uplift Approval Request

  • User impact if declined: Crashes on Android instead of graceful / recoverable failure when media codecs fail to enumerate.
  • Is this code covered by automated tests?: Unknown
  • Has the fix been verified in Nightly?: No
  • Needs manual test from QE?: No
  • If yes, steps to reproduce:
  • List of other uplifts needed: None
  • Risk to taking this patch: Medium
  • Why is the change risky/not risky? (and alternatives if risky): We don't have many crash reports of this on nightly to compare against. However, this fix doesn't touch a lot of code and tackles the bug in the same manner a previous bug of this nature was squashed.
  • String changes made/needed:
  • Is Android affected?: Yes
Attachment #9345143 - Flags: approval-mozilla-release?

Comment on attachment 9345143 [details]
Bug 1844622 - Catch and ignore runtime exception during media codec query on Android if MediaCodecInfo cannot be retrieved. r=jolin

Approved for the 116.0.3 dot release

Attachment #9345143 - Flags: approval-mozilla-release? → approval-mozilla-release+
QA Whiteboard: [qa-triaged]
Flags: needinfo?(jolin)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: