ccgus / CocoaScript

JavaScript + the Cocoa frameworks, and then ObjC brackets show up to party as well.
Other
618 stars 58 forks source link

OpenCL Desaturate.jstalk crashes #6

Closed kjk closed 10 years ago

kjk commented 10 years ago

I'm running Cocoa Script Editor from inside XCode 5.0.2 on OS X 10.9.1.

The sample OpenCL Desaturate.jstalk crashes for me on the third time it's executed i.e.:

For me it's a reliable repro i.e. it always crashes on 3rd execution.

The address on which it crashes (0x4d555448) is "MUTH" in ascii. Might be a coincidence but might also be a clue.

(lldb) thread backtrace
* thread #1: tid = 0x14e139, 0x00007fff88620be3 libc++abi.dylib`__dynamic_cast + 41, queue = 'com.apple.main-thread, stop reason = EXC_BAD_ACCESS (code=1, address=0x4d555448)
    frame #0: 0x00007fff88620be3 libc++abi.dylib`__dynamic_cast + 41
    frame #1: 0x00007fff899c46e9 OpenCL`___lldb_unnamed_function417$$OpenCL + 37
    frame #2: 0x00007fff899cbe37 OpenCL`clCreateImage + 387
    frame #3: 0x0000000100025f2f CocoaScript`-[COSOpenCLImageBuffer initWithContext:width:height:](self=0x0000638000085050, _cmd=0x000000010007983a, theContext=0x00006300002496f0, w=600, h=749) + 927 at COSOpenCLProgram.m:232
    frame #4: 0x0000000100026290 CocoaScript`-[COSOpenCLImageBuffer initWithContext:usingImageAtPath:](self=0x0000000000000000, _cmd=0x0000000100079858, theContext=0x00006300002496f0, path=0x00006380001717c0) + 480 at COSOpenCLProgram.m:266
    frame #5: 0x0000000100026075 CocoaScript`+[COSOpenCLImageBuffer instanceWithContext:usingImageAtPath:](self=0x00000001000a3af8, _cmd=0x00000001000798be, theContext=0x00006300002496f0, path=0x00006380001717c0) + 133 at COSOpenCLProgram.m:244
    frame #6: 0x00007fff8b08cf9c libffi.dylib`ffi_call_unix64 + 76
    frame #7: 0x00007fff8b08d78e libffi.dylib`ffi_call + 790
    frame #8: 0x0000000100071257 CocoaScript`MOFunctionInvoke(function=0x0000638000032a60, ctx=0x000000010d853098, argumentCount=2, arguments=0x00007fff5fbfdbd8, exception=0x00007fff5fbfdbc0) + 7415 at MOUtilities.m:572
    frame #9: 0x000000010003c440 CocoaScript`MOFunction_callAsFunction(ctx=0x000000010d853098, functionJS=0x000000010dd0fc70, thisObject=0x000000010dd0fc90, argumentCount=2, arguments=0x00007fff5fbfdbd8, exception=0x00007fff5fbfdbc0) + 160 at MochaRuntime.m:1575
    frame #10: 0x00007fff8464203b JavaScriptCore`JSC::JSCallbackObject<JSC::JSDestructibleObject>::call(JSC::ExecState*) + 555
    frame #11: 0x00007fff8439e3c2 JavaScriptCore`JSC::LLInt::setUpCall(JSC::ExecState*, JSC::Instruction*, JSC::CodeSpecializationKind, JSC::JSValue, JSC::LLIntCallLinkInfo*) + 738
    frame #12: 0x00007fff8461bd33 JavaScriptCore`llint_op_call + 169
ccgus commented 10 years ago

I've got this to reproduce as well. Danke - I'll get it fixed.

ccgus commented 10 years ago

Fixed in the latest. Might help to correctly initialize some fields in a struct…