Bug 1401737 - 4. Moar diagnostic crash; r=me
authorJim Chen <nchen@mozilla.com>
Thu, 05 Oct 2017 14:59:32 -0400
changeset 384713 9c9bf73f5a4e6be896ca8c34dfc29298cfc285ed
parent 384712 e9224d3e7de6883c226be85cfe301a0e82960d26
child 384714 fb36ba32359ba3b0f4d45491e0356442812e0178
push id32634
push userkwierso@gmail.com
push dateFri, 06 Oct 2017 19:55:44 +0000
treeherdermozilla-central@2d7b8b5dd174 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersme
bugs1401737
milestone58.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1401737 - 4. Moar diagnostic crash; r=me Back out the part 1 diagnostic crash and introduce another diagnostic crash that will hopefully include more details. r=me for trivial patch. MozReview-Commit-ID: Ki8BTdTRHlM
mobile/android/base/java/org/mozilla/gecko/GeckoApplication.java
mobile/android/base/java/org/mozilla/gecko/GeckoService.java
--- a/mobile/android/base/java/org/mozilla/gecko/GeckoApplication.java
+++ b/mobile/android/base/java/org/mozilla/gecko/GeckoApplication.java
@@ -192,16 +192,18 @@ public class GeckoApplication extends Ap
             GeckoThread.onResume();
             mPausedGecko = false;
             GeckoNetworkManager.getInstance().start(this);
         }
 
         mInBackground = false;
     }
 
+    private static Application sApp;
+
     @Override
     public void onCreate() {
         Log.i(LOG_TAG, "zerdatime " + SystemClock.elapsedRealtime() +
               " - application start");
 
         final Context context = getApplicationContext();
         GeckoAppShell.ensureCrashHandling();
         GeckoAppShell.setApplicationContext(context);
@@ -272,16 +274,25 @@ public class GeckoApplication extends Ap
         // We need to set the notification client before launching Gecko, since Gecko could start
         // sending notifications immediately after startup, which we don't want to lose/crash on.
         GeckoAppShell.setNotificationListener(new NotificationClient(context));
         // This getInstance call will force initialization of the NotificationHelper, but does nothing with the result
         NotificationHelper.getInstance(context).init();
 
         MulticastDNSManager.getInstance(context).init();
 
+        if (sApp == null) {
+            sApp = this;
+        } else {
+            GeckoAppShell.appendAppNotesToCrashReport("Bug 1401737: " +
+                    this + '/' + getPackageName() + '/' + getApplicationInfo().uid + ' ' +
+                    sApp + '/' + sApp.getPackageName() + '/' + sApp.getApplicationInfo().uid);
+            throw new IllegalStateException("Bug 1401737 diagnostic crash 2");
+        }
+
         GeckoService.register();
 
         IntentHelper.init();
 
         final EventListener listener = new EventListener();
         EventDispatcher.getInstance().registerUiThreadListener(listener,
                 "Gecko:Exited",
                 "RuntimePermissions:Check",
--- a/mobile/android/base/java/org/mozilla/gecko/GeckoService.java
+++ b/mobile/android/base/java/org/mozilla/gecko/GeckoService.java
@@ -66,32 +66,20 @@ public class GeckoService extends Servic
             default:
                 throw new UnsupportedOperationException(event);
             }
         }
     }
 
     private static final EventListener EVENT_LISTENER = new EventListener();
 
-    private static RuntimeException bug1401737Diag;
-
     public static void register() {
         if (DEBUG) {
             Log.d(LOGTAG, "Registered listener");
         }
-
-        // Diagnose bug 1401737. register() is unexpectedly getting called a second time.
-        // We know the stack for the second call, but we want to collect stack for the first call.
-        if (bug1401737Diag == null) {
-            bug1401737Diag = new IllegalStateException("Bug 1401737 diagnostic crash");
-        } else {
-            Log.e(LOGTAG, "register() is called a second time", new Exception());
-            throw bug1401737Diag;
-        }
-
         EventDispatcher.getInstance().registerGeckoThreadListener(EVENT_LISTENER,
                 "Gecko:ScheduleRun");
     }
 
     public static void unregister() {
         if (DEBUG) {
             Log.d(LOGTAG, "Unregistered listener");
         }