Closed Bug 1131298 Opened 9 years ago Closed 9 years ago

[Camera][Gonk][Shinano] bad/double/corrupted free in ~MediaPlayer when closing a camera instance, mediaserver crashes

Categories

(Firefox OS Graveyard :: Gaia::Camera, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: mikeh, Assigned: mikeh)

References

Details

Attachments

(4 files, 1 obsolete file)

STR:
1. open Camera app
2. tap icon in upper-left to switch to user-facing camera

Expected: user-facing camera should open.

Observed: error "Camera Unavailable: The camera is in use by another app."

This also happens when switching from the user-facing to the away-facing camera. Once the error message appears, returning to the Homescreen and then returing to the Camera app will open the requested camera without error.
mediaserver also crashes when CameraService Client instance is destroyed as a result of the Camera app crashing. The stack in this attachment is slightly different.
Attachment #8561680 - Attachment description: logcat of SIGSEGV → logcat of mediaserver SIGSEGV when camera instance is closed
See Also: → 1131329
'this=0x0' sure looks suspicious:

#5  android::CameraService::releaseSound (this=0x0) at frameworks/av/services/camera/libcameraservice/CameraService.cpp:897
With this patch:
https://github.com/mozilla-b2g/device-shinano/commit/e49283b7f7dc708d8fa858d1f0e190dd092f364a

...mediaserver still crashes, but restarts so quickly that it is effectively hidden, and you can switch between front and back cameras. The logcat tells the real story, however.
Assignee: nobody → mhabicher
Comment on attachment 8561762 [details] [diff] [review]
CameraService.cpp patch to fix crash

Review of attachment 8561762 [details] [diff] [review]:
-----------------------------------------------------------------

I think this can be simplified to simply returning early and letting the compiler remove the dead code.
Attachment #8561762 - Flags: feedback?(mwu) → feedback+
Simplified as requested. I'll leave it to you to land.
Attachment #8561762 - Attachment is obsolete: true
Attachment #8563582 - Flags: review?(mwu)
Attachment #8563582 - Flags: review?(mwu) → review+
Landed. frameworks/av was forked to land this.

https://github.com/mozilla-b2g/platform_frameworks_av/commit/a920312eb6299b6cc11f7136254c4b0ba7a663be
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: