Skip to content

Commit

Permalink
Adding extra logs to investigate a crasher.
Browse files Browse the repository at this point in the history
A weird crasher seems to indicate SanboxedProcessService can be run again in
the same process.
This CL adds logs to validate that hypothesis.

BUG=164069
TEST=None


Review URL: https://chromiumcodereview.appspot.com/11566020

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@173122 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
jcivelli@chromium.org committed Dec 14, 2012
1 parent 8df90e5 commit 1683a0d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 9 deletions.
2 changes: 1 addition & 1 deletion build/android/findbugs_filter/findbugs_known_bugs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ H B ES: Comparison of String parameter using == or != in org.chromium.android_we
H B Nm: The class name org.chromium.content.browser.test.util.TouchUtils shadows the simple name of the superclass android.test.TouchUtils At TouchUtils.java
H C EC: Using pointer equality to compare a JavaBridgeCoercionTest$CustomType with a JavaBridgeCoercionTest$CustomType2 in org.chromium.content.browser.JavaBridgeCoercionTest.testPassJavaObject() At JavaBridgeCoercionTest.java
H D RCN: Redundant nullcheck of org.chromium.content.browser.SandboxedProcessConnection.mConnectionParams, which is known to be non-null in org.chromium.content.browser.SandboxedProcessConnection.doConnectionSetup() Redundant null check at SandboxedProcessConnection.java
H D ST: Write to static field org.chromium.content.app.SandboxedProcessService.sContext from instance method org.chromium.content.app.SandboxedProcessService.onCreate() At SandboxedProcessService.java
M D ST: Write to static field org.chromium.content.app.SandboxedProcessService.sContext from instance method org.chromium.content.app.SandboxedProcessService.onCreate() At SandboxedProcessService.java
H D ST: Write to static field org.chromium.net.test.util.TestWebServer.sInstance from instance method org.chromium.net.test.util.TestWebServer.shutdown() At TestWebServer.java
H V MS: org.chromium.android_webview.test.AndroidWebViewTestBase.WAIT_TIMEOUT_SECONDS isn't final but should be At AndroidWebViewTestBase.java
H V MS: org.chromium.android_webview.test.LoadDataWithBaseUrlTest.WAIT_TIMEOUT_SECONDS isn't final but should be At LoadDataWithBaseUrlTest.java
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,16 +145,20 @@ private LibraryLoader() {

// This asserts that calls to ensureInitialized() will happen from the
// same thread.
private static Object sCheckThreadLock = new Object();
private static Thread sMyThread;
private static void checkThreadUsage() {
Thread currentThread = java.lang.Thread.currentThread();
if (sMyThread == null) {
sMyThread = currentThread;
} else {
if (sMyThread != currentThread) {
Log.e(TAG, "Threading violation detected. My thread=" + sMyThread +
" but I'm being accessed from thread=" + currentThread);
assert false;
Thread currentThread = Thread.currentThread();
synchronized (sCheckThreadLock) {
if (sMyThread == null) {
sMyThread = currentThread;
} else {
if (sMyThread != currentThread) {
Log.e(TAG, "Threading violation detected. My thread=" + sMyThread + " id=" +
sMyThread.getId() + " but I'm being accessed from thread=" +
currentThread + " id=" + currentThread.getId());
assert false;
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@ public void setSurface(int type, Surface surface, int primaryID, int secondaryID

@Override
public void onCreate() {
Log.i(TAG, "Creating new SandboxedProcessService pid=" + Process.myPid());
if (sContext != null) {
Log.e(TAG, "SanboxedProcessService created again in process!");
}
sContext = this;
super.onCreate();

Expand Down Expand Up @@ -151,6 +155,7 @@ public void run() {

@Override
public void onDestroy() {
Log.i(TAG, "Destroying SandboxedProcessService pid=" + Process.myPid());
super.onDestroy();
if (mCommandLineParams == null) {
// This process was destroyed before it even started. Nothing more to do.
Expand Down

0 comments on commit 1683a0d

Please sign in to comment.