Closed
Bug 819609
Opened 12 years ago
Closed 12 years ago
Be defensive about videos we send to the HW decoder (video app crashes with low pmem (dequeueBuffer() needs proper error handling))
Categories
(Firefox OS Graveyard :: General, defect, P1)
Tracking
(blocking-basecamp:+, firefox18 fixed, firefox19 fixed, firefox20 fixed, b2g18 fixed)
RESOLVED
FIXED
blocking-basecamp | + |
People
(Reporter: ikumar, Assigned: cjones)
References
Details
Attachments
(2 files)
4.20 KB,
patch
|
cajbir
:
review+
|
Details | Diff | Splinter Review |
842 bytes,
patch
|
m1
:
feedback+
|
Details | Diff | Splinter Review |
STR: 1. Put few high resolution videos in /sdcard/Movies 2. Start video app Video app crashes. For a more consistent way to reproduce the issue: Reduce pmem size to 2MB or so and video app crashes with lower resolution(HVGA) videos as well. Diagnosis: Debugged it to find the problem in GrallocBufferActor::Create() doesn't do any error handling. This function gets eventually called from dequeueBuffer() in GonkNativeWindow.cpp. When pmem is low then GraphicBuffer() fails and initCheck() returns an error but doesn't look like GrallocBufferActor::Create() is doing anything to propagate the error to dequeueBuffer(). See: https://github.com/mozilla/mozilla-central/blob/beta/gfx/layers/ipc/ShadowLayerUtilsGralloc.cpp#L169 As a result there is a bad dereference somewhere and dequeueBuffer() never returns. There are couple of other places in that file where we are creating GraphicBuffer but not doing any error handling.
Assignee | ||
Updated•12 years ago
|
blocking-basecamp: ? → +
Priority: -- → P1
Assignee | ||
Comment 1•12 years ago
|
||
Oh, vomit. The core code *is* actually propagating the errors correctly, although it's fairly confusing (my fault for that). The problem is that the error-handling code in GonkNativeWindow::dequeueBuffer() is plain wrong. We would crash any time allocation actually failed. That code gave me a strong sense of deja vu, and the reason is that I already fixed that bug! Just the patch wasn't uplifted correctly. So let me fix that wagon and we can retest here.
Depends on: 809259
Assignee | ||
Comment 2•12 years ago
|
||
https://hg.mozilla.org/releases/mozilla-beta/rev/3f325888eb10 I'm confident enough that that's the fix to close this. Please reopen if this doesn't do the trick.
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Comment 3•12 years ago
|
||
Good catch Inder! Does this solve the problem in bug 804802 ?
Chris, I am still seeing the issue with this patch. The problem is it never returns back from the call to AllocSurfaceDescriptorGralloc() in dequeueBuffer(). The error check you added is after this function call which is never reached.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Comment 5•12 years ago
|
||
over to cjones. please unassign if you are not able to investigate (or reassign as appropriate).
Assignee: nobody → jones.chris.g
Assignee | ||
Updated•12 years ago
|
Summary: video app crashes with low pmem (dequeueBuffer() needs proper error handling) → Be defensive about videos we send to the HW decoder (video app crashes with low pmem (dequeueBuffer() needs proper error handling))
Assignee | ||
Comment 6•12 years ago
|
||
This sure doesn't feel like the right way to solve this bug but we have a priority request to stop the badness. Followup work is already filed.
Attachment #690745 -
Flags: review?(chris.double)
Assignee | ||
Comment 7•12 years ago
|
||
Just demonstrates the build properties that will need to be updated to enable the new code here.
Attachment #690747 -
Flags: feedback?(mvines)
Updated•12 years ago
|
Attachment #690745 -
Flags: review?(chris.double) → review+
Assignee | ||
Comment 8•12 years ago
|
||
It appears that the fallback google SW decoder is next to useless in practice. This patch might end up causing videos that previously barely used to play to hit the SW decoder and not play.
Assignee | ||
Comment 9•12 years ago
|
||
https://github.com/mozilla-b2g/android-device-otoro/commit/2825a9772f16800eba1c1901fa71a74ba464e9ce https://github.com/mozilla-b2g/android-device-unagi/commit/eae5c49bc5df4ba54bba0675c5e3836a15995381 https://hg.mozilla.org/integration/mozilla-inbound/rev/bda0d77acf0c https://hg.mozilla.org/releases/mozilla-aurora/rev/c042ea08a2b4 https://hg.mozilla.org/releases/mozilla-beta/rev/3fcae8234ba9
Status: REOPENED → RESOLVED
Closed: 12 years ago → 12 years ago
Resolution: --- → FIXED
Comment 10•12 years ago
|
||
Sadness. There surely is another way for I believe there is good in this world. Do we shutdown the camera on home key these days? If not then it's still consuming pmem and I bet we still can hit the bug. Inder, can you show us the light?
Assignee | ||
Comment 11•12 years ago
|
||
(In reply to Michael Vines [:m1] from comment #10) > Do we shutdown the camera on home key these days? If not then it's still > consuming pmem and I bet we still can hit the bug. > We do.
Assignee | ||
Comment 12•12 years ago
|
||
Although even if we didn't, it would likely be easy to construct videos that passed this dumb check but still exhausted pmem. I agree that there must be another way!
Updated•12 years ago
|
status-firefox18:
--- → fixed
status-firefox19:
--- → fixed
Updated•12 years ago
|
status-firefox20:
--- → fixed
Whiteboard: [status-b2g18:fixed]
Updated•12 years ago
|
status-b2g18:
--- → fixed
Whiteboard: [status-b2g18:fixed]
Updated•12 years ago
|
Attachment #690747 -
Flags: feedback?(mvines) → feedback+
You need to log in
before you can comment on or make changes to this bug.
Description
•