Giter VIP home page Giter VIP logo

Comments (5)

GoogleCodeExporter avatar GoogleCodeExporter commented on August 19, 2024

Original comment by [email protected] on 27 May 2010 at 2:55

  • Changed state: Started

from omnidroid.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 19, 2024
Start to take a look at this issue.

Original comment by [email protected] on 16 Jun 2010 at 3:55

from omnidroid.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 19, 2024
Code review at:
http://codereview.appspot.com/1717045

Caused by:
Exception is caused by database cursor objects being left open even when not in 
use. Excerpt from the logs:
06-16 16:36:27.458: INFO/dalvikvm(234): Uncaught exception thrown by finalizer 
(will be discarded):
06-16 16:36:27.458: INFO/dalvikvm(234): Ljava/lang/IllegalStateException;: 
Finalizing cursor android.database.sqlite.SQLiteCursor@43818050 on 
RegisteredApps that has not been deactivated or closed
06-16 16:36:27.458: INFO/dalvikvm(234):     at 
android.database.sqlite.SQLiteCursor.finalize(SQLiteCursor.java:596)
06-16 16:36:27.458: INFO/dalvikvm(234):     at 
dalvik.system.NativeStart.run(Native Method)

Another similar problem is found where the database object itself is left open 
even when not in use. Excerpt from the logs:

06-16 16:14:21.893: ERROR/Database(233): Leak found
06-16 16:14:21.893: ERROR/Database(233): java.lang.IllegalStateException: 
/data/data/edu.nyu.cs.omnidroid.app/databases/omnidroid SQLiteDatabase created 
and never closed
06-16 16:14:21.893: ERROR/Database(233):     at 
android.database.sqlite.SQLiteDatabase.<init>(SQLiteDatabase.java:1581)
06-16 16:14:21.893: ERROR/Database(233):     at 
android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:638)
06-16 16:14:21.893: ERROR/Database(233):     at 
android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:
659)
06-16 16:14:21.893: ERROR/Database(233):     at 
android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:
652)
06-16 16:14:21.893: ERROR/Database(233):     at 
android.app.ApplicationContext.openOrCreateDatabase(ApplicationContext.java:482)
06-16 16:14:21.893: ERROR/Database(233):     at 
android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:193)
06-16 16:14:21.893: ERROR/Database(233):     at 
android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.ja
va:98)
06-16 16:14:21.893: ERROR/Database(233):     at 
edu.nyu.cs.omnidroid.app.model.CoreRuleDbHelper.<init>(CoreRuleDbHelper.java:65)
06-16 16:14:21.893: ERROR/Database(233):     at 
edu.nyu.cs.omnidroid.app.controller.HandlerService.onStart(HandlerService.java:5
8)
06-16 16:14:21.893: ERROR/Database(233):     at 
android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2776)
06-16 16:14:21.893: ERROR/Database(233):     at 
android.app.ActivityThread.access$3400(ActivityThread.java:116)
06-16 16:14:21.893: ERROR/Database(233):     at 
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1855)
06-16 16:14:21.893: ERROR/Database(233):     at 
android.os.Handler.dispatchMessage(Handler.java:99)
06-16 16:14:21.893: ERROR/Database(233):     at 
android.os.Looper.loop(Looper.java:123)
06-16 16:14:21.893: ERROR/Database(233):     at 
android.app.ActivityThread.main(ActivityThread.java:4203)
06-16 16:14:21.893: ERROR/Database(233):     at 
java.lang.reflect.Method.invokeNative(Native Method)
06-16 16:14:21.893: ERROR/Database(233):     at 
java.lang.reflect.Method.invoke(Method.java:521)
06-16 16:14:21.893: ERROR/Database(233):     at 
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)
06-16 16:14:21.893: ERROR/Database(233):     at 
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)
06-16 16:14:21.893: ERROR/Database(233):     at 
dalvik.system.NativeStart.main(Native Method)

Summary of changes:
Made sure that database cursor objects are closed when they are not needed 
after acquiring them. Same thing also applies to database objects.

Test Cases (must check the logs that no exception occurs while performing 
these):
1. Go all types of screens while creating a new rule - root event, add action, 
add filter.
2. With Omnidroid active, go to home and open another application. Go back to 
home and re-open Omnidroid.
3. Open Omnidroid and proceed to any screen as deep as possible. Keep on 
pressing back until you reach the home screen and reopen Omnidroid again.

Original comment by [email protected] on 18 Jun 2010 at 2:29

from omnidroid.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 19, 2024
Forgot to add one more test case:
4. Trigger a saved rule.

Original comment by [email protected] on 19 Jun 2010 at 2:06

from omnidroid.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 19, 2024
Checked-in on r757.

Original comment by [email protected] on 19 Jun 2010 at 3:09

  • Changed state: Fixed

from omnidroid.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.