Last Comment Bug 701023 - strictmode Disk read Violation on startup
: strictmode Disk read Violation on startup
Status: VERIFIED FIXED
:
Product: Firefox for Android
Classification: Client Software
Component: General (show other bugs)
: unspecified
: ARM Android
: P1 normal (vote)
: ---
Assigned To: Doug Turner (:dougt)
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-11-09 07:40 PST by David Burns :automatedtester
Modified: 2012-01-09 11:21 PST (History)
3 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---
fixed
11+


Attachments
patch v.1 (4.12 KB, patch)
2011-11-16 21:45 PST, Doug Turner (:dougt)
pwalton: review+
Details | Diff | Splinter Review

Description David Burns :automatedtester 2011-11-09 07:40:41 PST
When I start the browser I am getting this dumped into the logs.


11-09 15:25:33.900: DEBUG/StrictMode(12305): StrictMode policy violation; ~duration=35 ms: android.os.StrictMode$StrictModeDiskReadViolation: policy=23 violation=2
11-09 15:25:33.900: DEBUG/StrictMode(12305):     at android.os.StrictMode$AndroidBlockGuardPolicy.onReadFromDisk(StrictMode.java:1067)
11-09 15:25:33.900: DEBUG/StrictMode(12305):     at dalvik.system.BlockGuard$WrappedFileSystem.read(BlockGuard.java:171)
11-09 15:25:33.900: DEBUG/StrictMode(12305):     at java.io.FileInputStream.read(FileInputStream.java:208)
11-09 15:25:33.900: DEBUG/StrictMode(12305):     at java.io.FileInputStream.read(FileInputStream.java:197)
11-09 15:25:33.900: DEBUG/StrictMode(12305):     at java.io.BufferedInputStream.fillbuf(BufferedInputStream.java:142)
11-09 15:25:33.900: DEBUG/StrictMode(12305):     at java.io.BufferedInputStream.read(BufferedInputStream.java:309)
11-09 15:25:33.900: DEBUG/StrictMode(12305):     at android.graphics.BitmapFactory.nativeDecodeStream(Native Method)
11-09 15:25:33.900: DEBUG/StrictMode(12305):     at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:493)
11-09 15:25:33.900: DEBUG/StrictMode(12305):     at android.graphics.BitmapFactory.decodeFile(BitmapFactory.java:299)
11-09 15:25:33.900: DEBUG/StrictMode(12305):     at android.graphics.BitmapFactory.decodeFile(BitmapFactory.java:324)
11-09 15:25:33.900: DEBUG/StrictMode(12305):     at org.mozilla.gecko.GeckoSurfaceView.loadStartupBitmap(GeckoSurfaceView.java:137)
11-09 15:25:33.900: DEBUG/StrictMode(12305):     at org.mozilla.gecko.GeckoApp.onCreate(GeckoApp.java:1098)
11-09 15:25:33.900: DEBUG/StrictMode(12305):     at android.app.Activity.performCreate(Activity.java:4397)
11-09 15:25:33.900: DEBUG/StrictMode(12305):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1048)
11-09 15:25:33.900: DEBUG/StrictMode(12305):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1779)
11-09 15:25:33.900: DEBUG/StrictMode(12305):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1831)
11-09 15:25:33.900: DEBUG/StrictMode(12305):     at android.app.ActivityThread.access$500(ActivityThread.java:122)
11-09 15:25:33.900: DEBUG/StrictMode(12305):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1024)
11-09 15:25:33.900: DEBUG/StrictMode(12305):     at android.os.Handler.dispatchMessage(Handler.java:99)
11-09 15:25:33.900: DEBUG/StrictMode(12305):     at android.os.Looper.loop(Looper.java:132)
11-09 15:25:33.900: DEBUG/StrictMode(12305):     at android.app.ActivityThread.main(ActivityThread.java:4123)
11-09 15:25:33.900: DEBUG/StrictMode(12305):     at java.lang.reflect.Method.invokeNative(Native Method)
11-09 15:25:33.900: DEBUG/StrictMode(12305):     at java.lang.reflect.Method.invoke(Method.java:491)
11-09 15:25:33.900: DEBUG/StrictMode(12305):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841)
11-09 15:25:33.900: DEBUG/StrictMode(12305):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599)
11-09 15:25:33.900: DEBUG/StrictMode(12305):     at dalvik.system.NativeStart.main(Native Method)
Comment 1 Mark Finkle (:mfinkle) (use needinfo?) 2011-11-14 13:21:04 PST
Since the Java Compositor landed, this has the following signature:

