damonkohler / sl4a

SL4A brings scripting languages to Android by allowing you to edit and execute scripts and interactive interpreters directly on the Android device.
Apache License 2.0
2.42k stars 803 forks source link

Invalid triggers crash #180

Open damonkohler opened 9 years ago

damonkohler commented 9 years ago

From @GoogleCodeExporter on May 31, 2015 11:28

What device(s) are you experiencing the problem on?
Motorola Droid

What steps will reproduce the problem?
1. Create a python script with the line "droid.scheduleRelative('wrong.py', 10, 
True)", where 'wrong.py' can apparently be any path that doesn't exist.
2. Run the script; 10 seconds later, SL4A crashes
3. Try launching SL4A again; it notifies you that it's launching the triggers, 
and immediately crashes
4. Also, if you wait around long enough, it'll show the same notification and 
same crash.

What is the expected output? What do you see instead?
I dunno what the "right" thing to do is - log the error somewhere? Pop up a 
failure dialog? But force crashing is a bad idea, especially because I can't go 
in and cancel the trigger (because it tries to run it again and crashes again 
every time I open SL4A).

What version of the product are you using? On what operating system?
SL4A version 3, on Android version 2.2.1

Please provide any additional information below.
Any time I launch it, the following appears in the log:

I/ActivityManager( 1086): Starting activity: Intent { 
act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] 
flg=0x10200000 cmp=com.googlecode.android_scripting/.activity.ScriptManager 
bnds=[5,260][115,378] }
I/ActivityManager( 1086): Start proc com.googlecode.android_scripting for 
activity com.googlecode.android_scripting/.activity.ScriptManager: pid=3061 
uid=10041 gids={3003, 1015, 1007, 3002, 3001, 1006}
I/ActivityThread( 3061): Publishing provider 
com.googlecode.android_scripting.provider.apiprovider: 
com.googlecode.android_scripting.provider.ApiProvider
D/dalvikvm( 3061): GC_FOR_MALLOC freed 8336 objects / 378544 bytes in 59ms
I/ActivityThread( 3061): Publishing provider 
com.googlecode.android_scripting.provider.scriptprovider: 
com.googlecode.android_scripting.provider.ScriptProvider
I/global  ( 3061): Default buffer size used in BufferedReader constructor. It 
would be better to be explicit if an 8k-char buffer is required.
I/global  ( 3061): Default buffer size used in BufferedReader constructor. It 
would be better to be explicit if an 8k-char buffer is required.
V/sl4a.InterpreterConfiguration$InterpreterListener:127( 3061): Interpreter 
discovered: com.googlecode.pythonforandroid
V/sl4a.InterpreterConfiguration$InterpreterListener:127( 3061): Binary: 
/data/data/com.googlecode.pythonforandroid/files/python/bin/python
I/global  ( 3061): Default buffer size used in BufferedReader constructor. It 
would be better to be explicit if an 8k-char buffer is required.
I/global  ( 3061): Default buffer size used in BufferedReader constructor. It 
would be better to be explicit if an 8k-char buffer is required.
D/dalvikvm( 3061): GC_FOR_MALLOC freed 5801 objects / 432312 bytes in 58ms
V/sl4a.InterpreterConfiguration$InterpreterListener:127( 3061): Interpreter 
discovered: com.googlecode.pythonforandroid
V/sl4a.InterpreterConfiguration$InterpreterListener:127( 3061): Binary: 
/data/data/com.googlecode.pythonforandroid/files/python/bin/python
V/sl4a.FileUtils:119( 3061): Creating directory: scripts
E/sl4a.FileUtils:121( 3061): Failed to create directory.
D/AndroidRuntime( 3061): Shutting down VM
W/dalvikvm( 3061): threadid=1: thread exiting with uncaught exception 
(group=0x4001d7e0)
E/AndroidRuntime( 3061): FATAL EXCEPTION: main
E/AndroidRuntime( 3061): java.lang.RuntimeException: Unable to start activity 
ComponentInfo{com.googlecode.android_scripting/com.googlecode.android_scripting.
activity.ScriptManager}: java.lang.RuntimeException: Failed to create scripts 
directory.
E/AndroidRuntime( 3061):        at 
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
E/AndroidRuntime( 3061):        at 
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
E/AndroidRuntime( 3061):        at 
android.app.ActivityThread.access$2300(ActivityThread.java:125)
E/AndroidRuntime( 3061):        at 
android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
E/AndroidRuntime( 3061):        at 
android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 3061):        at android.os.Looper.loop(Looper.java:123)
E/AndroidRuntime( 3061):        at 
android.app.ActivityThread.main(ActivityThread.java:4627)
E/AndroidRuntime( 3061):        at java.lang.reflect.Method.invokeNative(Native 
Method)
E/AndroidRuntime( 3061):        at 
java.lang.reflect.Method.invoke(Method.java:521)
E/AndroidRuntime( 3061):        at 
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)
E/AndroidRuntime( 3061):        at 
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
E/AndroidRuntime( 3061):        at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime( 3061): Caused by: java.lang.RuntimeException: Failed to 
create scripts directory.
E/AndroidRuntime( 3061):        at 
com.googlecode.android_scripting.activity.ScriptManager.onCreate(ScriptManager.j
ava:112)
E/AndroidRuntime( 3061):        at 
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
E/AndroidRuntime( 3061):        at 
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
E/AndroidRuntime( 3061):        ... 11 more
W/ActivityManager( 1086):   Force finishing activity 
com.googlecode.android_scripting/.activity.ScriptManager
W/ActivityManager( 1086): Activity pause timeout for HistoryRecord{44ca3d00 
com.googlecode.android_scripting/.activity.ScriptManager}

Original issue reported on code.google.com by dplep...@gmail.com on 6 Jan 2011 at 10:48

Copied from original issue: damonkohler/android-scripting#499

damonkohler commented 9 years ago

From @GoogleCodeExporter on May 31, 2015 11:28

SL4A r6 has similar problems (for valid and invalid triggers). If this happens 
https://groups.google.com/d/msg/android-scripting/QiYvAW-Ib3w/kFNLPcOBFrYJ 
documents a workaround:

clearing the application data
(Settings > Applications > Manage > Downloads > SL4A > Clear Data)
seems to fix the problem (though it also deletes preferences, etc.)

I've had this happen to me a couple of times with r6.

Original comment by clac...@gmail.com on 11 Aug 2012 at 12:28