Closed Bug 1008071 Opened 10 years ago Closed 10 years ago

[Tarako][Messages]Sometimes attach Gallery image will cause Messages app be killed (not LMK)

Categories

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

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(blocking-b2g:1.3T+, b2g-v1.3T verified)

VERIFIED FIXED
blocking-b2g 1.3T+
Tracking Status
b2g-v1.3T --- verified

People

(Reporter: mlien, Assigned: steveck)

Details

(Whiteboard: [sprd313797][partner-blocker])

Attachments

(2 files)

Attached file logcat.txt
[Device]
  Tarako
---------------------------------------------
[Reproduction build] - 0429pac + PVT v1.3T
  Gaia      554fd996205fef74d88e988f3596c58dcd05df28
  Gecko     https://hg.mozilla.org/releases/mozilla-b2g28_v1_3t/rev/ae5430bd4bbd
  BuildID   20140508164003
  Version   28.1
---------------------------------------------
[Reproduce Steps]
  1. Launch Camera app
  2. Take a picture
  3. Back to homescreen
  4. Launch Message app -> Compose a message
  5. Attach step 2's image from Gallery
  6. Repeat step 5 2~4 times
---------------------------------------------
[Expected Result]
  Can attach normally
---------------------------------------------
[Actual Result]
  Sometimes messages app be killed but not due to LMK
  I/Gecko   (   85): Security problem: Content process does not have `device-storage:pictures-read'.  It will be killed.
---------------------------------------------
[Reproduce Rate]
  70%
David, any idea about this?
Flags: needinfo?(dflanagan)
If I follow the STR, I can reproduce a SMS crash, but it is clearly an OOM. I don't see anything related to security.

My hypothesis is that this happens when a new pick activity is launched while images are still being resized. Mike: can you reproduce this if you wait for the "resizing attached image" banner to go away before clicking the paperclip again?

Julien: I suggest you disable the attach button while resizing is going on.
Flags: needinfo?(mlien)
Flags: needinfo?(felash)
Flags: needinfo?(dflanagan)
(In reply to David Flanagan [:djf] from comment #2)
> If I follow the STR, I can reproduce a SMS crash, but it is clearly an OOM.
> I don't see anything related to security.
> 
> My hypothesis is that this happens when a new pick activity is launched
> while images are still being resized. Mike: can you reproduce this if you
> wait for the "resizing attached image" banner to go away before clicking the
> paperclip again?
> 
> Julien: I suggest you disable the attach button while resizing is going on.

I still can reproduce it after waiting the banner "Converting to media message" and "resizing attached image" going away
Gaia      fabc8154b31178515795b0a32068257fd5a16269
Gecko     https://hg.mozilla.org/releases/mozilla-b2g28_v1_3t/rev/a500e34d8819
BuildID   20140511164002
Version   28.1
Flags: needinfo?(mlien)
Fabrice, any idea what could produce this:

>  I/Gecko   (   85): Security problem: Content process does not have `device-storage:pictures-read'.  It will be killed.

Is it "possible" that the Blob we get from the Gallery app has not finished reading all the data from storage, and when we try to access it from the SMS app, we ends up needing this permission?
Flags: needinfo?(felash) → needinfo?(fabrice)
On tarako, the message and the gallery app will sharing the same process in this case since the gallery is started by an activity. So both die at the same time when we OOM, and the "Security problem" message is likely from tearing down some objects out of order. Not much we can do there...
Flags: needinfo?(fabrice)
(In reply to Mike Lien[:mlien] from comment #3)
> (In reply to David Flanagan [:djf] from comment #2)
> > If I follow the STR, I can reproduce a SMS crash, but it is clearly an OOM.
> > I don't see anything related to security.
> > 
> > My hypothesis is that this happens when a new pick activity is launched
> > while images are still being resized. Mike: can you reproduce this if you
> > wait for the "resizing attached image" banner to go away before clicking the
> > paperclip again?
> > 
> > Julien: I suggest you disable the attach button while resizing is going on.
> 
> I still can reproduce it after waiting the banner "Converting to media
> message" and "resizing attached image" going away
> Gaia      fabc8154b31178515795b0a32068257fd5a16269
> Gecko    
> https://hg.mozilla.org/releases/mozilla-b2g28_v1_3t/rev/a500e34d8819
> BuildID   20140511164002
> Version   28.1

hi Mike, is the reproduce rate still 70% after you wait for things to finish? can you provide the reproduce rate? thanks
Flags: needinfo?(mlien)
verified with the latest daily build, reproduce rate is 1/7
Gaia      9699b942b6d0c79c64aa33c2c2ed533ee2c9c852
Gecko     https://hg.mozilla.org/releases/mozilla-b2g28_v1_3t/rev/292f924a4475
BuildID   20140515164002
Version   28.1
Flags: needinfo?(mlien)
given that the reproduce rate is much lower if we wait for the resizing to be done
Julien, do you think it makes sense to take djf's suggestion in comment 2? Thanks 

"Julien: I suggest you disable the attach button while resizing is going on."
Flags: needinfo?(felash)
I'll look on an actual Tarako later on.
My Tarako does not have the latest code so I'll try to get it flashed and report later.

djf's suggestion sound reasonable though.
will you be able to provide a patch this week? :)
I can if the bug is made 1.3t+, but it's still not.
Also, I'd like to know if this is still an issue with the latest code.

I just flashed my Tarako with the latest build and I can't reproduce (while I could reproduce with older builds).
Flags: needinfo?(felash) → needinfo?(mlien)
verify with today's daily build, "Security problem" reproduce rate is still very low like comment 7
additionally, if doesn't wait the banner "Converting to media message" and "resizing attached image" going away, OOM rate is higher than waiting it finished

Gaia      de7f2cb97b548f6e882e9a5077577827f1bcc054
Gecko     https://hg.mozilla.org/releases/mozilla-b2g28_v1_3t/rev/446f2970cf94
BuildID   20140520164000
Version   28.1

If you think this issue's summary mismatch current fixing trend, please feel free to modify it
Flags: needinfo?(mlien)
Mike, do you please have the average reproduce rate for OOM when not waiting for "resizing image" to disappear?
Flags: needinfo?(mlien)
attach 4 images, OOM reproduce rate
waiting "resizing image" disappear: 1/7
not waiting "resizing image" disappear: 7/7
Flags: needinfo?(mlien)
triage: 1.3T+, this is a parnter blocker
blocking-b2g: 1.3T? → 1.3T+
Whiteboard: [sprd313797][partner-blocker]
hi Julien, mind taking? :)
Flags: needinfo?(felash)
Since Julien might busy on other tasks, I can take it forst. And maybe we can just uplift bug 995116 and block attach action while resizing to avoid OOM issue.
Flags: needinfo?(felash)
Assignee: nobody → schung
+1 to everything you said in comment 19. And thanks for taking!
Attached file Link to github
Hi Julien, this patch uplift bug 995116 with some conflict changes and block file attaching while resizing. Maybe we should file another patch to master for the attachment blocking behavior?
Attachment #8426968 - Flags: review?(felash)
Comment on attachment 8426968 [details] [review]
Link to github

r=me in the current form

Still I found a small issue, so if you decide to fix it, please ask review again. Otherwise, maybe it's better to do it in another bug and leave 1.3t with the smallest change to fix the reported issue.
Attachment #8426968 - Flags: review?(felash) → review+
Obviously, please merge on a green travis :)
Comment on attachment 8426968 [details] [review]
Link to github

I think we should'nt allow this behavior which will block the usage even it's hard to reproduce. Requesting the review again with issue addressed, thanks for discovering this bug!
Attachment #8426968 - Flags: review+ → review?(felash)
Comment on attachment 8426968 [details] [review]
Link to github

r=me
works perfectly.

I'm landing it !
Attachment #8426968 - Flags: review?(felash) → review+
v1.3t: 310924dd38f5130955f9ceeb2a3855ce028b27d2
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Verified as fixed on the latest Tarako build.

1.3T Environmental Variables:
Device: Tarako 1.3T
BuildID: 20140602014001
Gaia: 335486c42498fa7a93c21e4d6121199728602ab8
Gecko: 55e4d83019e5
Version: 28.1
Firmware Version: SP6821a-Gonk-4.0-4-29

Can attach images as expected.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: