Closed Bug 820069 Opened 12 years ago Closed 12 years ago

segfault in AudioChannelAgent::NotifyAudioChannelStateChanged

Categories

(Core :: Audio/Video, defect)

ARM
Gonk (Firefox OS)
defect
Not set
critical

Tracking

()

RESOLVED DUPLICATE of bug 819275
blocking-basecamp +

People

(Reporter: vlad, Unassigned)

References

Details

Running CTR on a Unagi device with a dev build (source from 7-Dec), I get a segfault once you complete the first level at: #0 0x4078f0b2 in mozilla::dom::AudioChannelAgent::NotifyAudioChannelStateChanged (this=<value optimized out>) at /home/vladimir/proj/b2g/b2g/gecko/dom/audiochannel/AudioChannelAgent.cpp:113 #1 0x4078ea3e in NotifyEnumerator (aAgent=0x0, aType=mozilla::dom::AUDIO_CHANNEL_NORMAL, aData=0x0) at /home/vladimir/proj/b2g/b2g/gecko/dom/audiochannel/AudioChannelService.cpp:220 #2 0x4078ea98 in nsBaseHashtable<nsPtrHashKey<mozilla::dom::AudioChannelAgent>, mozilla::dom::AudioChannelType, mozilla::dom::AudioChannelType>::s_EnumReadStub ( table=<value optimized out>, hdr=<value optimized out>, number=<value optimized out>, arg=0x413720a0) at ../../dist/include/nsBaseHashtable.h:400 #3 0x40b997fe in PL_DHashTableEnumerate (table=0x42651918, etor=0x4078ea8d <nsBaseHashtable<nsPtrHashKey<mozilla::dom::AudioChannelAgent>, mozilla::dom::AudioChannelType, mozilla::dom::AudioChannelType>::s_EnumReadStub(PLDHashTable*, PLDHashEntryHdr*, unsigned int, void*)>, arg=<value optimized out>) at /home/vladimir/proj/b2g/b2g/objdir-gecko/xpcom/build/pldhash.cpp:717 #4 0x4078eada in nsBaseHashtable<nsPtrHashKey<mozilla::dom::AudioChannelAgent>, mozilla::dom::AudioChannelType, mozilla::dom::AudioChannelType>::EnumerateRead ( this=<value optimized out>) at ../../dist/include/nsBaseHashtable.h:190 #5 mozilla::dom::AudioChannelService::Notify (this=<value optimized out>) at /home/vladimir/proj/b2g/b2g/gecko/dom/audiochannel/AudioChannelService.cpp:231 #6 0x40a99c6e in mozilla::dom::ContentChild::RecvAudioChannelNotify (this=<value optimized out>) at /home/vladimir/proj/b2g/b2g/gecko/dom/ipc/ContentChild.cpp:441 #7 0x40b0fe7e in mozilla::dom::PContentChild::OnMessageReceived (this=0x4191b618, __msg=...) at /home/vladimir/proj/b2g/b2g/objdir-gecko/ipc/ipdl/PContentChild.cpp:2672 with: (gdb) l 108 109 void AudioChannelAgent::NotifyAudioChannelStateChanged() 110 { 111 if (mCallback != nullptr) { 112 mCallback->CanPlayChanged(!gAudioChannelService->GetMuted(static_cast<AudioChannelType>(mAudioChannelType), 113 !mVisible)); 114 } 115 } 116 (gdb) p gAudioChannelService $1 = {mRawPtr = 0x0}
We set the service pointer to null in the destructor of AudioChannelAgent, but AudioChannelAgent is not a singleton. This makes no sense.
Blocks: 815069
Also, we're using a static constructor which is bad.
And.. the bug has been fixed already!
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → DUPLICATE
(In reply to Ehsan Akhgari [:ehsan] from comment #1) > We set the service pointer to null in the destructor of AudioChannelAgent, > but AudioChannelAgent is not a singleton. This makes no sense. Agent is not designed as singleton and it will be created for every media elements. And actually the singleton service is designed as Audio Channel Service in chrome process only.
Right. FWIW, your fix makes sense to me.
Dupe was a blocker.
blocking-basecamp: ? → +
You need to log in before you can comment on or make changes to this bug.