Closed Bug 1761217 Opened 3 years ago Closed 3 years ago

[RDD] When video decoder is restarted, audio decoder fails

Categories

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

defect

Tracking

()

RESOLVED FIXED
100 Branch
Tracking Status
firefox100 --- fixed

People

(Reporter: stransky, Assigned: stransky)

References

(Blocks 2 open bugs)

Details

Attachments

(2 files, 1 obsolete file)

If we recreate video decoder due to va-api sandbox crash, audio decoder uses old IPC bridge which leads to SHM allocation failure.

(gdb) p mLinkStatus
$1 = mozilla::ipc::LinkStatus::Inactive

bt:
#0 mozilla::ipc::IProtocol::CanSend() const (this=0x7feee2fd5740) at /raid/src/ipc/glue/ProtocolUtils.h:227
#1 0x00007fef00aa8981 in mozilla::ipc::IProtocol::AllocUnsafeShmem(unsigned long, mozilla::ipc::SharedMemory::SharedMemoryType, mozilla::ipc::Shmem*)
(this=0x7feee2fd5740, aSize=166, aType=mozilla::ipc::SharedMemory::TYPE_BASIC, aOutMem=0x7feee2f50a70) at /raid/src/ipc/glue/ProtocolUtils.cpp:424
#2 0x00007fef03a771a3 in mozilla::ShmemPool::AllocateShmem<mozilla::RemoteDecoderChild>(mozilla::RemoteDecoderChild*, unsigned long, mozilla::ShmemBuffer&, mozilla::ShmemPool::AllocationPolicy) (this=0x7feee2fd5780, aInstance=0x7feee2fd5740, aSize=166, aRes=..., aPolicy=mozilla::ShmemPool::AllocationPolicy::Unsafe) at /raid/src/objdir/dist/include/mozilla/ShmemPool.h:168
#3 0x00007fef03a76e7c in mozilla::ShmemPool::Get<mozilla::RemoteDecoderChild>(mozilla::RemoteDecoderChild*, unsigned long, mozilla::ShmemPool::AllocationPolicy)
(this=0x7feee2fd5780, aInstance=0x7feee2fd5740, aSize=166, aPolicy=mozilla::ShmemPool::AllocationPolicy::Unsafe) at /raid/src/objdir/dist/include/mozilla/ShmemPool.h:120
#4 0x00007fef03a76a98 in mozilla::ShmemRecycleAllocator<mozilla::RemoteDecoderChild>::AllocateBuffer(unsigned long, mozilla::ShmemPool::AllocationPolicy)
(this=0x7feee2fd5778, aSize=166, aPolicy=mozilla::ShmemPool::AllocationPolicy::Unsafe) at /raid/src/objdir/dist/include/mozilla/ShmemRecycleAllocator.h:21
#5 0x00007fef03a76a07 in mozilla::RemoteDecoderChild::Decode(nsTArray<RefPtr<mozilla::MediaRawData> > const&)::$_9::operator()(unsigned long) const (this=0x7feeee1fb670, aSize=166)
at /raid/src/dom/media/ipc/RemoteDecoderChild.cpp:128
#6 0x00007fef03a76865 in std::_Function_handler<mozilla::ShmemBuffer (unsigned long), mozilla::RemoteDecoderChild::Decode(nsTArray<RefPtr<mozilla::MediaRawData> > const&)::$_9>::_M_invoke(std::_Any_data const&, unsigned long&&) (__functor=..., __args=@0x7feeee1fb1d0: 166)
at /home/komat/.mozbuild/sysroot-x86_64-linux-gnu/usr/lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/std_function.h:301
#7 0x00007fef03a9e788 in std::function<mozilla::ShmemBuffer (unsigned long)>::operator()(unsigned long) const (this=0x7feeee1fb670, __args=166)
at /home/komat/.mozbuild/sysroot-x86_64-linux-gnu/usr/lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/std_function.h:706
#8 0x00007fef03a9e67a in mozilla::RemoteArrayOfByteBuffer::AllocateShmem(unsigned long, std::function<mozilla::ShmemBuffer (unsigned long)>&)
(this=0x7feeee1fb4c0, aSize=166, aAllocator=...) at /raid/src/dom/media/ipc/RemoteMediaData.cpp:18
#9 0x00007fef03aa0077 in mozilla::RemoteArrayOfByteBuffer::RemoteArrayOfByteBuffer<unsigned char>(nsTArray<mozilla::AlignedBuffer<unsigned char, 32> > const&, std::function<mozilla::ShmemBuffer (unsigned long)>&) (this=0x7feeee1fb4c0, aArray=const nsTArray<mozilla::AlignedBuffer<unsigned char, 32> > & = {...}, aAllocator=...) at /raid/src/dom/media/ipc/RemoteMediaData.h:126
#10 0x00007fef03a9fa88 in mozilla::ArrayOfRemoteMediaRawData::Fill(nsTArray<RefPtr<mozilla::MediaRawData> > const&, std::function<mozilla::ShmemBuffer (unsigned long)>&&)
(this=0x7feee2fcc660, aData=const nsTArray<RefPtr<mozilla::MediaRawData> > & = {...}, aAllocator=...) at /raid/src/dom/media/ipc/RemoteMediaData.cpp:155
#11 0x00007fef03a70121 in mozilla::RemoteDecoderChild::Decode(nsTArray<RefPtr<mozilla::MediaRawData> > const&)
(this=0x7feee2fd5740, aSamples=const nsTArray<RefPtr<mozilla::MediaRawData> > & = {...}) at /raid/src/dom/media/ipc/RemoteDecoderChild.cpp:122
#12 0x00007fef03aac418 in mozilla::RemoteMediaDataDecoder::Decode(mozilla::MediaRawData*)::$_5::operator()() const (this=0x7feeed862880)
at /raid/src/dom/media/ipc/RemoteMediaDataDecoder.cpp:66

It leads to video decode failure if a new decoder is created.

Summary: When video decoder is restarted, audio decoder fails → [RDD] When video decoder is restarted, audio decoder fails
Blocks: RDD

If RDD process crashes IPDLActor is destroyed for all RemoteDecoderChild instances used by RDD.
If we want to restart RDD decoder we need to recreate both audio & video decoders.

Depends on D141961

Attachment #9269215 - Attachment is obsolete: true

This bug is a special case where audio decoder is created ok but video decoder crashes in RemoteDecoderChild::Init() - that matches recent crashes due to sandbox.

In such case RemoteDecoderChild::HandleRejectionError() is called for video decoder only. Audio decoder gets
RemoteDecoderChild::ActorDestroy(), RemoteDecoderChild::IPDLActorDestroyed() calls but it's not rejected, only CanSend() is false and thus it's broken.

Attachment #9269216 - Attachment description: Bug 1761217 If RDD process crashes and new decoder is created, recreate both audio&video decoders r?alwu → Bug 1761217 When remote decoder process crashes, track that and reject any following decode requests r?alwu
Pushed by stransky@redhat.com: https://hg.mozilla.org/integration/autoland/rev/11e57a388f39 When remote decoder process crashes, track that and reject any following decode requests r=alwu https://hg.mozilla.org/integration/autoland/rev/66d42af14532 Log track type in MediaFormatReader r=alwu
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 100 Branch
Crash Signature: [@ av_buffer_ref]
Crash Signature: [@ av_buffer_ref]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: