newtonandebe / opendatakit

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

False negative in Validate regarding relevant="selected()" #111

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Errors in the syntax of the bindings are not caught by ODK Validate or 
Aggregate, but when you try to enter data in collect it crashes the application.

Someone on our team was trying to make skip logic for "not option c" using the 
following:
relevant="selected(../question1, 'a', 'b')"
when he should have written:
relevant="not(selected(../question1, 'c'))"

Validate claimed the form was valid, but when tried to run on a phone, or the 
emulator, the program crashes.  Here is a partial debugger log/stack trace:

08-23 11:55:16.926 I/ActivityManager( 2261): Displayed activity 
org.odk.collect.android/.activities.FormEntryActivity: 375 ms (total 375 ms)
08-23 11:55:17.046 D/dalvikvm(22623): GC freed 8747 objects / 523752 bytes in 
40ms
08-23 11:55:17.246 I/System.out(22623): Title: "Test Form"
08-23 11:55:17.376 D/dalvikvm(22623): GC freed 9951 objects / 445840 bytes in 
41ms
08-23 11:55:17.541 D/dalvikvm(22623): GC freed 23535 objects / 938032 bytes in 
45ms
08-23 11:55:17.711 D/dalvikvm(22623): GC freed 32449 objects / 1300264 bytes in 
40ms
08-23 11:55:17.711 I/dalvikvm-heap(22623): Grow heap (frag case) to 6.442MB for 
88779-byte allocation
08-23 11:55:17.746 D/dalvikvm(22623): GC freed 0 objects / 0 bytes in 34ms
08-23 11:55:17.926 W/dalvikvm(22623): threadid=21: thread exiting with uncaught 
exception (group=0x4001dc20)
08-23 11:55:17.926 E/AndroidRuntime(22623): Uncaught handler: thread AsyncTask 
#4 exiting due to uncaught exception
08-23 11:55:17.936 E/AndroidRuntime(22623): java.lang.RuntimeException: An 
error occured while executing doInBackground()
08-23 11:55:17.936 E/AndroidRuntime(22623):     at 
android.os.AsyncTask$3.done(AsyncTask.java:200)
08-23 11:55:17.936 E/AndroidRuntime(22623):     at 
java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:273)
08-23 11:55:17.936 E/AndroidRuntime(22623):     at 
java.util.concurrent.FutureTask.setException(FutureTask.java:124)
08-23 11:55:17.936 E/AndroidRuntime(22623):     at 
java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:307)
08-23 11:55:17.936 E/AndroidRuntime(22623):     at 
java.util.concurrent.FutureTask.run(FutureTask.java:137)
08-23 11:55:17.936 E/AndroidRuntime(22623):     at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1068)
08-23 11:55:17.936 E/AndroidRuntime(22623):     at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:561)
08-23 11:55:17.936 E/AndroidRuntime(22623):     at 
java.lang.Thread.run(Thread.java:1096)
08-23 11:55:17.936 E/AndroidRuntime(22623): Caused by: 
org.javarosa.xpath.XPathUnhandledException: XPath evaluation: cannot handle 
function 'selected'
08-23 11:55:17.936 E/AndroidRuntime(22623):     at 
org.javarosa.xpath.expr.XPathFuncExpr.eval(XPathFuncExpr.java:155)
08-23 11:55:17.936 E/AndroidRuntime(22623):     at 
org.javarosa.xpath.XPathConditional.evalRaw(XPathConditional.java:57)
08-23 11:55:17.936 E/AndroidRuntime(22623):     at 
org.javarosa.xpath.XPathConditional.eval(XPathConditional.java:61)
08-23 11:55:17.936 E/AndroidRuntime(22623):     at 
org.javarosa.core.model.condition.Condition.eval(Condition.java:63)
08-23 11:55:17.936 E/AndroidRuntime(22623):     at 
org.javarosa.core.model.condition.Triggerable.apply(Triggerable.java:57)
08-23 11:55:17.936 E/AndroidRuntime(22623):     at 
org.javarosa.core.model.FormDef.evaluateTriggerable(FormDef.java:503)
08-23 11:55:17.936 E/AndroidRuntime(22623):     at 
org.javarosa.core.model.FormDef.evaluateTriggerables(FormDef.java:493)
08-23 11:55:17.936 E/AndroidRuntime(22623):     at 
org.javarosa.core.model.FormDef.initializeTriggerables(FormDef.java:450)
08-23 11:55:17.936 E/AndroidRuntime(22623):     at 
org.javarosa.core.model.FormDef.initializeTriggerables(FormDef.java:428)
08-23 11:55:17.936 E/AndroidRuntime(22623):     at 
org.javarosa.core.model.FormDef.initialize(FormDef.java:794)
08-23 11:55:17.936 E/AndroidRuntime(22623):     at 
org.odk.collect.android.logic.FormHandler.preProcessForm(FormHandler.java:480)
08-23 11:55:17.936 E/AndroidRuntime(22623):     at 
org.odk.collect.android.tasks.FormLoaderTask.doInBackground(FormLoaderTask.java:
97)
08-23 11:55:17.936 E/AndroidRuntime(22623):     at 
org.odk.collect.android.tasks.FormLoaderTask.doInBackground(FormLoaderTask.java:
1)
08-23 11:55:17.936 E/AndroidRuntime(22623):     at 
android.os.AsyncTask$2.call(AsyncTask.java:185)
08-23 11:55:17.936 E/AndroidRuntime(22623):     at 
java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
08-23 11:55:17.936 E/AndroidRuntime(22623):     ... 4 more
08-23 11:55:17.936 I/Process ( 2261): Sending signal. PID: 22623 SIG: 3
08-23 11:55:17.941 I/dalvikvm(22623): threadid=7: reacting to signal 3
08-23 11:55:18.301 I/ANDROID_DEBUG( 2261): dumpmesg > 
/data/log/dumpstate_app_201008231155_org_odk_collect_android.log
08-23 11:55:18.651 I/dalvikvm(22623): Wrote stack trace to 
'/data/anr/traces.txt'
08-23 11:55:18.696 I/dumpstate(22641): begin
08-23 11:55:19.496 W/PowerManagerService( 2261): Timer 0x7->0x3|0x0
08-23 11:55:19.496 I/PowerManagerService( 2261): ULight 7->3 f0
------ VM TRACES ------

Original issue reported on code.google.com by duffy.ti...@gmail.com on 23 Aug 2010 at 11:49

GoogleCodeExporter commented 9 years ago
sorry for the long delay. the collect 1.1.7 and validate 1.4 should have fixed 
these issues. try them at http://code.google.com/p/opendatakit/downloads/list 
and if you are still having problems, please post a form that has the issue to 
re-open the ticket and i'll make it a high priority.

Original comment by yanokwa on 13 Jul 2011 at 7:48