Closed Bug 866093 Opened 11 years ago Closed 11 years ago

application crashed [@ webrtc::VoEExternalMediaImpl::SetExternalRecordingStatus(bool)]

Categories

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

ARM
Android
defect
Not set
critical

Tracking

()

RESOLVED FIXED
mozilla23

People

(Reporter: gcp, Assigned: gcp)

References

Details

(Keywords: crash, Whiteboard: [native-crash][blocking-webrtc-][android-gum+][qa-])

Crash Data

Attachments

(2 files)

Crash in the Android 2.2 JNI fallback path during mochitests:

webrtc::VoEExternalMediaImpl::SetExternalRecordingStatus (this=0x81a3b0b4, enable=<optimized out>)
    at /home/morbo/hg/mozilla-central/media/webrtc/trunk/webrtc/voice_engine/voe_external_media_impl.cc:151
151	    if (shared_->audio_device()->Recording())
(gdb) bt
#0  webrtc::VoEExternalMediaImpl::SetExternalRecordingStatus (this=0x81a3b0b4, enable=<optimized out>)
    at /home/morbo/hg/mozilla-central/media/webrtc/trunk/webrtc/voice_engine/voe_external_media_impl.cc:151
#1  0x7b2cdc2a in mozilla::WebrtcAudioConduit::~WebrtcAudioConduit (this=0x80e63e20, __in_chrg=<optimized out>)
    at /home/morbo/hg/mozilla-central/media/webrtc/signaling/src/media-conduit/AudioConduit.cpp:70
#2  0x7b2cdd26 in mozilla::WebrtcAudioConduit::~WebrtcAudioConduit (this=0x80e63e20, __in_chrg=<optimized out>)
    at /home/morbo/hg/mozilla-central/media/webrtc/signaling/src/media-conduit/AudioConduit.cpp:121
#3  0x7b2cda3a in mozilla::AudioSessionConduit::Create (aOther=0x0) at /home/morbo/hg/mozilla-central/media/webrtc/signaling/src/media-conduit/AudioConduit.cpp:41
#4  0x7b2d7fa6 in vcmRxStartICE_m (mcap_id=<optimized out>, group_id=<optimized out>, stream_id=<optimized out>, level=1, pc_stream_id=0, pc_track_id=1, 
    call_handle=65537, peerconnection=0x805d4108 "0b0138f4e976f576", num_payloads=1, payloads=0x80ef9e20, fingerprint_alg=0x7c2f2898 "sha-256", 
    fingerprint=0x7c2f28a2 "1F:B2:4B:A0:28:8E:9A:46:25:9C:23:39:8B:66:7B:68:DC:3C:6D:26:71:8F:5C:6D:3F:0C:42:5B:FF:4E:F2:C6", attrs=0x72d87a28)
    at /home/morbo/hg/mozilla-central/media/webrtc/signaling/src/media/VcmSIPCCBinding.cpp:1369
#5  0x7b2d300e in mozilla::runnable_args_nm_13_ret<int (*)(unsigned short, unsigned short, unsigned short, int, int, int, unsigned int, char const*, int, vcm_payload_info_t const*, char const*, char const*, vcm_attrs_t_*), unsigned short, unsigned short, unsigned short, int, int, int, unsigned int, char const*, int, vcm_payload_info_t const*, char const*, char const*, vcm_attrs_t_*, int>::Run (this=<optimized out>)
    at /home/morbo/hg/mozilla-central/media/webrtc/signaling/../../../media/mtransport/runnable_utils_generated.h:1318
#6  0x7b2d330c in mozilla::SyncRunnable::Run (this=0x80ef6d00) at ../../../../dist/include/mozilla/SyncRunnable.h:66
#7  0x7aed5fe2 in nsThread::ProcessNextEvent (this=0x75237240, mayWait=<optimized out>, result=0x753ff887)
    at /home/morbo/hg/mozilla-central/xpcom/threads/nsThread.cpp:627
