Too Deep Recursion
I am trying to get debugging working for the first time in Ti Studio using the 1.7.1 release and Android. When I launch my app (which works fine when run without debugging), it force closes on this error:
D/TiDebugSession( 1120): (Thread-11) [9,2100] rcvd request: 71*1308851347022*breakpoint*create*app:/views/vehicle/details.js*37*0*0**1
D/TiFastDev( 1120): (Thread-11) [26,2126] sent tokens successfully
I/dalvikvm( 1120): threadid=10: stack overflow on call to Ljava/lang/Character;.isJavaIdentifierStart:ZI
I/dalvikvm( 1120): method requires 36+20+4=60 bytes, fp is 0x430cc338 (56 left)
I/dalvikvm( 1120): expanding stack end (0x430cc300 to 0x430cc000)
I/dalvikvm( 1120): Shrank stack (to 0x430cc300, curFrame is 0x430cc824)
D/dalvikvm( 1120): GC_FOR_MALLOC freed 6130 objects / 467520 bytes in 108ms
W/dalvikvm( 1120): threadid=10: thread exiting with uncaught exception (group=0x4001d800)
E/TiUncaughtHandler( 1120): (Thread-11) [635,2761] Sending event: exception on thread: Thread-11 msg:org.mozilla.javascript.EvaluatorException: Too deep recursion while parsing (file:///android_asset/Resources/views/vehicle/details.js#289); Titanium 1.7.1,2011/06/21 14:28,293a6d
E/TiUncaughtHandler( 1120): org.mozilla.javascript.EvaluatorException: Too deep recursion while parsing (file:///android_asset/Resources/views/vehicle/details.js#289)
E/TiUncaughtHandler( 1120): at org.mozilla.javascript.DefaultErrorReporter.runtimeError(DefaultErrorReporter.java:109)
E/TiUncaughtHandler( 1120): at org.mozilla.javascript.Context.reportRuntimeError(Context.java:945)
E/TiUncaughtHandler( 1120): at org.mozilla.javascript.Parser.parse(Parser.java:587)
E/TiUncaughtHandler( 1120): at org.mozilla.javascript.Parser.parse(Parser.java:506)
E/TiUncaughtHandler( 1120): at org.mozilla.javascript.Context.compileImpl(Context.java:2401)
E/TiUncaughtHandler( 1120): at org.mozilla.javascript.Context.compileString(Context.java:1367)
E/TiUncaughtHandler( 1120): at org.mozilla.javascript.Context.compileString(Context.java:1356)
E/TiUncaughtHandler( 1120): at org.mozilla.javascript.tools.debugger.Dim$DimIProxy.run(Dim.java:1027)
E/TiUncaughtHandler( 1120): at org.mozilla.javascript.Context.call(Context.java:521)
E/TiUncaughtHandler( 1120): at org.mozilla.javascript.ContextFactory.call(ContextFactory.java:535)
E/TiUncaughtHandler( 1120): at org.mozilla.javascript.tools.debugger.Dim$DimIProxy.withContext(Dim.java:1078)
E/TiUncaughtHandler( 1120): at org.mozilla.javascript.tools.debugger.Dim$DimIProxy.access$3(Dim.java:1077)
E/TiUncaughtHandler( 1120): at org.mozilla.javascript.tools.debugger.Dim.compileScript(Dim.java:667)
E/TiUncaughtHandler( 1120): at ti.modules.titanium.debug.DebugServer.c(Unknown Source)
E/TiUncaughtHandler( 1120): at ti.modules.titanium.debug.DebugServer.b(Unknown Source)
E/TiUncaughtHandler( 1120): at ti.modules.titanium.debug.handlers.a.a(Unknown Source)
E/TiUncaughtHandler( 1120): at ti.modules.titanium.debug.h.b(Unknown Source)
E/TiUncaughtHandler( 1120): at ti.modules.titanium.debug.h.run(Unknown Source)
I added this to my tiapp.xml but it had no effect:
<property name="ti.android.threadstacksize" type="int">327680</property>
Was anyone else able to get debugging working? What am I missing?
7 Answers
-
Now that you've added the stack size property, run a clean on your project then rebuild.
-
@Anthony - Same issue after clean…
-
Seems 'ti.android.threadstacksize' should be 32768 rather than 327680 !?
-
could you post details.js ? for some advice …
-
Here is details.js, however there are a bunch of shared controls so this isn't all of the code. Keep in mind that running it normally on the simulator or on the device works fine, only debugging gives the recursion error so it makes me think it doesn't have to do with my code at all.
http://pastebin.com/muzqYC25
-
Justin
Please take note of this advice in the docs: Avoid deep nesting
Setting
threadstacksize
to very large values is likely to cause problems; 128K or lower is recommended.Hope this helps
-
Are you using the MYAPP.os funciton/macro from the Tweetanium app? I had been using it in my mediaplayer file, but began getting too deep recursion errors on android. Once I shopped out to a playerview_ios.js and a playerview_android.js, I was fine. Check the file you're getting the error from and consider splitting the android and ios logic up into separate files. At Ti.include time, conditionally include ONLY the proper file.