Closed Bug 977372 Opened 10 years ago Closed 10 years ago

[Camera][Gecko] camera is holding a file descriptor open even after video recording has stopped

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 fixed, b2g-v1.4 fixed)

RESOLVED FIXED
1.4 S3 (14mar)
blocking-b2g 1.4+
Tracking Status
b2g-v1.3 --- wontfix
b2g-v1.3T --- fixed
b2g-v1.4 --- fixed

People

(Reporter: dhylands, Assigned: dhylands)

References

Details

(Whiteboard: [fxos:media])

Attachments

(3 files, 2 obsolete files)

STR:
 - unplug USB cable
 - setup USB Mass Storage
 - start recording a video
 - stop recording the video
 - connect USB cable

The AutoMounter will try to share the sdcard, but it will fail due to open files. I see the following in logcat:

The following files are open under '/mnt/sdcard'                                                                               
  PID: 626 file: '/mnt/sdcard/1393458298451_tmp.3gp (deleted)' app: '' comm: 'b2g' exe: '/system/b2g/b2g'                      
  PID: 832 file: '/mnt/sdcard/1393458298451_tmp.3gp (deleted)' app: 'Camera' comm: 'Camera' exe: '/system/b2g/plugin-container'
  PID: 832 file: '/mnt/sdcard/1393458298451_tmp.3gp (deleted)' app: 'Camera' comm: 'Camera' exe: '/system/b2g/plugin-container'
UpdateState: Mounted volume sdcard has open files, not sharing or formatting
Blocks: 975597
Should this be marked as 1.4+ as it blocks a blocker?
Assignee: nobody → dhylands
blocking-b2g: --- → 1.4?
Target Milestone: --- → 1.4 S3 (14mar)
blocking-b2g: 1.4? → 1.4+
Attachment #8383425 - Flags: review?(mhabicher)
Whiteboard: [fxos:media]
Comment on attachment 8383425 [details] [diff] [review]
Close device storage file descriptor when finished with it.

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

::: dom/camera/GonkCameraControl.cpp
@@ +862,2 @@
>    int fd = aFileDescriptor->mFileDescriptor.PlatformHandle();
> +  ScopedClose autoClose(fd);

I didn't even notice this had been removed in the earlier changeset. My bad. :(
Attachment #8383425 - Flags: review?(mhabicher) → review+
(In reply to Mike Habicher [:mikeh] from comment #3)
> Comment on attachment 8383425 [details] [diff] [review]
> Close device storage file descriptor when finished with it.
> 
> Review of attachment 8383425 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> ::: dom/camera/GonkCameraControl.cpp
> @@ +862,2 @@
> >    int fd = aFileDescriptor->mFileDescriptor.PlatformHandle();
> > +  ScopedClose autoClose(fd);
> 
> I didn't even notice this had been removed in the earlier changeset. My bad.
> :(

I'm confused by your comment.
(In reply to Dave Hylands [:dhylands] from comment #4)
> 
> I'm confused by your comment.

Sorry--I reviewed your earlier changeset on this file where the scoped-close went away, and didn't notice.
(In reply to Mike Habicher [:mikeh] from comment #5)
> (In reply to Dave Hylands [:dhylands] from comment #4)
> > 
> > I'm confused by your comment.
> 
> Sorry--I reviewed your earlier changeset on this file where the scoped-close
> went away, and didn't notice.

Ahh - Your comment makes more sense now (I wasn't thinking outside of this bug and this was the only changeset I submited). Although that scope close going away was for a file the camera was opening, so it was slighly different. Interesting that another one wound up in the same spot :)
https://hg.mozilla.org/integration/b2g-inbound/rev/46841ca6d96a

Sigh the missing #include somehow wound up in a different patchset
Backed out again due to windows bustage
https://hg.mozilla.org/integration/b2g-inbound/rev/17a26150a639
Since this patch is totally different from the r+'d one, putting this one up for review again.
Attachment #8384916 - Flags: review?(mhabicher)
Attachment #8383425 - Attachment is obsolete: true
Attachment #8384916 - Attachment description: bug-977372.patchClose device storage file descriptor when finished with it. v2 → Close device storage file descriptor when finished with it. v2
Comment on attachment 8384916 [details] [diff] [review]
Close device storage file descriptor when finished with it. v2

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

LGTM.
Attachment #8384916 - Flags: review?(mhabicher) → review+
Attachment #8384911 - Flags: review?(bent.mozilla) → review+
Added if test to verify that the file handle is valid before trying to use CloseFileRunnable.

Carrying r+
Attachment #8384916 - Attachment is obsolete: true
Flags: needinfo?(ying.xu)
Flags: needinfo?(lianxiang.zhou)
Flags: needinfo?(Dafeng.Xu)
Blocks: 1028877
Comment on attachment 8384911 [details] [diff] [review]
Pt 1 - Remove main thread assert so CloseFileRunnable can be used from non-main threads.

This bug blocks 1028877 which is marked 1.3T+, so I'm requesting for approval on this patch to be uplifted to 1.3T

I don't see a specific approval request for 1.3T

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 #): 901498 (which was uplifted to 1.3T)
User impact if declined: See bug 9775597 and 1028877
Testing completed: Manual testing (since testing involves unplugging USB which is currently not part of the automated tests)
Risk to taking this patch (and alternatives if risky): Low (since this has been on master for 3 months)
String or UUID changes made by this patch: none
Attachment #8384911 - Flags: approval-mozilla-b2g28?
Comment on attachment 8386834 [details] [diff] [review]
Pt 2 - Close device storage file descriptor when finished with it. v3

This bug blocks 1028877 which is marked 1.3T+, so I'm requesting for approval on this patch to be uplifted to 1.3T

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 #): 901498 (which was uplifted to 1.3T)
User impact if declined: See bug 9775597 and 1028877
Testing completed: Manual testing (since testing involves unplugging USB which is currently not part of the automated tests)
Risk to taking this patch (and alternatives if risky): Low (since this has been on master for 3 months)
String or UUID changes made by this patch: none
Attachment #8386834 - Flags: approval-mozilla-b2g28?
Adding needinfo for jcheng and bbajaj since this patch needs to be uplifted to 1.3T, but the flags don't seem to be present to do that.
Flags: needinfo?(jcheng)
Flags: needinfo?(bbajaj)
Attachment #8386834 - Flags: approval-mozilla-b2g28? → approval-mozilla-b2g28+
Attachment #8384911 - Flags: approval-mozilla-b2g28? → approval-mozilla-b2g28+
Flags: needinfo?(ying.xu)
Part 2 needs rebasing around bug 909542 not being on 1.3T.
Flags: needinfo?(jcheng)
Flags: needinfo?(dhylands)
Flags: needinfo?(bbajaj)
I was able to build for tarako with this patch, but I don't actually have a tarako, so I'm unable to test it.

I'd appreciate it if somebody could apply this patch and pt1 (About removing main thread assert)
Flags: needinfo?(dhylands)
Attachment #8386834 - Attachment description: Close device storage file descriptor when finished with it. v3 → Pt 2 - Close device storage file descriptor when finished with it. v3
Attachment #8384911 - Attachment description: Remove main thread assert so CloseFileRunnable can be used from non-main threads. → Pt 1 - Remove main thread assert so CloseFileRunnable can be used from non-main threads.
Attachment #8446831 - Attachment description: Pt 2 - Close device storage file descriptor when finished with it (v1.3t specific pattch) → Pt 2 - Close device storage file descriptor when finished with it (v1.3t specific patch)
Flags: needinfo?(Dafeng.Xu)
Flags: needinfo?(lianxiang.zhou)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: