Closed
Bug 1253399
Opened 8 years ago
Closed 8 years ago
Crash when connecting with DevTools over WiFi and barcode scanner not installed
Categories
(Firefox for Android Graveyard :: General, defect)
Tracking
(firefox48 fix-optional, firefox49 fix-optional, fennec48+, firefox50 fixed)
RESOLVED
FIXED
Firefox 50
Tracking | Status | |
---|---|---|
firefox48 | --- | fix-optional |
firefox49 | --- | fix-optional |
fennec | 48+ | --- |
firefox50 | --- | fixed |
People
(Reporter: jryans, Assigned: jryans)
References
(Blocks 1 open bug)
Details
(Keywords: crash)
Attachments
(1 file, 1 obsolete file)
Had a report over IRC from dx that Fennec can crash if you try to connect with DevTools via WiFi and the barcode app is not installed. I believe they were testing with 44 at the time.
Assignee | ||
Updated•8 years ago
|
Blocks: dbg-fennec
My crash report: https://crash-stats.mozilla.com/report/index/d966bc1f-3d03-4335-821b-a37a82160303 Other reports: (since the same signature covers different, unrelated intents) https://crash-stats.mozilla.com/signature/?java_stack_trace=com.google.zxing.client.android.SCAN&signature=android.content.ActivityNotFoundException%3A+at+android.app.Instrumentation.checkStartActivityResult%28Instrumentation.java%29#reports
Updated•8 years ago
|
Status: UNCONFIRMED → NEW
tracking-fennec: --- → ?
Ever confirmed: true
OS: Unspecified → Android
Hardware: Unspecified → All
Assignee | ||
Comment 2•8 years ago
|
||
The WiFi debugging option on the device is disabled if the barcode scanner app is not installed. However, that does not protect against removing the scanner app later on. So, possible STR: 1. Install Barcode Scanner app 2. Enable WiFi debugging in Fennec 3. Uninstall Barcode Scanner app 4. Connect to device via WiFi 5. Press Scan on device auth prompt This will crash Fennec since the scanner app is no longer there. So, we should catch that case and probably provide some error message.
Assignee | ||
Comment 3•8 years ago
|
||
I have a fix for this locally, but I am at a work week, and it is hard to reproduce the issue on this WiFi network. Will continue when I get back home next week.
Assignee: nobody → jryans
Status: NEW → ASSIGNED
tracking-fennec: ? → 48+
Comment 4•8 years ago
|
||
Have you been able to make any progress on this bug?
Flags: needinfo?(jryans)
Assignee | ||
Comment 5•8 years ago
|
||
(In reply to :Margaret Leibovic from comment #4) > Have you been able to make any progress on this bug? I think I had some build trouble at the time and then it fell off my radar. I gave it another try just now, and I've managed to prevent the crash by catching the ActivityNotFoundException, but then Fennec seems to hang after that. I'm not sure why that would happen or how to debug it... I don't have a rooted phone at the moment, so a lot of the debug tools don't work for me. Do you know why it would hang or how to investigate it? Is there something I needed to do with the Messaging API when it fails?
Flags: needinfo?(jryans)
Attachment #8762176 -
Flags: feedback?(margaret.leibovic)
Assignee | ||
Updated•8 years ago
|
Attachment #8762176 -
Attachment is patch: true
Comment 6•8 years ago
|
||
(In reply to J. Ryan Stinnett [:jryans] (use ni?) (at work week until June 21) from comment #5) > Created attachment 8762176 [details] [diff] [review] > WIP: Attempt to stop crashing > > (In reply to :Margaret Leibovic from comment #4) > > Have you been able to make any progress on this bug? > > I think I had some build trouble at the time and then it fell off my radar. > > I gave it another try just now, and I've managed to prevent the crash by > catching the ActivityNotFoundException, but then Fennec seems to hang after > that. I'm not sure why that would happen or how to debug it... I don't > have a rooted phone at the moment, so a lot of the debug tools don't work > for me. You shouldn't need a rooted phone to debug an app crash. Are you using Android Studio? I believe the Java debugger should Just Work if you have that set up. > Do you know why it would hang or how to investigate it? Is there something > I needed to do with the Messaging API when it fails? I'm not sure why Fennec would hang. Are there any errors in the log? I don't think this should have to do with the Messaging API. Maybe Sebastian has some ideas here?
Flags: needinfo?(s.kaspari)
Comment 7•8 years ago
|
||
I can reproduce this with the STR and applied the patch. It seems like the only problem is the sendError() call from the catch block: onActivityResult() is called and the callback is executed - after that we catch the exception and try to call the callback again (exception / crash). It's weird that onActivityResult() gets called even though we were not able to start an activity. According to Stackoverflow our launchMode might be triggering this: http://stackoverflow.com/questions/3354955/onactivityresult-called-prematurely You could: - Not call the callback yourself and rely on onActivityResult. But this is a bit scary and we need to make sure that this calls onError() and not onSuccess() in this case. - OR: Query the PackageManager upfront to see if there's an activity that can handle the Intent. If there's none then do not do anything and just invoke onError().
Flags: needinfo?(s.kaspari)
Updated•8 years ago
|
Attachment #8762176 -
Flags: feedback?(margaret.leibovic)
Assignee | ||
Comment 8•8 years ago
|
||
Review commit: https://reviewboard.mozilla.org/r/60056/diff/#index_header See other reviews: https://reviewboard.mozilla.org/r/60056/
Attachment #8763982 -
Flags: review?(s.kaspari)
Assignee | ||
Comment 9•8 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=a77122ade343
Assignee | ||
Updated•8 years ago
|
Attachment #8762176 -
Attachment is obsolete: true
Comment 10•8 years ago
|
||
Comment on attachment 8763982 [details] Bug 1253399 - Avoid crashes by checking for QR scanner app. https://reviewboard.mozilla.org/r/60056/#review57226 ::: mobile/android/base/java/org/mozilla/gecko/DevToolsAuthHelper.java:51 (Diff revision 1) > + } catch (final SecurityException e) { > + Log.w(LOGTAG, "Forbidden to launch activity.", e); > + callback.sendError("Forbidden to launch activity."); > + } Did you test this specific case? I wonder if this will result in the same error because the callback is executed twice (I'm not sure if onActivityResult() will be called here).
Attachment #8763982 -
Flags: review?(s.kaspari) → review+
Assignee | ||
Comment 11•8 years ago
|
||
https://reviewboard.mozilla.org/r/60056/#review57226 > Did you test this specific case? I wonder if this will result in the same error because the callback is executed twice (I'm not sure if onActivityResult() will be called here). No, I was just cargo-culting from `ActivityHandlerHelper.startIntentAndCatch`. Looks like Android docs say it shouldn't throw a SecurityException anyway, and I don't have a test case, so I'll just remove this part for now.
Assignee | ||
Comment 12•8 years ago
|
||
Comment on attachment 8763982 [details] Bug 1253399 - Avoid crashes by checking for QR scanner app. Review request updated; see interdiff: https://reviewboard.mozilla.org/r/60056/diff/1-2/
Assignee | ||
Comment 13•8 years ago
|
||
Marking 48 and 49 fix-optional, up to Android team if they'd like to uplift. This is not a new issue, it's been around for since WiFi debugging originally appeared.
status-firefox48:
--- → fix-optional
status-firefox49:
--- → fix-optional
status-firefox50:
--- → affected
Keywords: checkin-needed
Comment 14•8 years ago
|
||
Pushed by cbook@mozilla.com: https://hg.mozilla.org/integration/fx-team/rev/7e6896f7bed5 Avoid crashes by checking for QR scanner app. r=sebastian
Keywords: checkin-needed
Comment 15•8 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/7e6896f7bed5
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 50
Updated•3 years ago
|
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•