Closed Bug 1126454 Opened 9 years ago Closed 9 years ago

java.lang.RuntimeException: Unable to get provider org.mozilla.gecko.db.PasswordsProvider: java.lang.NullPointerException

Categories

(Firefox for Android Graveyard :: Data Providers, defect)

All
Android
defect
Not set
normal

Tracking

(firefox36 fixed, firefox37 fixed, firefox38 fixed, fennec36+)

RESOLVED FIXED
Firefox 38
Tracking Status
firefox36 --- fixed
firefox37 --- fixed
firefox38 --- fixed
fennec 36+ ---

People

(Reporter: snorp, Assigned: snorp)

Details

Attachments

(1 file)

From the google play store crash console:

java.lang.RuntimeException: Unable to get provider org.mozilla.gecko.db.PasswordsProvider: java.lang.NullPointerException
at android.app.ActivityThread.installProvider(ActivityThread.java:4922)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:4514)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4454)
at android.app.ActivityThread.access$1500(ActivityThread.java:144)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1265)
at android.os.Handler.dispatchMessage(Handler.java:102)

Looks like we have a null context
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5146)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:796)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:612)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NullPointerException
at org.mozilla.gecko.mozglue.GeckoLoader.doLoadLibraryExpected(GeckoLoader.java:434)
at org.mozilla.gecko.mozglue.GeckoLoader.doLoadLibrary(GeckoLoader.java:454)
at org.mozilla.gecko.db.PasswordsProvider.<init>(PasswordsProvider.java:88)
at java.lang.Class.newInstanceImpl(Native Method)
at java.lang.Class.newInstance(Class.java:1208)
at android.app.ActivityThread.installProvider(ActivityThread.java:4907)
Comment on attachment 8555439 [details] [diff] [review]
Load mozglue in PasswordsProvider.onCreate() instead of constructor and install crash handler

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

::: mobile/android/base/db/PasswordsProvider.java
@@ +97,5 @@
> +        return super.onCreate();
> +    }
> +
> +    @Override
> +    public void shutdown() {

You can't @Override here...

@@ +98,5 @@
> +    }
> +
> +    @Override
> +    public void shutdown() {
> +        super.shutdown();

... and you need a version check around this.

shutdown() was added in API 11.
Attachment #8555439 - Flags: review?(rnewman) → review+
(In reply to Richard Newman [:rnewman] from comment #2)
> Comment on attachment 8555439 [details] [diff] [review]
> Load mozglue in PasswordsProvider.onCreate() instead of constructor and
> install crash handler
> 
> Review of attachment 8555439 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> ::: mobile/android/base/db/PasswordsProvider.java
> @@ +97,5 @@
> > +        return super.onCreate();
> > +    }
> > +
> > +    @Override
> > +    public void shutdown() {
> 
> You can't @Override here...
> 
> @@ +98,5 @@
> > +    }
> > +
> > +    @Override
> > +    public void shutdown() {
> > +        super.shutdown();
> 
> ... and you need a version check around this.
> 
> shutdown() was added in API 11.

The parent class already defines (and @Overrides) shutdown()[0] but does not call the super impl (which could be missing, as you mentioned). The @Override and super call here should be fine.

[0] https://dxr.mozilla.org/mozilla-central/source/mobile/android/base/db/SQLiteBridgeContentProvider.java#85
Flags: needinfo?(rnewman)
You clever sod.

Then I revise my comment: please add:

  if (Versions.feature11Plus) {
      super.shutdown();
  }

to SQLiteBridgeContentProvider, and roll on with this patch!
Status: NEW → ASSIGNED
Flags: needinfo?(rnewman)
tracking-fennec: --- → ?
tracking-fennec: ? → 36+
https://hg.mozilla.org/mozilla-central/rev/84e42f7db9b8
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 38
Uplift?
Flags: needinfo?(snorp)
Comment on attachment 8555439 [details] [diff] [review]
Load mozglue in PasswordsProvider.onCreate() instead of constructor and install crash handler

Approval Request Comment
[Feature/regressing bug #]: N/A
[User impact if declined]: crashes soon after startup (rarely?)
[Describe test coverage new/current, TreeHerder]: nightly
[Risks and why]: very low
[String/UUID change made/needed]: none
Flags: needinfo?(snorp)
Attachment #8555439 - Flags: approval-mozilla-beta?
Attachment #8555439 - Flags: approval-mozilla-aurora?
Attachment #8555439 - Flags: approval-mozilla-beta?
Attachment #8555439 - Flags: approval-mozilla-beta+
Attachment #8555439 - Flags: approval-mozilla-aurora?
Attachment #8555439 - Flags: approval-mozilla-aurora+
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: