Closed Bug 1472623 Opened 6 years ago Closed 6 years ago

Crash in java.lang.NullPointerException: collection == null at android.os.Parcel.readException(Parcel.java)

Categories

(Firefox for Android Graveyard :: General, defect)

Unspecified
Android
defect
Not set
critical

Tracking

(firefox-esr52 unaffected, firefox-esr60 unaffected, firefox61 unaffected, firefox62+ verified, firefox63 verified)

VERIFIED FIXED
Firefox 63
Tracking Status
firefox-esr52 --- unaffected
firefox-esr60 --- unaffected
firefox61 --- unaffected
firefox62 + verified
firefox63 --- verified

People

(Reporter: gsvelto, Assigned: eeejay)

Details

(Keywords: crash, regression, Whiteboard: [geckoview])

Crash Data

Attachments

(1 file, 1 obsolete file)

This bug was filed from the Socorro interface and is
report bp-e197af1c-f852-4072-9590-806fe0180702.
=============================================================

Top 10 frames of crashing thread:

0 libxul.so GeckoAppShellSupport::ReportJavaCrash widget/android/nsAppShell.cpp:280
1 libxul.so void mozilla::jni::NativeStub<mozilla::java::GeckoAppShell::ReportJavaCrash_t, GeckoAppShellSupport, mozilla::jni::Args<mozilla::jni::Ref<mozilla::jni::TypedObject<_jthrowable*>, _jthrowable*> const&, mozilla::jni::StringParam const&> >::Wrap<&GeckoAppShellSupport::ReportJavaCrash> widget/android/jni/Natives.h:778
2 data@app@org.mozilla.fennec_aurora-1@base.apk@classes.dex data@app@org.mozilla.fennec_aurora-1@base.apk@classes.dex@0xf2e00d 
3 dalvik-non moving space (deleted) dalvik-non moving space @0x9d4e 
4 dalvik-main space (deleted) dalvik-main space @0x9ffe 
5 dalvik-main space (deleted) dalvik-main space @0x544a1e 
6 dalvik-main space (deleted) dalvik-main space @0x54fb5e 
7 dalvik-main space (deleted) dalvik-main space @0x54fb5e 
8 dalvik-non moving space (deleted) dalvik-non moving space @0xb06e 
9 dalvik-main space (deleted) dalvik-main space @0x54fb5e 

=============================================================

This does not seem like a regression as I can find reports going back for months.
This is pretty high volume for beta 62, and there only seem to be a few reports for earlier versions, even looking as far back as 6 months. So it may be newly exposed in some way with 62.
Keywords: regression
Whiteboard: [geckoview]
The real stack trace here is:

java.lang.NullPointerException: collection == null
	at android.os.Parcel.readException(Parcel.java:1552)
	at android.os.Parcel.readException(Parcel.java:1499)
	at android.speech.tts.ITextToSpeechService$Stub$Proxy.getVoices(ITextToSpeechService.java:700)
	at android.speech.tts.TextToSpeech$11.run(TextToSpeech.java:1563)
	at android.speech.tts.TextToSpeech$11.run(TextToSpeech.java:1560)
	at android.speech.tts.TextToSpeech$Connection.runAction(TextToSpeech.java:2232)
	at android.speech.tts.TextToSpeech.runAction(TextToSpeech.java:742)
	at android.speech.tts.TextToSpeech.runAction(TextToSpeech.java:732)
	at android.speech.tts.TextToSpeech.getAvailableLanguages(TextToSpeech.java:1560)
	at org.mozilla.gecko.SpeechSynthesisService.getAvailableLanguages(SpeechSynthesisService.java:70)
	at org.mozilla.gecko.SpeechSynthesisService.access$300(SpeechSynthesisService.java:26)
	at org.mozilla.gecko.SpeechSynthesisService$2.run(SpeechSynthesisService.java:57)
	at android.os.Handler.handleCallback(Handler.java:739)
	at android.os.Handler.dispatchMessage(Handler.java:95)
	at android.os.Looper.loop(Looper.java:135)
	at org.mozilla.gecko.util.GeckoBackgroundThread.run(GeckoBackgroundThread.java:43)
Eitan, who worked on Android speed synthesis? Would this bug affect GeckoView or just Fennec?
Flags: needinfo?(eitan)
Both GeckoView and Fennec. Looks like that conditional should be one release greater than lollipop.
Flags: needinfo?(eitan)
Comment on attachment 8990129 [details] [diff] [review]
Don't use tts.getAvailableLanguages on Androids older than M. r?snorp

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

The current check looks for 21 and higher, which matches where getAvailableLanguages() is available. I don't know why this would fix it, unless 22+ doesn't have the bug in TextToSpeech that we're seeing here. If that's the case please leave a comment pointing to appropriate documentation (if any).
Attachment #8990129 - Flags: review?(snorp) → review+
I tested this on an emulator and this change seems to do the trick. From looking at the crash stats, it looks like this comes exclusively from 22/21 devices.

I have a feeling that while the method was added in 21, the underlying speech service that was shipped with 21/22 still did not support this call. That is why we get that null pointer exception and not a no method found one.

I'll add a comment about that.
Attachment #8990129 - Attachment is obsolete: true
Assignee: nobody → eitan
Keywords: checkin-needed
Pushed by csabou@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/38e0508ea386
Don't use tts.getAvailableLanguages on Androids older than M. r=snorp
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/38e0508ea386
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 63
Eitan, do we need to uplift this TalkBack fix to Beta 62? If so, can you please request uplift?
Flags: needinfo?(eitan)
Comment on attachment 8990147 [details] [diff] [review]
Don't use tts.getAvailableLanguages on Androids older than M.

Approval Request Comment
[Feature/Bug causing the regression]: Bug 1184142
[User impact if declined]: Users on Kitkat and lower will automatically crash when WebSpeech API is used
[Is this code covered by automated tests?]: No
[Has the fix been verified in Nightly?]: Yes. I don't see any more crashes after Nightly build 20180703100027.
[Needs manual test from QE? If yes, steps to reproduce]: It would be great to have someone with a kitkat device verify this.
[List of other uplifts needed for the feature/fix]:
[Is the change risky?]: No
[Why is the change risky/not risky?]: It disables a newer API path for older devices and relies on a safer path.
[String changes made/needed]: None
Flags: needinfo?(eitan)
Attachment #8990147 - Flags: approval-mozilla-release?
Attachment #8990147 - Flags: approval-mozilla-beta?
Comment on attachment 8990147 [details] [diff] [review]
Don't use tts.getAvailableLanguages on Androids older than M.

Crash fix, verified in nightly, let's take this for beta 7.
Attachment #8990147 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Hello, I tried reproducing the crash on Beta 5 and Nightly builds before the fix, but I can't. I turned on Talkback and used the browser for videos, articles, etc. Maybe there are more STR that I missed, please let me know.

The 2 devices I have with Android KitKat are: 
Prestigio Grace X5 (Android 4.4.2)
Lenovo A536 (Android 4.4.2)

I'm unable to verify this bug on Beta 62.0b7. 
Maybe someone who was able to reproduce it before could verify it.
This is not a Talkback bug, no need to enable it. Sorry for the confusion.

These are the steps to reproduce:
1. Go to https://eeejay.github.io/webspeechdemos
Comment on attachment 8990147 [details] [diff] [review]
Don't use tts.getAvailableLanguages on Androids older than M.

No sign of this crash on release from what I can see. I think this can just ride 62 to release, but feel free to NI if you feel strongly otherwise.
Attachment #8990147 - Flags: approval-mozilla-release? → approval-mozilla-release-
Status: RESOLVED → VERIFIED
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.