D/StrictMode(13061): StrictMode policy violation; ~duration=132 ms: android.os.StrictMode$StrictModeDiskReadViolation: policy=23 violation=2
D/StrictMode(13061):    at android.os.StrictMode$AndroidBlockGuardPolicy.onReadFromDisk(StrictMode.java:745)
D/StrictMode(13061):    at dalvik.system.BlockGuard$WrappedFileSystem.open(BlockGuard.java:228)
D/StrictMode(13061):    at java.io.FileInputStream.<init>(FileInputStream.java:80)
D/StrictMode(13061):    at java.io.FileInputStream.<init>(FileInputStream.java:132)
D/StrictMode(13061):    at android.graphics.BitmapFactory.decodeFile(BitmapFactory.java:362)
D/StrictMode(13061):    at org.mozilla.gecko.gfx.PlaceholderLayerClient.createInstance(PlaceholderLayerClient.java:79)
D/StrictMode(13061):    at org.mozilla.gecko.GeckoApp.onCreate(GeckoApp.java:1059)
D/StrictMode(13061):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
D/StrictMode(13061):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1615)
D/StrictMode(13061):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1667)
D/StrictMode(13061):    at android.app.ActivityThread.access$1500(ActivityThread.java:117)
D/StrictMode(13061):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:935)
D/StrictMode(13061):    at android.os.Handler.dispatchMessage(Handler.java:99)
D/StrictMode(13061):    at android.os.Looper.loop(Looper.java:123)
D/StrictMode(13061):    at android.app.ActivityThread.main(ActivityThread.java:3691)
D/StrictMode(13061):    at java.lang.reflect.Method.invokeNative(Native Method)
D/StrictMode(13061):    at java.lang.reflect.Method.invoke(Method.java:507)
D/StrictMode(13061):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:847)
D/StrictMode(13061):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:605)
D/StrictMode(13061):    at dalvik.system.NativeStart.main(Native Method)
Comment 2 Doug Turner (:dougt) 2011-11-16 21:45:14 PST
Created attachment 575091 [details] [diff] [review]
patch v.1
Comment 3 Patrick Walton (:pcwalton) 2011-11-16 21:52:31 PST
Comment on attachment 575091 [details] [diff] [review]
patch v.1

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

r+ with CairoUtils.bitsPerPixelForCairoFormat().

::: embedding/android/gfx/PlaceholderLayerClient.java
@@ +92,5 @@
> +            mHeight = bitmap.getHeight();
> +
> +            int size = mWidth * mHeight * 4;
> +            if (config == Bitmap.Config.RGB_565)
> +                size = mWidth * mHeight * 2;

There's a CairoUtils.bitsPerPixelForCairoFormat() call you can use for this.

@@ +104,5 @@
> +        @Override
> +        protected void onPostExecute(Void unused) {
> +            SingleTileLayer tileLayer = new SingleTileLayer();
> +            getLayerController().setRoot(tileLayer);
> +            tileLayer.paintImage(new BufferedCairoImage(mBuffer, mWidth, mHeight, mFormat));

Note: I'm simplifying this API a bit to provide the image in the constructor, but this is fine.
Comment 4 Doug Turner (:dougt) 2011-11-17 13:11:31 PST
https://hg.mozilla.org/projects/birch/rev/556bacb7c080

Note You need to log in before you can comment on or make changes to this bug.