10 Replies Latest reply on Dec 8, 2014 1:39 AM by Bart Fukkink

    Possible database problems on Samsung devices

    Bart Fukkink

      Good day!


      In our application we made a system that automatically collects software errors and sends them to our bug tracking system. In this bug tracker, we are seeing some wierd behaviour on some Samsung Android devices.

      So far we have seen it on 3 different devices:

      * Samsung Galaxy S4 (samsung jfvelte)
      * Samsung Galaxy Tab Pro 8.4 LTE (samsung mondrianlte)
      * Samsung Galaxy Tab Pro 10.1 LTE (samsung picassolte)

      They all run on Android 4.4.2 (KitKat) and the error we recieve is this:

      ArgumentError: could not execute statement: 14; Message: unable to open database file
          lib/RhoDatabaseApi.rb:174:in `execute'
          lib/RhoDatabaseApi.rb:174:in `_execute_sql'
          lib/RhoDatabaseApi.rb:133:in `executeSql'
          lib/RhoDatabaseApi.rb:377:in `update_into_table'
          lib/rhom/rhom_object_factory.rb:1643:in `block in save'
          lib/rhom/rhom_object_factory.rb:1592:in `each'
          lib/rhom/rhom_object_factory.rb:1592:in `save'


      We currently dont have any of the Samsung devices here to test on, but from the reports that we see, this error does not occur on a specific action. It happens in different parts of the application.


      Oh, and our app is build with RhoStudio 4.1. We currently have no option to test it in RhoStudio 5.0 yet.

      Does anyone have any clue on what might cause this problem?



        • Re: Possible database problems on Samsung devices
          Kutir Mobility


          We are trying to analyse the root of the issue. We think it could be that the database ram is full ? - but not sure. I will get back to you.


          Visnupriya R

          Kutir Mobility

            • Re: Possible database problems on Samsung devices
              Bart Fukkink

              Hello Visnupriya,


              Sadly I have no other information besides the Android version, the device name, the moment the error occured and the stacktrace.


              I know this is quite limited information, so if you guys cannot figure out why this happens, maybe we have to see if we can get one of the devices from our customer and hook it up to our debug application.


              Thanks for looking into it!



                • Re: Possible database problems on Samsung devices
                  Kutir Mobility

                  Hi Bart


                  Did you had chance to collect more information from that specific customer device?


                  Thank you.

                  Visnupriya R

                  Kutir Mobility

                    • Re: Re: Possible database problems on Samsung devices
                      Bart Fukkink

                      Hey Visnupriya,


                      Thanks to some great effort from several people we managed to exchange one of our test devices with the Samsung Galaxy Tab Pro of our customer. We are currently testing if we can find what is causing the problems. So far it seems quite random (we have no reliable methods of recreating the error messages. But when running the Android LogCat we did get some nice error messages that are very interresting.


                      11-07 15:44:14.030: W/GraphicBufferAllocator(5786): alloc(256, 192, 1, 00000133, 0 ...) failed -24 (Too many open files)
                      11-07 15:44:14.030: E/qdmemalloc(5786): alloc_buffer: ION_IOC_MAP failed with error - Too many open files
                      11-07 15:44:14.030: W/qdmemalloc(5786): Falling back to system heap
                      11-07 15:44:14.030: E/qdmemalloc(5786): alloc_buffer: ION_IOC_MAP failed with error - Too many open files
                      11-07 15:44:14.030: E/qdgralloc(5786): gralloc failed err=Too many open files


                      This happens when we normally use our application and click around several screens. At a certain point (cause unknown) the screen freezes and these error messages begin to appear in the log. After several seconds, the application crashes.Then Android takes over and attempts to restart the application, but the database appears to be in use still, and that is what is causing the Unable to open database errors.


                      Thanks for checking back in, but I dont have a lot of new information... Have you been able to find anything?


                      Edit: I found an error message with stacktrace in the log aswell:


                      11-07 15:44:14.020: E/Surface(5786): dequeueBuffer failed (Unknown error 2147483646)
                      11-07 15:44:14.020: E/ViewRootImpl(5786): Could not lock surface
                      11-07 15:44:14.020: E/ViewRootImpl(5786): java.lang.IllegalArgumentException
                      11-07 15:44:14.020: E/ViewRootImpl(5786): at android.view.Surface.nativeLockCanvas(Native Method)
                      11-07 15:44:14.020: E/ViewRootImpl(5786): at android.view.Surface.lockCanvas(Surface.java:253)
                      11-07 15:44:14.020: E/ViewRootImpl(5786): at android.view.ViewRootImpl.drawSoftware(ViewRootImpl.java:2768)
                      11-07 15:44:14.020: E/ViewRootImpl(5786): at android.view.ViewRootImpl.draw(ViewRootImpl.java:2742)
                      11-07 15:44:14.020: E/ViewRootImpl(5786): at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2580)
                      11-07 15:44:14.020: E/ViewRootImpl(5786): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2152)
                      11-07 15:44:14.020: E/ViewRootImpl(5786): at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1233)
                      11-07 15:44:14.020: E/ViewRootImpl(5786): at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6483)
                      11-07 15:44:14.020: E/ViewRootImpl(5786): at android.view.Choreographer$CallbackRecord.run(Choreographer.java:803)
                      11-07 15:44:14.020: E/ViewRootImpl(5786): at android.view.Choreographer.doCallbacks(Choreographer.java:603)
                      11-07 15:44:14.020: E/ViewRootImpl(5786): at android.view.Choreographer.doFrame(Choreographer.java:573)
                      11-07 15:44:14.020: E/ViewRootImpl(5786): at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:789)
                      11-07 15:44:14.020: E/ViewRootImpl(5786): at android.os.Handler.handleCallback(Handler.java:733)
                      11-07 15:44:14.020: E/ViewRootImpl(5786): at android.os.Handler.dispatchMessage(Handler.java:95)
                      11-07 15:44:14.020: E/ViewRootImpl(5786): at android.os.Looper.loop(Looper.java:157)
                      11-07 15:44:14.020: E/ViewRootImpl(5786): at android.app.ActivityThread.main(ActivityThread.java:5377)
                      11-07 15:44:14.020: E/ViewRootImpl(5786): at java.lang.reflect.Method.invokeNative(Native Method)
                      11-07 15:44:14.020: E/ViewRootImpl(5786): at java.lang.reflect.Method.invoke(Method.java:515)
                      11-07 15:44:14.020: E/ViewRootImpl(5786): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1265)
                      11-07 15:44:14.020: E/ViewRootImpl(5786): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1081)
                      11-07 15:44:14.020: E/ViewRootImpl(5786): at dalvik.system.NativeStart.main(Native Method)



                • Re: Possible database problems on Samsung devices
                  Bart Fukkink

                  Hello Nicolas,


                  I can now confirm that Hardware Acceleration is the cause of the problems. Turning this off indeed fixes the random crashes that occur.


                  We have turned it off for now, but sadly we are back to our problems with canvas and trying to draw elements. I`ll put this up to Motorola aswell.


                  Thanks again for sharing the sollution!