Closed Bug 1159258 Opened 9 years ago Closed 8 years ago

crash in android.util.SuperNotCalledException: Activity {org.mozilla.fennec/org.mozilla.gecko.webapp.Webapps$Webapp1} did not call through to super.onCreate() at android.app.ActivityThread.performLaunchActivity(ActivityThread.java)

Categories

(Firefox for Android Graveyard :: Web Apps (PWAs), defect)

40 Branch
ARM
Android
defect
Not set
critical

Tracking

(firefox40 affected)

RESOLVED WONTFIX
Tracking Status
firefox40 --- affected

People

(Reporter: aaronmt, Unassigned)

Details

(Keywords: crash)

Crash Data

This bug was filed from the Socorro interface and is 
report bp-333ff713-d256-4567-b1ee-77eef2150427.
=============================================================

android.util.SuperNotCalledException: Activity {org.mozilla.fennec/org.mozilla.gecko.webapp.Webapps$Webapp1} did not call through to super.onCreate()
	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2271)
	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2363)
	at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:3924)
	at android.app.ActivityThread.access$1000(ActivityThread.java:161)
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1271)
	at android.os.Handler.dispatchMessage(Handler.java:102)
	at android.os.Looper.loop(Looper.java:157)
	at android.app.ActivityThread.main(ActivityThread.java:5356)
	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:1265)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1081)
	at dalvik.system.NativeStart.main(Native Method)
Webapp1 extends WebappImpl, which does not call out to super.onCreate when it returns early (and instead calls `finish`). I'm not sure that calling finish is a substitute for not calling super.onCreate, but notably the comment above super.onCreate is:

 // start Gecko.

So we're probably doing that to reduce the burden on startup.
NI self to do more research.
Flags: needinfo?(michael.l.comella)
[1] says super.onCreate is required (of course, skepticism is useful with SO as a source).

Richard, would we have any problems if we call super.onCreate and then finished later? Do you see an alternative?

[1]: http://stackoverflow.com/a/25461642
Flags: needinfo?(michael.l.comella) → needinfo?(rnewman)
There's no mFinished guard around the check for onCreate in ActivityThread, so yes, you need to call onCreate.

More strictly: you can *throw* in onCreate, but otherwise you can't return without having called super.onCreate() -- or, through shenanigans, setting Activity.mCalled = true.

If you need to finish immediately, this recipe should work:

  super.onCreate();
  finish();
  return;

After finish() is called the lifecycle will skip straight to onDestroy().

Be careful, because we do things wrong here -- we unilaterally try to clean up resources in onDestroy() that won't ever be initialized if we exit early from onCreate(). See the crashes in Bug 1119915. You might want to extract the lifecycle parts of that bug and fix them here…
Flags: needinfo?(rnewman)
Thanks for the research, Richard.

I probably should have checked before the NI – there have been no crashes with this signature in the past 28 days so I don't think this should be high priority at the moment – I'm going to leave this unassigned.
No crashes in 28 days likely because few webapps * few users * few uses * few aborts - users lost to previous crashes ~= 0 :)
Crash Signature: [@ android.util.SuperNotCalledException: Activity {org.mozilla.fennec/org.mozilla.gecko.webapp.Webapps$Webapp1} did not call through to super.onCreate() at android.app.ActivityThread.performLaunchActivity(ActivityThread.java)] → [@ android.util.SuperNotCalledException: Activity {org.mozilla.fennec/org.mozilla.gecko.webapp.Webapps$Webapp1} did not call through to super.onCreate() at android.app.ActivityThread.performLaunchActivity(ActivityThread.java)] [@ android.util.SuperNotCal…
Per bug 1235869, we're going to disable the Android web runtime, so we won't fix this bug in it.

(This is part of a bulk resolution of bugs in the Firefox for Android::Web Apps component, from which I attempted to exclude bugs that are not specific to the runtime, but it's possible that I included one accidentally.  If so, I'm sorry, and please reopen the bug!)
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → WONTFIX
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.