XojoScript Code Size Limitations?

In the process of switching my programs to using xojoscript instead of rbscript, I discovered a situation where the size of the xojoscript caused a crash. I was able to determine that it was size related (or number of lines related) by commenting out sections of the code that were not being used for a particular subroutine call. This suggests that the LLVM compiler may have a code size limit, but no such limit is mentioned in the documentation. This same script runs without problems under the non-LLVM rbscript compiler.

The subroutine causing the crash is only 382 lines long, although the entire xojo script is 445 lines long. Below is the crash report. Does this provide any insights?

My question to Xojo Inc. is whether there is a known size limitation on subroutines, functions of total scripts?

Thanks,
Bob

Machine: Macbook Pro running 10.8.5. with 16GB Ram, 2.7GHz Core i7
System crash report (top portion only…)
Exception Type: EXC_BAD_INSTRUCTION (SIGILL)
Exception Codes: 0x0000000000000001, 0x0000000000000000

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 RBScript.xojo_plugin_0.dylib 0x089f9bb7 0x818b000 + 8842167
1 RBScript.xojo_plugin_0.dylib 0x089f9b82 0x818b000 + 8842114
2 RBScript.xojo_plugin_0.dylib 0x089b984e 0x818b000 + 8579150
3 RBScript.xojo_plugin_0.dylib 0x089242ab 0x818b000 + 7967403
4 RBScript.xojo_plugin_0.dylib 0x089271ab 0x818b000 + 7979435
5 RBScript.xojo_plugin_0.dylib 0x089baf64 0x818b000 + 8585060
6 RBScript.xojo_plugin_0.dylib 0x089343ad 0x818b000 + 8033197
7 RBScript.xojo_plugin_0.dylib 0x089341b1 0x818b000 + 8032689
8 RBScript.xojo_plugin_0.dylib 0x0893451d 0x818b000 + 8033565
9 RBScript.xojo_plugin_0.dylib 0x086abcee 0x818b000 + 5377262
10 RBScript.xojo_plugin_0.dylib 0x089aa1b7 0x818b000 + 8516023
11 RBScript.xojo_plugin_0.dylib 0x089a96d3 0x818b000 + 8513235
12 RBScript.xojo_plugin_0.dylib 0x089a95a0 0x818b000 + 8512928
13 RBScript.xojo_plugin_0.dylib 0x0828ee7f 0x818b000 + 1064575
14 RBScript.xojo_plugin_0.dylib 0x0828f061 0x818b000 + 1065057
15 RBScript.xojo_plugin_0.dylib 0x0822d83a 0x818b000 + 665658
16 RBScript.xojo_plugin_0.dylib 0x08229eb6 0x818b000 + 650934
17 com.lambdagen.msrb 0x001ada0e XojoScript.Run%%o + 71
………

You should file a bug report and attach the whole crash report.

I have determined that the crash is due to the size of the function. I split it up into two parts, and now it runs without problems. So the LLVM Xojoscript compiler imposes a limit on the size of functions (and I presume subroutines as well).

I will submit a bug report. But is this a bug or simply a limitation of the LLVM compiler as implemented?

I doubt we can say until we see the Feedback case and sample script.

31280 - RBScript and XojoScript crash if a function is too large

Almost certainly a bug.

After filing I filed the bug report, Joe quickly figured out that it was not a size problem but rather my use of two identical labels inside the function. When that was fixed, the crash disappeared.

I guess this is why Joe gets paid the big bucks!

Thanks Joe for finding the problem so quickly. My apologies for the wild goose chase.