Granted, this is an unspeakably bad thing to do in javascript, but starting/stopping this composition multiple times will cause QC to crash.

Attachment: badJS.qtz
Description: application/quartzcomposer




Steps:
   * load the composition
   * open the viewer
* cmd-., cmd-r repeatedly (sometimes it only takes a couple cycles, sometimes more than a dozen).

The pertinent script is:

var rand = Math.random();
Log("rand:"+rand);
if(rand > 0.5)
{
        eval("\
        function doStuff(){return 42;}\
        function (__number outputNumber) main (__number inputNumber[2])\
        {\
                var result = new Object();\
                result.outputNumber = doStuff();\
                return result;\
        }");
}
else
{
        eval("function (__number cool) main (__number what)\
        {\
                var result = new Object();\
                result.outputNumber = 24;\
                return result;\
        }");
}

(Yes, you'd never have a reason ever to do anything like this in real life that I can think of, but crashing might be a problem)

backtrace varies, either calling a null function (top address is 0x00000000), or sometimes JSObjectCallAsFunction, as in:
Thread 0 Crashed:
0 com.apple.JavaScriptCore 0x95bfd764 JSObjectCallAsFunction + 260
1   libobjc.A.dylib                     0x9247d800 0x9243c000 + 268288

Can anyone else reproduce this?

--
[ christopher wright ]
[email protected]
http://kineme.net/

Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to