android – WebView Crash by java.io.IOException: close failed: EIO (I/O error) libcore.io.IoUtils.close(IoUtils.java:41)-ThrowExceptions

Exception or error:

i’ve got a crash log upload by users on Android 4.0/4.1,but i cant reproduce it.the log is like this:

java.io.IOException: close failed: EIO (I/O error)
libcore.io.IoUtils.close(IoUtils.java:41)
java.io.FileInputStream.close(FileInputStream.java:121)
android.webkit.JWebCoreJavaBridge.nativeServiceFuncPtrQueue(Native Method)
android.webkit.JWebCoreJavaBridge.handleMessage(JWebCoreJavaBridge.java:113)
android.os.Handler.dispatchMessage(Handler.java:99)
android.os.Looper.loop(Looper.java:137)
android.webkit.WebViewCore$WebCoreThread.run(WebViewCore.java:949)
java.lang.Thread.run(Thread.java:856)
cause by:
libcore.io.ErrnoException: close failed: EIO (I/O error)
libcore.io.Posix.close(Native Method)
libcore.io.BlockGuardOs.close(BlockGuardOs.java:75)
libcore.io.IoUtils.close(IoUtils.java:38)
java.io.FileInputStream.close(FileInputStream.java:121)
android.webkit.JWebCoreJavaBridge.nativeServiceFuncPtrQueue(Native Method)
android.webkit.JWebCoreJavaBridge.handleMessage(JWebCoreJavaBridge.java:113)
android.os.Handler.dispatchMessage(Handler.java:99)
android.os.Looper.loop(Looper.java:137)
android.webkit.WebViewCore$WebCoreThread.run(WebViewCore.java:949)
java.lang.Thread.run(Thread.java:856)

does anyone know how it happen?or how to solve it?

How to solve:

This is happen due to the read only file.

I think this is due to the EIO comes from bad_file_flush in your file. It seems when the kernel has any failure accessing an file, it transforms the open file description to a pseudo-open-file of with bad_inode_ops as its file ops. I can’t find the code that does this for FAT-based file systems, but perhaps there’s some generic code.

Since the FileChannel cache data I think you need to call force() before you close() the FileChannel

For more information go through this links
Link1

###

EIO occurs from bad_file_flush in bad_inode.c. It seems that kernel has some problem in accessing inode.

Reasons for this might be mounting-unmounting SD card or storage media, attaching USB on phone.

Try calling force() before close()

Leave a Reply

Your email address will not be published. Required fields are marked *