okareshaba / openintents

Automatically exported from code.google.com/p/openintents
0 stars 0 forks source link

OI Safe: NullPointerException in DBHelper.fetchAllRows() #312

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Crash:
Exception class java.lang.NullPointerException
Source method DBHelper.fetchAllRows()

Platforms:
v1.2.6 2 reports

Stack traces:
v1.2.6
Jan 21, 2011 10:41:35 AM
2reports

java.lang.RuntimeException: Unable to start activity 
ComponentInfo{org.openintents.safe/org.openintents.safe.IntentHandler}: 
java.lang.NullPointerException
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
at android.app.ActivityThread.access$2300(ActivityThread.java:125)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:4627)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at 
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NullPointerException
at org.openintents.safe.DBHelper.fetchAllRows(DBHelper.java:490)
at org.openintents.safe.Passwords.InitPassEntries(Passwords.java:282)
at org.openintents.safe.Passwords.Initialize(Passwords.java:85)
at org.openintents.safe.IntentHandler.onCreate(IntentHandler.java:79)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
... 11 more

Original issue reported on code.google.com by peli0...@googlemail.com on 21 Jan 2011 at 10:38

GoogleCodeExporter commented 9 years ago

Original comment by peli0...@googlemail.com on 21 Jan 2011 at 10:44

GoogleCodeExporter commented 9 years ago
revision 3058 should prevent this NPE, but not really sure why the function was 
called prior to db initialization.

Original comment by rmce...@gmail.com on 23 Jan 2011 at 8:53

GoogleCodeExporter commented 9 years ago
Closed for now. Can be reopened if it appears again.

Original comment by peli0...@googlemail.com on 25 Jan 2011 at 10:36

GoogleCodeExporter commented 9 years ago
Happened again in v1.2.7:

v1.2.7
Jan 26, 2011 
5:53:06 AM
1 reports/week 
1reports 
--------------------------------------------------------------------------------

java.lang.RuntimeException: Unable to start activity 
ComponentInfo{org.openintents.safe/org.openintents.safe.IntentHandler}: 
java.lang.NullPointerException
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
at android.app.ActivityThread.access$2300(ActivityThread.java:125)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:4627)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at 
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NullPointerException
at org.openintents.safe.DBHelper.fetchAllCategoryRows(DBHelper.java:368)
at org.openintents.safe.Passwords.InitCategoryEntries(Passwords.java:151)
at org.openintents.safe.Passwords.Initialize(Passwords.java:89)
at org.openintents.safe.IntentHandler.onCreate(IntentHandler.java:81)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
... 11 more

--------------------------------------------------------------------------------

Original comment by peli0...@googlemail.com on 30 Jan 2011 at 1:44

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r3092.

Original comment by rmce...@gmail.com on 31 Jan 2011 at 2:16

GoogleCodeExporter commented 9 years ago
This is the same problem as issue 281.

Backed out revision 3092 and was able to duplicate the NPE by first removing 
all application data, then::

# cd /data/data/org.openintents.safe/databases
# dd if=/dev/zero of=nothing bs=128k
# dd if=/dev/zero of=nothing bs=128k
nothing: write error: No space left on device

Then launch Safe got got the same NPE::

E/AndroidRuntime(  282): Caused by: java.lang.NullPointerException
E/AndroidRuntime(  282):    at 
org.openintents.safe.DBHelper.fetchAllCategoryRows(DBHelper.java:370)
E/AndroidRuntime(  282):    at 
org.openintents.safe.Passwords.InitCategoryEntries(Passwords.java:151)
E/AndroidRuntime(  282):    at 
org.openintents.safe.Passwords.Initialize(Passwords.java:89)
E/AndroidRuntime(  282):    at 
org.openintents.safe.IntentHandler.onCreate(IntentHandler.java:81)
E/AndroidRuntime(  282):    at 
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
E/AndroidRuntime(  282):    at 
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)

Need to figure out a better way to handle with there is no more internal memory.

Original comment by rmce...@gmail.com on 1 Feb 2011 at 12:54

GoogleCodeExporter commented 9 years ago
Revision 3094 committed to add more checks to better handle this.

Original comment by rmce...@gmail.com on 3 Feb 2011 at 1:46