#8  0x7aea077a in NS_ProcessNextEvent (thread=0x75237240, mayWait=<optimized out>) at /home/morbo/hg/mozilla-central/objdir-android/xpcom/build/nsThreadUtils.cpp:238
#9  0x7ac259c4 in mozilla::ipc::MessagePump::Run (this=0x75226d60, aDelegate=0x7526a0c0) at /home/morbo/hg/mozilla-central/ipc/glue/MessagePump.cpp:82
#10 0x7af16a46 in MessageLoop::RunInternal (this=0x7526a0c0) at /home/morbo/hg/mozilla-central/ipc/chromium/src/base/message_loop.cc:219
#11 0x7af16aa4 in RunHandler (this=0x7526a0c0) at /home/morbo/hg/mozilla-central/ipc/chromium/src/base/message_loop.cc:212
#12 MessageLoop::Run (this=0x7526a0c0) at /home/morbo/hg/mozilla-central/ipc/chromium/src/base/message_loop.cc:186
#13 0x7ab6c30e in nsBaseAppShell::Run (this=0x7523bc00) at /home/morbo/hg/mozilla-central/widget/xpwidgets/nsBaseAppShell.cpp:163
#14 0x7aa6910a in nsAppStartup::Run (this=0x78435070) at /home/morbo/hg/mozilla-central/toolkit/components/startup/nsAppStartup.cpp:289
#15 0x7a0ce05e in XREMain::XRE_mainRun (this=0x753ffae4) at /home/morbo/hg/mozilla-central/toolkit/xre/nsAppRunner.cpp:3878
#16 0x7a0ce2e2 in XREMain::XRE_main (this=0x753ffae4, argc=<optimized out>, argv=0x75227188, aAppData=<optimized out>)
    at /home/morbo/hg/mozilla-central/toolkit/xre/nsAppRunner.cpp:3945
#17 0x7a0ce496 in XRE_main (argc=12, argv=0x75227188, aAppData=0x6ffd5a58, aFlags=<optimized out>) at /home/morbo/hg/mozilla-central/toolkit/xre/nsAppRunner.cpp:4146
#18 0x7a0d3fe8 in GeckoStart (data=0x7524f0b0, appData=0x6ffd5a58) at /home/morbo/hg/mozilla-central/toolkit/xre/nsAndroidStartup.cpp:73
#19 0x6ffbbec0 in Java_org_mozilla_gecko_mozglue_GeckoLoader_nativeRun (jenv=0x40199ec0, jc=<optimized out>, jargs=0x21600005)
    at /home/morbo/hg/mozilla-central/mozglue/android/APKOpen.cpp:345
#20 0x40594294 in dvmPlatformInvoke () from /home/morbo/git/android-gdb/moz-gdb/lib/00658c727e962a43/system/lib/libdvm.so
#21 0x405c3414 in dvmCallJNIMethod(unsigned int const*, JValue*, Method const*, Thread*) ()
   from /home/morbo/git/android-gdb/moz-gdb/lib/00658c727e962a43/system/lib/libdvm.so
#22 0x405c5570 in dvmResolveNativeMethod(unsigned int const*, JValue*, Method const*, Thread*) ()
   from /home/morbo/git/android-gdb/moz-gdb/lib/00658c727e962a43/system/lib/libdvm.so
#23 0x4059d6a4 in dvmJitToInterpNoChain () from /home/morbo/git/android-gdb/moz-gdb/lib/00658c727e962a43/system/lib/libdvm.so
#24 0x4059d6a4 in dvmJitToInterpNoChain () from /home/morbo/git/android-gdb/moz-gdb/lib/00658c727e962a43/system/lib/libdvm.so
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
Severity: normal → critical
Crash Signature: [@ webrtc::VoEExternalMediaImpl::SetExternalRecordingStatus(bool)]
Keywords: crash
Whiteboard: [native-crash]
Whiteboard: [native-crash] → [native-crash][blocking-webrtc-][android-gum+]
The underlying cause is that there is a bug in the non-OpenSLES JNI fallback path, and that we don't set the Android objects that the JNI path needs. I've got fixes for those, but something which is nailing me right now is this, which happens during the peerconnection mochitests:

#3  0x7ca89300 in webrtc::AudioDeviceAndroidJni::Init (this=0x828c7000)
    at /home/morbo/hg/mozilla-central/media/webrtc/trunk/webrtc/modules/audio_device/android/audio_device_jni_android.cc:231
#4  0x7ca83334 in webrtc::AudioDeviceModuleImpl::Init (this=0x83743000)
    at /home/morbo/hg/mozilla-central/media/webrtc/trunk/webrtc/modules/audio_device/audio_device_impl.cc:624
#5  0x7ca7455e in webrtc::VoEBaseImpl::Init (this=0x827550fc, external_adm=<optimized out>)
    at /home/morbo/hg/mozilla-central/media/webrtc/trunk/webrtc/voice_engine/voe_base_impl.cc:407
#6  0x7cacf9d4 in mozilla::WebrtcAudioConduit::Init (this=0x829e5460, other=0x0)
    at /home/morbo/hg/mozilla-central/media/webrtc/signaling/src/media-conduit/AudioConduit.cpp:196
#7  0x7cacfcf6 in mozilla::AudioSessionConduit::Create (aOther=0x0)
    at /home/morbo/hg/mozilla-central/media/webrtc/signaling/src/media-conduit/AudioConduit.cpp:38
#8  0x7cae03cc in vcmRxStartICE_m (mcap_id=<optimized out>, group_id=<optimized out>, stream_id=<optimized out>, level=1, 
    pc_stream_id=0, pc_track_id=1, call_handle=65537, peerconnection=0x828b5108 "193dd34fc349167c", num_payloads=1, 
    payloads=0x828d86f0, fingerprint_alg=0x7df685ac <gsmsdp_free_media_chunk+34780> "sha-256", 
    fingerprint=0x7df685b6 <gsmsdp_free_media_chunk+34790> "8A:89:97:87:FF:D8:5D:22:BA:B5:5E:5A:28:82:9C:28:FD:A9:BA:15:C3:F1:E0:4F:75:A2:18:FB:8C:11:3C:98", attrs=0x72ee0a30)
    at /home/morbo/hg/mozilla-central/media/webrtc/signaling/src/media/VcmSIPCCBinding.cpp:1369

This path can be reached without EnumerateAudioDevices being called. That's a bit of a pain, because the video objects *are* set up in EnumerateVideoDevices so we can't do the same for audio.
Some fairly simple logic errors in the fallback path.
Attachment #744084 - Flags: review?(rjesup)
1) Make sure we compile the support Java classes for the JNI backend.
2) Switch to our thread-oblivious FindClass replacement.
3) Extract the GetContext/GetJVM JNI functions so they can be called inside MOZILLA_INTERNAL_API functions (Audio/VideoConduit).
4) Make sure the Android objects are set in all callpaths.

This makes Android mochitests pass on 2.2 and 4.0:
https://tbpl.mozilla.org/?tree=Try&rev=286bad8d4740
Attachment #744085 - Flags: review?(rjesup)
Attachment #744085 - Flags: feedback?(blassey.bugs)
Attachment #744085 - Flags: review?(rjesup) → review+
Attachment #744084 - Flags: review?(rjesup) → review+
Attachment #744085 - Flags: feedback?(blassey.bugs) → feedback+
https://hg.mozilla.org/mozilla-central/rev/80f36848bcbe
https://hg.mozilla.org/mozilla-central/rev/54c41fa92da5
https://hg.mozilla.org/mozilla-central/rev/e3e3e669f746
Assignee: nobody → gpascutto
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla23
Whiteboard: [native-crash][blocking-webrtc-][android-gum+] → [native-crash][blocking-webrtc-][android-gum+][qa-]
Flags: in-testsuite+
You need to log in before you can comment on or make changes to this bug.