Closed Bug 1953722 Opened 10 months ago Closed 10 months ago

Crash in [@ mozilla::WebrtcGmpVideoEncoder::Encode_g]

Categories

(Core :: WebRTC: Audio/Video, defect, P1)

defect

Tracking

()

VERIFIED FIXED
138 Branch
Tracking Status
firefox-esr115 --- unaffected
firefox-esr128 --- unaffected
firefox136 + verified
firefox137 + verified
firefox138 + verified

People

(Reporter: aryx, Assigned: pehrsons)

References

(Regression)

Details

(Keywords: crash, regression)

Crash Data

Attachments

(3 files)

120 crashes/assertions from 120 installs of Firefox 136.0 and 136.0.1 on different operating systems.

Crash report: https://crash-stats.mozilla.org/report/index/d6b66a56-59ea-4979-a04b-d1c9b0250313

MOZ_CRASH Reason:

MOZ_RELEASE_ASSERT(mInputImageMap.IsEmpty() || mInputImageMap.LastElement().rtp_timestamp < frame->Timestamp())

Top 10 frames:

0  xul.dll  mozilla::WebrtcGmpVideoEncoder::Encode_g(webrtc::VideoFrame const&, std::vect...  dom/media/webrtc/libwebrtcglue/WebrtcGmpVideoCodec.cpp:380
1  xul.dll  mozilla::detail::RunnableMethodArguments<webrtc::VideoFrame, std::vector<webr...  xpcom/threads/nsThreadUtils.h:1085
1  xul.dll  std::invoke<`lambda at /builds/worker/workspace/obj-build/dist/include/nsThre...  /builds/worker/fetches/vs/VC/Tools/MSVC/14.39.33519/include/type_traits:1739
2  xul.dll  std::_Apply_impl(mozilla::detail::RunnableMethodArguments<webrtc::VideoFrame,...  /builds/worker/fetches/vs/VC/Tools/MSVC/14.39.33519/include/tuple:1077
2  xul.dll  std::apply(mozilla::detail::RunnableMethodArguments<webrtc::VideoFrame, std::...  /builds/worker/fetches/vs/VC/Tools/MSVC/14.39.33519/include/tuple:1088
2  xul.dll  mozilla::detail::RunnableMethodArguments<webrtc::VideoFrame, std::vector<webr...  xpcom/threads/nsThreadUtils.h:1083
2  xul.dll  mozilla::detail::RunnableMethodImpl<mozilla::WebrtcGmpVideoEncoder*, void (mo...  xpcom/threads/nsThreadUtils.h:1134
3  xul.dll  nsThread::ProcessNextEvent(bool, bool*)  xpcom/threads/nsThread.cpp:1153
3  xul.dll  NS_ProcessNextEvent(nsIThread*, bool)  xpcom/threads/nsThreadUtils.cpp:480
4  xul.dll  mozilla::ipc::MessagePumpForNonMainThreads::Run(base::MessagePump::Delegate*)  ipc/glue/MessagePump.cpp:329
Flags: needinfo?(apehrson)
Assignee: nobody → apehrson
Severity: -- → S2
Status: NEW → ASSIGNED
Flags: needinfo?(apehrson)
Priority: -- → P1

We have a Fx136 desktop dot release that builds on 2025-03-17, not sure if we'll have something safe to uplift for then?
Otherwise, next week is the final week of beta for Fx137. Hopefully it can be fixed there at least.

This to avoid time going backwards due to uint32_t wraparound.

This to avoid time going backwards due to uint32_t wraparound.

Original Revision: https://phabricator.services.mozilla.com/D241394

Attachment #9471714 - Flags: approval-mozilla-beta?

This to avoid time going backwards due to uint32_t wraparound.

Original Revision: https://phabricator.services.mozilla.com/D241394

Attachment #9471719 - Flags: approval-mozilla-release?
Attachment #9471714 - Attachment description: Bug 1953722 - Key input frames to the webrtc gmp encoder off ntp timestamps instead of rtp. r?aosmond → WIP: Bug 1953722 - Key input frames to the webrtc gmp encoder off ntp timestamps instead of rtp. r?aosmond
Attachment #9471714 - Flags: approval-mozilla-beta?
Attachment #9471714 - Attachment description: WIP: Bug 1953722 - Key input frames to the webrtc gmp encoder off ntp timestamps instead of rtp. r?aosmond → Bug 1953722 - Key input frames to the webrtc gmp encoder off ntp timestamps instead of rtp. r?aosmond
Attachment #9471714 - Flags: approval-mozilla-beta?

beta Uplift Approval Request

  • User impact if declined: Content process crashes when in a video call encoding H264 video.
  • Code covered by automated testing: no
  • Fix verified in Nightly: no
  • Needs manual QE test: yes
  • Steps to reproduce for manual QE testing: Use some video conferencing services that use H264 like Microsoft Teams and Facebook Messenger. I have also been using https://fippo.github.io/simulcast-playground/rid-as-mid?codec=h264 to test H264 simulcast.
  • Risk associated with taking this patch: Low
  • Explanation of risk level: This patch changes what type of timestamp we use to track video frames for encoding with OpenH264. The type used previously is now copied on the side instead, so encoder output should not change due to this patch.
  • String changes made/needed: None
  • Is Android affected?: no
Flags: qe-verify+

release Uplift Approval Request

  • User impact if declined: Content process crashes when in a video call encoding H264 video.
  • Code covered by automated testing: no
  • Fix verified in Nightly: no
  • Needs manual QE test: yes
  • Steps to reproduce for manual QE testing: Use some video conferencing services that use H264 like Microsoft Teams and Facebook Messenger. I have also been using https://fippo.github.io/simulcast-playground/rid-as-mid?codec=h264 to test H264 simulcast.
  • Risk associated with taking this patch: Low
  • Explanation of risk level: This patch changes what type of timestamp we use to track video frames for encoding with OpenH264. The type used previously is now copied on the side instead, so encoder output should not change due to this patch.
  • String changes made/needed: None
  • Is Android affected?: no
Pushed by pehrsons@gmail.com: https://hg.mozilla.org/integration/autoland/rev/9c021d42060a Key input frames to the webrtc gmp encoder off ntp timestamps instead of rtp. r=aosmond
Status: ASSIGNED → RESOLVED
Closed: 10 months ago
Resolution: --- → FIXED
Target Milestone: --- → 138 Branch
Attachment #9471714 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
QA Whiteboard: [qa-triaged]

Hi, Andreas Pehrson! I tried to reproduce this crash on Windows 11 with Firefox 136.0 by making a video call on Microsoft Teams and Facebook Messenger, but I couldn't reproduce it.

Could you let me know if there's anything else I should try to repro the issue?

Flags: needinfo?(apehrson)

(In reply to Ciprian Georgiu, Desktop QA from comment #11)

Hi, Andreas Pehrson! I tried to reproduce this crash on Windows 11 with Firefox 136.0 by making a video call on Microsoft Teams and Facebook Messenger, but I couldn't reproduce it.

Could you let me know if there's anything else I should try to repro the issue?

Well if it's no worse that's good! :-)
The hypothesis is a millisecond timestamp uint32_t wraparound. ~50 days worth of millis fit in a uint32_t, but there was a multiplication with 1000 involved as well. Then we're down to 0.05 days, i.e. ~70 minutes. Could you leave a call running for an hour or two to see if it repros? If not, then if a call of the same duration with the patch is also fine, that's good enough, thanks.

Flags: needinfo?(apehrson)
Attachment #9471719 - Flags: approval-mozilla-release? → approval-mozilla-release+

Thanks, Andreas! I still couldn’t reproduce the issue by leaving a call running on Microsoft Teams.

I made another call using all the fixed builds and left it running for an hour and a half, and I did not encounter any issues. I believe this should be enough to close the bug as verified fixed based on this check.

Tested with Firefox 136.0.2, 137.0b7, and 138.0a1.

Status: RESOLVED → VERIFIED
Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: