Closed Bug 1061117 Opened 10 years ago Closed 10 years ago

[MTP] Screenshot/take pictures would let device reboot when MTP enabled

Categories

(Firefox OS Graveyard :: GonkIntegration, defect)

ARM
Linux
defect
Not set
normal

Tracking

(blocking-b2g:2.1+, firefox33 wontfix, firefox34 fixed, firefox35 fixed, b2g-v2.1 verified, b2g-v2.2 fixed)

VERIFIED FIXED
2.1 S4 (12sep)
blocking-b2g 2.1+
Tracking Status
firefox33 --- wontfix
firefox34 --- fixed
firefox35 --- fixed
b2g-v2.1 --- verified
b2g-v2.2 --- fixed

People

(Reporter: ashiue, Assigned: alchen)

Details

Attachments

(3 files, 1 obsolete file)

Attached file mtp_screenshot.log
Gaia      2be78d83a760fa3b9638fe51c266b442d14597f1
Gecko     https://hg.mozilla.org/mozilla-central/rev/1db35d2c9a2f
BuildID   20140831160203
Version   34.0a1
Base image v123

STR:
1. Enabled MTP and USB is plugged in
2. Screenshot device
3. Disabled MTP and enabled again 

Expect result:
Nothing special 

Actual result:
Device has been reboot
[Blocking Requested - why for this release]:
blocking-b2g: --- → 2.1?
QA Whiteboard: [COM=Storage]
Component: Gaia::Gallery → General
From log, it should not be a crash problem but memory problem.
I will check if there is any memory leak in this case.

E/OomLogger( 3220): [Kill]: lowmem_shrink: convert oom_adj to oom_score_adj:
E/OomLogger( 3220): [Kill]: send sigkill to 1219 (Smart Collectio), adj 801, size 4859
E/OomLogger( 3220): [Kill]: send sigkill to 1174 (Built-in Keyboa), adj 801, size 4749
E/OomLogger( 3220): [Kill]: send sigkill to 1221 (Find My Device), adj 801, size 3093
E/OomLogger( 3220): [Kill]: send sigkill to 1354 (Music), adj 734, size 5462
E/OomLogger( 3220): [Kill]: send sigkill to 1301 (Video), adj 734, size 3829
E/OomLogger( 3220): [Kill]: send sigkill to 1356 (Settings), adj 667, size 3772
E/OomLogger( 3220): [Kill]: send sigkill to 1461 (Gallery), adj 400, size 4336
E/OomLogger( 3220): [Kill]: send sigkill to 953 (Homescreen), adj 534, size 6168
E/OomLogger( 3220): [Kill]: send sigkill to 1760 (Music), adj 400, size 5385
E/OomLogger( 3220): [Kill]: send sigkill to 1805 (Homescreen), adj 134, size 4721
E/OomLogger( 3220): [Kill]: send sigkill to 1829 (Gecko_IOThread), adj 134, size 1
E/OomLogger( 3220): [Kill]: send sigkill to 292 (b2g), adj 0, size 208255
E/OomLogger( 3220): [Kill]: lowmem_shrink: convert oom_adj to oom_score_adj:
E/OomLogger( 3220): [Kill]: send sigkill to 2302 (Music), adj 667, size 9084
E/OomLogger( 3220): [Kill]: send sigkill to 2186 (Built-in Keyboa), adj 667, size 7851
E/OomLogger( 3220): [Kill]: send sigkill to 2216 (Find My Device), adj 667, size 7289
E/OomLogger( 3220): [Kill]: send sigkill to 2378 (Gallery), adj 801, size 5792
E/OomLogger( 3220): [Kill]: send sigkill to 2637 (Clock), adj 734, size 5765
E/OomLogger( 3220): [Kill]: send sigkill to 2601 (Settings), adj 667, size 7399
E/OomLogger( 3220): [Kill]: send sigkill to 2555 (Video), adj 667, size 6298
E/OomLogger( 3220): [Kill]: send sigkill to 2246 (Smart Collectio), adj 667, size 5413
E/OomLogger( 3220): [Kill]: send sigkill to 2329 (Usage), adj 667, size 5356
E/OomLogger( 3220): [Kill]: send sigkill to 1939 (Homescreen), adj 534, size 6028
E/OomLogger( 3220): [Kill]: send sigkill to 3067 (Settings), adj 134, size 6992
E/OomLogger( 3220): [Kill]: send sigkill to 3133 ((Preallocated a), adj 134, size 4082
E/OomLogger( 3220): [Kill]: send sigkill to 3160 (plugin-containe), adj 134, size 1016
E/OomLogger( 3220): [Kill]: send sigkill to 3162 (plugin-containe), adj 134, size 707
E/OomLogger( 3220): [Kill]: send sigkill to 3163 ((Preallocated a), adj 134, size 4459
E/OomLogger( 3220): [Kill]: send sigkill to 3183 ((Preallocated a), adj 67, size 838
E/OomLogger( 3220): [Kill]: send sigkill to 3200 (Gecko_IOThread), adj 134, size 1
E/OomLogger( 3220): [Kill]: send sigkill to 3202 (Gecko_IOThread), adj 134, size 1
E/OomLogger( 3220): [Kill]: send sigkill to 1836 (b2g), adj 0, size 205775
E/OomLogger( 3220): [Kill]: lowmem_shrink: convert oom_adj to oom_score_adj:
E/OomLogger( 3220): [Kill]: send sigkill to 3626 (Smart Collectio), adj 734, size 7992
E/OomLogger( 3220): [Kill]: send sigkill to 3584 (Built-in Keyboa), adj 734, size 7194
E/OomLogger( 3220): [Kill]: send sigkill to 3627 (Find My Device), adj 667, size 5538
Assignee: nobody → alchen
Hi Dave,
this is a fix for this bug.

STR:
1. enable MTP
2. do a printscreen
3. wait for 1 min.
4. OOM/low memory killer will be triggered.

Root Cause of this bug:
When there is a new added file (ex: do printscreen), "CreateEntryForFile" will keep adding entry again and again.
In the end, we ran out of memory.

After checking, the offset and component of "CreateEntryForFile" are not correct. This problem caused the do-while loop be an endless loop.
Attachment #8483236 - Flags: review?(dhylands)
Component: General → GonkIntegration
Comment on attachment 8483236 [details] [diff] [review]
(0903) Correct the offset and component in "MozMtpDatabase::CreateEntryForFile"

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

Good find. I obviously didn't do enough testing on that.
Attachment #8483236 - Flags: review?(dhylands) → review+
Triage: serious issue, blocking
blocking-b2g: 2.1? → 2.1+
Comment on attachment 8484773 [details] [diff] [review]
Correct the offset and component in "MozMtpDatabase::CreateEntryForFile". r=dhylands

Approval Request Comment
[Feature/regressing bug #]: It is a bug of MTP implementation.
[User impact if declined]: User will run out of memory if he add a file(ex:printscreen, take a picture) when MTP is enabled.
[Describe test coverage new/current, TBPL]: https://tbpl.mozilla.org/?tree=Try&rev=4c36e48f4676
[Risks and why]: (Low risk) It is a correction.
[String/UUID change made/needed]: none
Attachment #8484773 - Flags: approval-mozilla-aurora?
Needs to be Fixed on central before landing on aurora.

Please request uplift only after this has FIXED on central.
Comment on attachment 8484773 [details] [diff] [review]
Correct the offset and component in "MozMtpDatabase::CreateEntryForFile". r=dhylands

Remove "approval-mozilla-aurora" first.
Attachment #8484773 - Flags: approval-mozilla-aurora?
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/9f72c199944f
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Please request Aurora approval on this when you get a chance.
Flags: needinfo?(alchen)
Target Milestone: --- → 2.1 S4 (12sep)
Comment on attachment 8484773 [details] [diff] [review]
Correct the offset and component in "MozMtpDatabase::CreateEntryForFile". r=dhylands

Approval Request Comment
[Feature/regressing bug #]: It is a bug of MTP implementation.
[User impact if declined]: User will run out of memory if he add a file(ex:printscreen, take a picture) when MTP is enabled.
[Describe test coverage new/current, TBPL]: https://tbpl.mozilla.org/?tree=Try&rev=4c36e48f4676
[Risks and why]: (Low risk) It is a correction.
[String/UUID change made/needed]: none
Attachment #8484773 - Flags: approval-mozilla-aurora?
Flags: needinfo?(alchen)
Attachment #8484773 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Verified on

[2.2]
Gaia-Rev        03d7bcad57ea281869976a9aed0a38849f7c8bc5
Gecko-Rev       https://hg.mozilla.org/mozilla-central/rev/1735ff2bb23e
Build-ID        20140924160204
Version         35.0a1

[2.1]
Gaia-Rev        8061ab487d42cbc49b329fd68b9ca90e0fe477e6
Gecko-Rev       https://hg.mozilla.org/releases/mozilla-aurora/rev/e970bc96f8b5
Build-ID        20140925000204
Version         34.0a2
Status: RESOLVED → VERIFIED
Attached video VIDEO0048_Compress.MP4
This issue has been successfully verified on Flame 2.1 new versions:
Gaia-Rev        1b231b87aad384842dfc79614b2a9ca68a4b4ff3
Gecko-Rev       https://hg.mozilla.org/releases/mozilla-b2g34_v2_1/rev/95fbd7635152
Build-ID        20141119001205
Version         34.0
Device-Name     flame
FW-Release      4.4.2
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: