New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 639877 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Aug 2016
Cc:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

StrictMode violation on chrome_public_test_apk on Lollipop and Kitkat testers

Project Member Reported by peconn@chromium.org, Aug 22 2016

Issue description

I  604.914s run_tests_on_device(06b0e6be003b6b25)    org.chromium.chrome.browser.ntp.snippets.ArticleSnippetsTest:
I  604.914s run_tests_on_device(06b0e6be003b6b25)    INSTRUMENTATION_STATUS: id=InstrumentationTestRunner
I  604.914s run_tests_on_device(06b0e6be003b6b25)    INSTRUMENTATION_STATUS: test=testSnippetAppearance
I  604.914s run_tests_on_device(06b0e6be003b6b25)    INSTRUMENTATION_STATUS: class=org.chromium.chrome.browser.ntp.snippets.ArticleSnippetsTest
I  604.914s run_tests_on_device(06b0e6be003b6b25)    INSTRUMENTATION_STATUS: current=1
I  604.914s run_tests_on_device(06b0e6be003b6b25)    INSTRUMENTATION_STATUS_CODE: 1
I  604.914s run_tests_on_device(06b0e6be003b6b25)    INSTRUMENTATION_STATUS: test=testSnippetAppearance
I  604.914s run_tests_on_device(06b0e6be003b6b25)    INSTRUMENTATION_STATUS: class=org.chromium.chrome.test.ChromeActivityTestCaseBase$ChromeUncaughtExceptionHandler
I  604.914s run_tests_on_device(06b0e6be003b6b25)    INSTRUMENTATION_STATUS: stack=android.os.StrictMode$StrictModeViolation: policy=2655 violation=2
I  604.914s run_tests_on_device(06b0e6be003b6b25)    	at android.os.StrictMode.executeDeathPenalty(StrictMode.java:1379)
I  604.914s run_tests_on_device(06b0e6be003b6b25)    	at android.os.StrictMode.access$1300(StrictMode.java:118)
I  604.914s run_tests_on_device(06b0e6be003b6b25)    	at android.os.StrictMode$AndroidBlockGuardPolicy.handleViolation(StrictMode.java:1372)
I  604.914s run_tests_on_device(06b0e6be003b6b25)    	at android.os.StrictMode$AndroidBlockGuardPolicy$1.run(StrictMode.java:1254)
I  604.914s run_tests_on_device(06b0e6be003b6b25)    	at android.os.Handler.handleCallback(Handler.java:739)
I  604.914s run_tests_on_device(06b0e6be003b6b25)    	at android.os.Handler.dispatchMessage(Handler.java:95)
I  604.914s run_tests_on_device(06b0e6be003b6b25)    	at android.os.Looper.loop(Looper.java:135)
I  604.914s run_tests_on_device(06b0e6be003b6b25)    	at android.app.ActivityThread.main(ActivityThread.java:5254)
I  604.914s run_tests_on_device(06b0e6be003b6b25)    	at java.lang.reflect.Method.invoke(Native Method)
I  604.915s run_tests_on_device(06b0e6be003b6b25)    	at java.lang.reflect.Method.invoke(Method.java:372)
I  604.915s run_tests_on_device(06b0e6be003b6b25)    	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
I  604.915s run_tests_on_device(06b0e6be003b6b25)    	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
I  604.915s run_tests_on_device(06b0e6be003b6b25)    
I  604.915s run_tests_on_device(06b0e6be003b6b25)    Search logcat for "StrictMode policy violation" for full stack.
I  604.915s run_tests_on_device(06b0e6be003b6b25)    INSTRUMENTATION_STATUS_CODE: -1
I  604.915s run_tests_on_device(06b0e6be003b6b25)    INSTRUMENTATION_RESULT: shortMsg=android.os.StrictMode$StrictModeViolation
I  604.915s run_tests_on_device(06b0e6be003b6b25)    INSTRUMENTATION_RESULT: longMsg=android.os.StrictMode$StrictModeViolation: policy=2655 violation=2
I  604.915s run_tests_on_device(06b0e6be003b6b25)    INSTRUMENTATION_CODE: 0
 

Comment 1 by peconn@chromium.org, Aug 22 2016

Looks similar to 577185.
Project Member

Comment 2 by bugdroid1@chromium.org, Aug 23 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/f0418916f751a8e1d1854f37c2aa06d07456376c

commit f0418916f751a8e1d1854f37c2aa06d07456376c
Author: peconn <peconn@chromium.org>
Date: Tue Aug 23 01:06:51 2016

Disable StrictMode for disk reads during Snippet formatting.

During Snippet formatting we call DateUtils.getRelativeTimeSpanString(...), which itself calls through to TimeZone.getDefault(). If this has never been called before it loads the current time zone from disk. In most likelihood this will have been called previously and the current time zone will have been cached, but in some cases (eg instrumentation tests) it will cause a strict mode violation.

BUG= 639877 

Review-Url: https://codereview.chromium.org/2263333002
Cr-Commit-Position: refs/heads/master@{#413613}

[modify] https://crrev.com/f0418916f751a8e1d1854f37c2aa06d07456376c/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetArticleViewHolder.java
[modify] https://crrev.com/f0418916f751a8e1d1854f37c2aa06d07456376c/tools/metrics/histograms/histograms.xml

Comment 3 by peconn@chromium.org, Aug 23 2016

Status: Fixed (was: Started)

Comment 4 by dgn@chromium.org, Jul 3 2017

Cc: bauerb@chromium.org
We started collecting histogram data (Android.StrictMode.SnippetUIBuildTime) for the time it took to do the string formatting as part of this fix/workaround. Are we planning to do anything with it? Is there any reason why we still collect it?

Sign in to add a comment