Closed
Bug 828289
Opened 13 years ago
Closed 13 years ago
- Crash when sending camera app to foreground
Categories
(Core :: DOM: Device Interfaces, defect)
Tracking
()
RESOLVED
DUPLICATE
of bug 826829
| blocking-basecamp | - |
| Tracking | Status | |
|---|---|---|
| b2g18 | + | --- |
People
(Reporter: sotaro, Assigned: sotaro)
Details
(Keywords: crash, Whiteboard: [b2g-crash])
Attachments
(3 files)
This bug is created as part of Bug 826829. This handles a crash when changing camera app to foreground. Bug 826829 handles a cash when sending camera app to background.
The story to reproduce the crash is same as Bug 826829. It happens when I repeat [1][2] many times.
[1]. start Camera application. Wait until a camera preview becomes active.
[2]. push home button
| Assignee | ||
Updated•13 years ago
|
blocking-basecamp: --- → ?
| Assignee | ||
Comment 1•13 years ago
|
||
following is copied from Bug 826829.
[2] abort on re-starting preview
camera app stop preview correctly and try to start preview again.
There is a Image(GonkIOSurfaceImage) from last preview. And the Image references to a CameraGraphicBuffer.
When prevew starts, ImageContainer::SetCurrentImage() is called.
And within it, ImageContainerChild::SendImageAsync() is called and mActiveImage is replaced to new Image.
When mActiveImage is replaced, there is no refence to the GonkIOSurfaceImage from previous preview and the the GonkIOSurfaceImage is deleted.
During the destruction of the GonkIOSurfaceImage, CameraGraphicBuffer::Unlock() is called and Gralloc buffer is deleted.
After that on parent side, ImageContainerParent::RecvPublishImage() is called and send back previous image. But it is already deallocated on child side.
| Assignee | ||
Comment 2•13 years ago
|
||
following explains about the cause of the bug
- ImageContainer::SetCurrentImage() keeps a reference only to a current active image
- when rendering via ImageContainerChild, it is necessary that previous gralloc buffer neededs to be alive.
becuase previous gralloc buffer will be sent back to ImageContainerChild during next image rendering.
- In normal situation, rendering gralloc buffer is kept alive by GonkNativeWindow
- when camera app go back to background, GonkNativeWindow do not keep rendering gralloc buffer as alive
- when starting preview again, ImageContainer::SetCurrentImage() destroy preview image(previous gralloc buffer)
- ImageContainerChild might receive previous gralloc buffer after delete it
| Assignee | ||
Comment 3•13 years ago
|
||
By the patch, ImageContainer prevents previsous Image from de-allocated when rendering via ImageContainerChild.
Comment 4•13 years ago
|
||
Do we need to find a reviewer here?
Comment 5•13 years ago
|
||
Blocking for 1.0 not for basecamp.
blocking-basecamp: ? → -
tracking-b2g18:
--- → +
| Assignee | ||
Comment 6•13 years ago
|
||
I am going to ask Kan-Ru Chen to review.
| Assignee | ||
Updated•13 years ago
|
Attachment #699791 -
Flags: review?(kchen)
Updated•13 years ago
|
Comment 7•13 years ago
|
||
We need this to be fixed in order to fix bug 826829.
Updated•13 years ago
|
blocking-basecamp: - → ?
| Assignee | ||
Updated•13 years ago
|
Assignee: nobody → sotaro.ikeda.g
| Assignee | ||
Comment 8•13 years ago
|
||
attachment 699791 [details] [diff] [review] is going to keep gralloc buffer in ImageContainer. When applying it, unagi device becomes to faile to play H.264 video. When OMXCodec::freeBuffersOnPort() is called, all gralloc buffers needed to be within OMXCodec or GonkNativeWindow.
Comment 9•13 years ago
|
||
We'll definitely take a fix for these 3 related bugs so please don't stop working on them, but we won't hold the release for a camera app crasher that the user can easily work around.
blocking-basecamp: ? → -
Comment 10•13 years ago
|
||
Comment on attachment 699791 [details] [diff] [review]
Patch: ImageContainer keeps a previsous Image when rendering via ImageContainerChild
Review of attachment 699791 [details] [diff] [review]:
-----------------------------------------------------------------
We already hold the reference of the images here:
https://mxr.mozilla.org/mozilla-central/source/gfx/layers/ipc/ImageContainerChild.cpp#325
And by changing SendFlush() to sync call, we could prevent images being released before RecvReturnImage.
Attachment #699791 -
Flags: review?(kchen) → review-
| Assignee | ||
Comment 11•13 years ago
|
||
After changing SendFlush() to sync call, this abort is still happening. I am going to investingate why mImageQueue do not work here.
| Assignee | ||
Comment 12•13 years ago
|
||
| Assignee | ||
Comment 13•13 years ago
|
||
mikeh, I start to re-think about Part2. attachment 700516 [details] [diff] [review] affect very badly to H.264 video rendering. OMXCodec becomes to abort more often than before. I am going to think about to separate thread for ImageBridgeChild and ImageContainerChild.
When OMXCodec::freeBuffersOnPort() is called, all gralloc buffers needed to be within OMXCodec or GonkNativeWindow. attachment 700516 [details] [diff] [review] is going to keep gralloc buffer longer time and is going to fail a buffer status check in OMXCodec::freeBuffersOnPort().
| Assignee | ||
Comment 14•13 years ago
|
||
(In reply to Sotaro Ikeda [:sotaro] from comment #13)
> mikeh, I start to re-think about Part2. attachment 700516 [details] [diff] [review]
> [review] affect very badly to H.264 video rendering. OMXCodec becomes to
> abort more often than before. I am going to think about to separate thread
> for ImageBridgeChild and ImageContainerChild.
>
> When OMXCodec::freeBuffersOnPort() is called, all gralloc buffers needed to
> be within OMXCodec or GonkNativeWindow. attachment 700516 [details] [diff] [review]
> [review] is going to keep gralloc buffer longer time and is going to fail a
> buffer status check in OMXCodec::freeBuffersOnPort().
It is a comment for Bug 826829... sorry to post to a different bug.
| Assignee | ||
Comment 15•13 years ago
|
||
After apply in attachment 700950 [details] [diff] [review] in Bug 826829. I could not re-produce the abort. I assume it is because shutdown sequence happens as expected.
Comment 16•13 years ago
|
||
Breaking blocking dependency as bug 826829 is already fixed.
No longer blocks: 826829
| Assignee | ||
Comment 17•13 years ago
|
||
This bug is duplicate of bug 826829.
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•