AlmightyMegadeth00 / omnidroid

Automatically exported from code.google.com/p/omnidroid
Apache License 2.0
0 stars 1 forks source link

Database not properly closed at HandlerService #103

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Trigger a rule.

What is the expected output? What do you see instead?
The logs will say that a leak is detected because a database is not properly 
closed. The timing to make this happen is not clear, but once it happens, it 
will happen 100% afterwards.

Excerpt from logs
E/Database(  285): Leak found

E/Database(  285): java.lang.IllegalStateException: 
/data/data/edu.nyu.cs.omnidroid.app/databases/omnidroid SQLiteDatabase created 
and never closed

E/Database(  285):  at 
android.database.sqlite.SQLiteDatabase.<init>(SQLiteDatabase.java:1694)

E/Database(  285):  at 
android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:738)

E/Database(  285):  at 
android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:
760)

E/Database(  285):  at 
android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:
753)

E/Database(  285):  at 
android.app.ApplicationContext.openOrCreateDatabase(ApplicationContext.java:473)

E/Database(  285):  at 
android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:193)

E/Database(  285):  at 
android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.ja
va:98)

E/Database(  285):  at 
edu.nyu.cs.omnidroid.app.model.CoreLogsDbHelper.<init>(CoreLogsDbHelper.java:53)

E/Database(  285):  at 
edu.nyu.cs.omnidroid.app.model.CoreGeneralLogsDbHelper.<init>(CoreGeneralLogsDbH
elper.java:40)

E/Database(  285):  at 
edu.nyu.cs.omnidroid.app.model.GeneralLog.<init>(GeneralLog.java:39)

E/Database(  285):  at 
edu.nyu.cs.omnidroid.app.controller.HandlerService.onStart(HandlerService.java:8
7)

Original issue reported on code.google.com by renc...@gmail.com on 29 Jun 2010 at 5:46

Attachments:

GoogleCodeExporter commented 8 years ago
Looks like this is caused by open db connects in my log classes, I'll take a 
look and see if I can plug the leak in my code.

Original comment by case.and...@gmail.com on 30 Jun 2010 at 3:51

GoogleCodeExporter commented 8 years ago
Potential fix in code review: http://codereview.appspot.com/1705052/show

Original comment by case.and...@gmail.com on 30 Jun 2010 at 4:23

GoogleCodeExporter commented 8 years ago
Let me know if you notice this again after you get the updated code.  I'm going 
to assume this fixes it though until proven otherwise.

r784

Original comment by case.and...@gmail.com on 30 Jun 2010 at 11:47