Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-8431

File Transfer tests crash on Android Lolipop

VotersStop watchingWatchersLinkUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    Description

      Mobile Spec crashes during File Transfer tests, with a NullPointerException thrown inside of OkHTTP.

      This is very similar to CB-6378, except that all operations here appear to be happening on the same thread.

      The stack trace I've seen is:

      E/AndroidRuntime(16078): FATAL EXCEPTION: pool-1-thread-3
      E/AndroidRuntime(16078): Process: org.apache.mobilespec, PID: 16078
      E/AndroidRuntime(16078): java.lang.NullPointerException: Attempt to read from field 'int com.android.okio.Segment.limit' on a null object reference
      E/AndroidRuntime(16078): 	at com.android.okio.OkBuffer.write(OkBuffer.java:574)
      E/AndroidRuntime(16078): 	at com.android.okio.OkBuffer.read(OkBuffer.java:610)
      E/AndroidRuntime(16078): 	at com.android.okio.RealBufferedSource.read(RealBufferedSource.java:53)
      E/AndroidRuntime(16078): 	at com.android.okhttp.internal.http.HttpConnection$FixedLengthSource.read(HttpConnection.java:442)
      E/AndroidRuntime(16078): 	at com.android.okhttp.internal.Util.skipAll(Util.java:227)
      E/AndroidRuntime(16078): 	at com.android.okhttp.internal.http.HttpConnection.discard(HttpConnection.java:212)
      E/AndroidRuntime(16078): 	at com.android.okhttp.internal.http.HttpConnection$FixedLengthSource.close(HttpConnection.java:464)
      E/AndroidRuntime(16078): 	at com.android.okhttp.internal.Util.closeQuietly(Util.java:97)
      E/AndroidRuntime(16078): 	at com.android.okhttp.internal.http.HttpEngine.close(HttpEngine.java:433)
      E/AndroidRuntime(16078): 	at com.android.okhttp.internal.http.HttpURLConnectionImpl.disconnect(HttpURLConnectionImpl.java:113)
      E/AndroidRuntime(16078): 	at org.apache.cordova.filetransfer.FileTransfer$5.run(FileTransfer.java:950)
      E/AndroidRuntime(16078): 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
      E/AndroidRuntime(16078): 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
      E/AndroidRuntime(16078): 	at java.lang.Thread.run(Thread.java:818)
      E/FileTransfer(16078): {"code":3,"source":"http:\/\/cordova.apache.org\/downloads\/logos_2.zip","target":"file:\/\/\/data\/data\/org.apache.mobilespec\/files\/files\/testFile.txt","http_status":200,"exception":"Attempt to read from field 'int com.android.okio.Segment.limit' on a null object reference"}
      E/FileTransfer(16078): java.lang.NullPointerException: Attempt to read from field 'int com.android.okio.Segment.limit' on a null object reference
      E/FileTransfer(16078): 	at com.android.okio.OkBuffer.write(OkBuffer.java:574)
      E/FileTransfer(16078): 	at com.android.okio.OkBuffer.read(OkBuffer.java:610)
      E/FileTransfer(16078): 	at com.android.okio.RealBufferedSource.read(RealBufferedSource.java:53)
      E/FileTransfer(16078): 	at com.android.okhttp.internal.http.HttpConnection$FixedLengthSource.read(HttpConnection.java:442)
      E/FileTransfer(16078): 	at com.android.okhttp.internal.Util.skipAll(Util.java:227)
      E/FileTransfer(16078): 	at com.android.okhttp.internal.http.HttpConnection.discard(HttpConnection.java:212)
      E/FileTransfer(16078): 	at com.android.okhttp.internal.http.HttpConnection$FixedLengthSource.close(HttpConnection.java:464)
      E/FileTransfer(16078): 	at com.android.okio.RealBufferedSource.close(RealBufferedSource.java:198)
      E/FileTransfer(16078): 	at com.android.okio.RealBufferedSource$1.close(RealBufferedSource.java:181)
      E/FileTransfer(16078): 	at java.io.FilterInputStream.close(FilterInputStream.java:64)
      E/FileTransfer(16078): 	at org.apache.cordova.filetransfer.FileTransfer.safeClose(FileTransfer.java:516)
      E/FileTransfer(16078): 	at org.apache.cordova.filetransfer.FileTransfer.access$300(FileTransfer.java:69)
      E/FileTransfer(16078): 	at org.apache.cordova.filetransfer.FileTransfer$4.run(FileTransfer.java:843)
      E/FileTransfer(16078): 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
      E/FileTransfer(16078): 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
      E/FileTransfer(16078): 	at java.lang.Thread.run(Thread.java:818)
      W/ActivityManager(  404):   Force finishing activity org.apache.mobilespec/.MainActivity
      D/CordovaActivity(16078): Paused the activity.
      D/XWalkCordovaWebView(16078): Handle the pause
      D/mali_winsys(  947): new_window_surface returns 0x3000
      E/FileTransfer(16078): {"code":1,"source":"http:\/\/cordova.apache.org\/downloads\/BlueZedEx.mp3","target":"file:\/\/\/data\/data\/org.apache.mobilespec\/files\/files\/testFile.txt","body":"<!DOCTYPE HTML PUBLIC \"-\/\/IETF\/\/DTD HTML 2.0\/\/EN\">\n<html><head>\n<title>400 Bad Request<\/title>\n<\/head><body>\n<h1>Bad Request<\/h1>\n<p>Your browser sent a request that this server could not understand.<br \/>\n<\/p>\n<hr>\n<address>Apache\/2.4.12 (Unix) OpenSSL\/1.0.1l Server at www.apache.org Port 80<\/address>\n<\/body><\/html>","http_status":400,"exception":"http:\/\/cordova.apache.org\/downloads\/BlueZedEx.mp3"}
      E/FileTransfer(16078): java.io.FileNotFoundException: http://cordova.apache.org/downloads/BlueZedEx.mp3
      E/FileTransfer(16078): 	at com.android.okhttp.internal.http.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:197)
      E/FileTransfer(16078): 	at org.apache.cordova.filetransfer.FileTransfer.getInputStream(FileTransfer.java:527)
      E/FileTransfer(16078): 	at org.apache.cordova.filetransfer.FileTransfer.access$400(FileTransfer.java:69)
      E/FileTransfer(16078): 	at org.apache.cordova.filetransfer.FileTransfer$4.run(FileTransfer.java:814)
      E/FileTransfer(16078): 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
      E/FileTransfer(16078): 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
      E/FileTransfer(16078): 	at java.lang.Thread.run(Thread.java:818)
      E/chromium(16078): [ERROR:unix_domain_client_socket_posix.cc(101)] Not implemented reached in virtual int net::UnixDomainClientSocket::GetPeerAddress(net::IPEndPoint*) const
      E/chromium(16078): [ERROR:unix_domain_client_socket_posix.cc(101)] Not implemented reached in virtual int net::UnixDomainClientSocket::GetPeerAddress(net::IPEndPoint*) const
      D/CordovaActivity(16078): CordovaActivity.onDestroy()
      W/ScreenOrientationListener(16078): Removing an inexistent observer!
      

      Attachments

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            agrieve Andrew Grieve
            iclelland Ian Clelland
            Votes:
            0 Vote for this issue
            Watchers:
            8 Stop watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment