Closed Bug 1046341 Opened 10 years ago Closed 10 years ago

[B2G][Camera][Gecko] Camera initialization failure does not release ownership

Categories

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

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(blocking-b2g:1.4+, b2g-v1.3 wontfix, b2g-v1.3T wontfix, b2g-v1.4 fixed, b2g-v2.0 fixed, b2g-v2.1 fixed)

RESOLVED FIXED
2.1 S1 (1aug)
blocking-b2g 1.4+
Tracking Status
b2g-v1.3 --- wontfix
b2g-v1.3T --- wontfix
b2g-v1.4 --- fixed
b2g-v2.0 --- fixed
b2g-v2.1 --- fixed

People

(Reporter: aosmond, Assigned: aosmond)

References

Details

Attachments

(2 files, 2 obsolete files)

If the camera initialization fails, we do not release the camera ownership, hence subsequent attempts will all fail due to their already being an owner for the camera.
Assignee: nobody → aosmond
Status: NEW → ASSIGNED
[Blocking Requested - why for this release]: this bug was introduced way back in bug 909542. A weakness in the failure-case tests allowed it to go undetected. Failure to fix could result in the Camera app not being able to access the camera hardware (though, practically, killing the Camera and reopening it would fix the issue).
Blocks: 909542
blocking-b2g: --- → 1.4?
Attached patch bug1046341.patch, v1 (obsolete) — Splinter Review
Attachment #8465060 - Flags: review?(mhabicher)
Comment on attachment 8465060 [details] [diff] [review]
bug1046341.patch, v1

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

r+ with comments addressed. Thanks, Andrew!

::: dom/camera/test/test_camera_hardware_init_failure.html
@@ +29,5 @@
>  
> +var tests = [
> +  {
> +    name: "init-failure",
> +    key: "init-failure", 

nit: extra whitespace and end of line!

@@ +44,5 @@
> +      info("Running test: init-failure");
> +      navigator.mozCameras.getCamera(whichCamera, initialConfig, onSuccess, onError);
> +    }
> +  },
> +  {

Please add a comment here that explicitly states the 'init-success' test MUST follow the 'init-failure' one.
Attachment #8465060 - Flags: review?(mhabicher) → review+
Attached patch bug1046341.patch, 1.1 (obsolete) — Splinter Review
Fix nits.

try: https://tbpl.mozilla.org/?tree=Try&rev=6c179696751e
Attachment #8465060 - Attachment is obsolete: true
Attachment #8465109 - Flags: review+
Blocking because of impact mentioned in comment 1
blocking-b2g: 1.4? → 1.4+
Keywords: checkin-needed
sorry had to backout this change for test failures like https://tbpl.mozilla.org/php/getParsedLog.php?id=44957206&tree=B2g-Inbound
Keywords: checkin-needed
Target Milestone: --- → 2.1 S1 (1aug)
https://hg.mozilla.org/mozilla-central/rev/bc8e33fd7a39
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
https://hg.mozilla.org/releases/mozilla-b2g30_v1_4/rev/db09e41be6b3

Note that per the recent rule change announced in dev-gaia, 1.4 blockers don't have auto-approval to land on v2.0. Please nominate this patch for b2g32 uplift if you feel that it needs to land there as well. Sorry for the inconvenience :(
Flags: needinfo?(mhabicher)
Comment on attachment 8465601 [details] [diff] [review]
bug1046341.patch, v1.2

NOTE: This flag is now for security issues only. Please see https://wiki.mozilla.org/Release_Management/B2G_Landing to better understand the B2G approval process and landings.

[Approval Request Comment]
Bug caused by (feature/regressing bug #): improper failure case handling.
User impact if declined: on initialization error, camera hardware may remain open in an undefined state; to be cleared may require, at best, closing the app--at worst, rebooting the phone.
Testing completed: automated test (included in patch) was created to catch this error, then code was updated to fix the failing automated test; patch passes on tbpl.
Risk to taking this patch (and alternatives if risky): trivial to non-existant.
String or UUID changes made by this patch: none.
Attachment #8465601 - Flags: approval-mozilla-b2g32?
Flags: needinfo?(mhabicher)
P.S. RyanVM, I pre-emptively checked that the patch applies cleanly to 2.0, and it does, so you should be good to go if/when a=2.0+ arrives.
Hmm, I just ran the failing test 1000x locally (by tweaking the test script) and it entirely passes.
Flags: needinfo?(mhabicher)
Patch for b2g30_v1_4, which is missing a small fix to handle null values from Gonk that was added to 2.0+ in bug 981047.
Attachment #8465601 - Flags: approval-mozilla-b2g32? → approval-mozilla-b2g32+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: