Closed Bug 1103782 Opened 11 years ago Closed 11 years ago

Emulator camera HAL is deadlock at takePitcure() and break /tests/dom/media/test/test_imagecapture.html

Categories

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

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla37

People

(Reporter: ayang, Assigned: ayang)

References

Details

Attachments

(1 file, 2 obsolete files)

Apply patches from bug 938034. Run /tests/dom/media/test/test_imagecapture.html on b2g. Deadlock happens. #0 __futex_syscall3 () at bionic/libc/arch-arm/bionic/atomics_arm.S:183 #1 0x4005558c in __pthread_cond_timedwait_relative (cond=0xfe40, mutex=0xfe3c, reltime=0x0) at bionic/libc/bionic/pthread.c:1477 #2 0x40055640 in __pthread_cond_timedwait (cond=0xfe40, mutex=0xfe3c, abstime=0x0, clock=0) at bionic/libc/bionic/pthread.c:1500 #3 0x400f3578 in android::Condition::wait (this=0xfe30) at frameworks/base/include/utils/threads.h:455 #4 android::Thread::requestExitAndWait (this=0xfe30) at frameworks/base/libs/utils/Threads.cpp:884 #5 0x40ca9fc0 in android::EmulatedCameraDevice::WorkerThread::stopThread (this=0xfe30) at development/tools/emulator/system/camera/EmulatedCameraDevice.cpp:303 #6 0x40caa0be in android::EmulatedCameraDevice::stopWorkerThread (this=0xfdb0) at development/tools/emulator/system/camera/EmulatedCameraDevice.cpp:229 #7 0x40ca9c46 in android::EmulatedCameraDevice::stopDeliveringFrames (this=0xfdb0) at development/tools/emulator/system/camera/EmulatedCameraDevice.cpp:101 #8 0x40ca90f4 in android::EmulatedCamera::doStopPreview (this=0xfce8) at development/tools/emulator/system/camera/EmulatedCamera.cpp:593 #9 0x40ca9648 in android::EmulatedCamera::takePicture (this=0xfce8) at development/tools/emulator/system/camera/EmulatedCamera.cpp:355 #10 0x40ca8c34 in android::EmulatedCamera::take_picture (dev=<value optimized out>) at development/tools/emulator/system/camera/EmulatedCamera.cpp:816 #11 0x405ba65a in android::CameraHardwareInterface::takePicture (this=0x14418, msgType=258) at frameworks/base/services/camera/libcameraservice/CameraHardwareInterface.h:363 #12 android::CameraService::Client::takePicture (this=0x14418, msgType=258) at frameworks/base/services/camera/libcameraservice/CameraService.cpp:789 #13 0x405685f4 in android::BnCamera::onTransact (this=0x14418, code=9, data=..., reply=0x412bcdc0, flags=16) at frameworks/base/libs/camera/ICamera.cpp:370 #14 0x40131ec2 in android::BBinder::transact (this=0x1441c, code=9, data=..., reply=0x412bcdc0, flags=16) at frameworks/base/libs/binder/Binder.cpp:107 #15 0x40135208 in android::IPCThreadState::executeCommand (this=0x101f8, cmd=<value optimized out>) at frameworks/base/libs/binder/IPCThreadState.cpp:1033 #16 0x401353e6 in android::IPCThreadState::joinThreadPool (this=0x101f8, isMain=false) at frameworks/base/libs/binder/IPCThreadState.cpp:468 #17 0x4013a688 in android::PoolThread::threadLoop (this=0x14fa8) at frameworks/base/libs/binder/ProcessState.cpp:67 #18 0x400f3180 in android::Thread::_threadLoop (user=<value optimized out>) at frameworks/base/libs/utils/Threads.cpp:834 #19 0x400f37c6 in thread_data_t::trampoline (t=<value optimized out>) at frameworks/base/libs/utils/Threads.cpp:127 #20 0x40055e4c in __thread_entry (func=0x400f3731 <thread_data_t::trampoline(thread_data_t const*)>, arg=0x14fe0, tls=<value optimized out>) at bionic/libc/bionic/pthread.c:217 #21 0x4005599c in pthread_create (thread_out=<value optimized out>, attr=0x40fbccf4, start_routine=0x400f3731 <thread_data_t::trampoline(thread_data_t const*)>, arg=0x14fe0) at bionic/libc/bionic/pthread.c:357 #0 nanosleep () at bionic/libc/arch-arm/syscalls/nanosleep.S:10 #1 0x4005cc5e in usleep (usec=<value optimized out>) at bionic/libc/unistd/usleep.c:46 #2 0x405ba13c in android::CameraService::Client::lockIfMessageWanted (this=0x14418, msgType=32) at frameworks/base/services/camera/libcameraservice/CameraService.cpp:908 #3 0x405bc244 in android::CameraService::Client::dataCallbackTimestamp (timestamp=287063703704, msgType=32, dataPtr=..., user=0x0) at frameworks/base/services/camera/libcameraservice/CameraService.cpp:1022 #4 0x405b9f6c in android::CameraHardwareInterface::__data_cb_timestamp (timestamp=287063703704, msg_type=32, data=<value optimized out>, index=0, user=0x14390) at frameworks/base/services/camera/libcameraservice/CameraHardwareInterface.h:486 #5 0x40cac0e0 in android::CallbackNotifier::onNextFrameAvailable (this=0xfd70, frame=0x412bd008, timestamp=287063703704, camera_dev=0xfdb0) at development/tools/emulator/system/camera/CallbackNotifier.cpp:216 #6 0x40ca98d4 in android::EmulatedCamera::onNextFrameAvailable (this=0xfce8, frame=0x412bd008, timestamp=287063703704, camera_dev=0xfdb0) at development/tools/emulator/system/camera/EmulatedCamera.cpp:160 #7 0x40cab29c in android::EmulatedFakeCameraDevice::inWorkerThread (this=0xfdb0) at development/tools/emulator/system/camera/EmulatedFakeCameraDevice.cpp:232 #8 0x40ca9bfc in android::EmulatedCameraDevice::WorkerThread::threadLoop (this=0xfe30) at development/tools/emulator/system/camera/EmulatedCameraDevice.h:401 #9 0x400f3180 in android::Thread::_threadLoop (user=<value optimized out>) at frameworks/base/libs/utils/Threads.cpp:834 #10 0x400f37c6 in thread_data_t::trampoline (t=<value optimized out>) at frameworks/base/libs/utils/Threads.cpp:127 #11 0x40055e4c in __thread_entry (func=0x400f3731 <thread_data_t::trampoline(thread_data_t const*)>, arg=0x15a40, tls=<value optimized out>) at bionic/libc/bionic/pthread.c:217 #12 0x4005599c in pthread_create (thread_out=<value optimized out>, attr=0xbeb0d9bc, start_routine=0x400f3731 <thread_data_t::trampoline(thread_data_t const*)>, arg=0x15a40) at bionic/libc/bionic/pthread.c:357
Thread A: takePicture() holds the Mutex mLock and wait for thread B (WorkerThread) stop. Thread B: dispatch a new frame via android::CameraService::Client::dataCallbackTimestamp which will wait for mLock. Solution here is not to stop WorkerThread when takePhoto(). https://github.com/alfredoyang/android-development/commit/6425ca937d7f3bd6fcec45b1e15f81caf55eea85 Testing on try now. https://treeherder.mozilla.org/ui/#/jobs?repo=try&revision=a1583dd341a6
Summary: Emulator camera HAL is deadlock at takePitcure(). → Emulator camera HAL is deadlock at takePitcure() and break /tests/dom/media/test/test_imagecapture.html
Try result looks good.
Attachment #8528838 - Flags: review?(mhabicher)
Comment on attachment 8528838 [details] [review] Don't start/stop worker thread at TakePhoto when recording is on. r+ with comment on github addressed.
Attachment #8528838 - Flags: review?(mhabicher) → review+
Attachment #8528838 - Attachment is obsolete: true
Attachment #8530177 - Flags: review+
Update comments. Hi sheriff, please help to check in the pull request. Thanks.
Keywords: checkin-needed
Attachment #8530177 - Attachment mime type: text/plain → text/x-github-pull-request
Attachment #8530177 - Attachment is obsolete: true
Attachment #8530178 - Flags: review+
Status: NEW → RESOLVED
Closed: 11 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → mozilla37
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: