Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cl.getCommandQueueInfo crashes occasionally #40

Open
andreasgal opened this issue Mar 17, 2016 · 2 comments
Open

cl.getCommandQueueInfo crashes occasionally #40

andreasgal opened this issue Mar 17, 2016 · 2 comments

Comments

@andreasgal
Copy link
Contributor

The following test case crashes reliably after a few iterations.

var cl = require('node-opencl');
var platforms = cl.getPlatformIDs();
var ctx = cl.createContextFromType([cl.CONTEXT_PLATFORM, platforms[0]], cl.DEVICE_TYPE_ALL, null, null);
var device = cl.getContextInfo(ctx, cl.CONTEXT_DEVICES)[0];
var q = cl.createCommandQueue(ctx, device, cl.QUEUE_PROFILING_ENABLE);

for (var n = 0; n < 1000; ++n) {
var ctx2 = cl.getCommandQueueInfo(q, cl.QUEUE_CONTEXT);
}

@andreasgal
Copy link
Contributor Author

  • thread Minimally fix compilation on Mac with Node.js 0.10.36 and NAN 1.6.1 #1: tid = 0x3d79b, 0x00007fff935e4b21 libc++abi.dylib`__dynamic_cast + 37, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0xfffffffffffffff0)
    • frame #0: 0x00007fff935e4b21 libc++abi.dylib__dynamic_cast + 37 frame #1: 0x00007fff9758dfff OpenCLlldb_unnamed_function338$$OpenCL + 32
      frame First release : OpenCL1.2 and 2.0 with limited support for map, unmap, SVM and garbage collection #2: 0x00007fff975a4246 OpenCLclReleaseContext + 14 frame #3: 0x000000010359515a opencl.nodeopencl::NoCLWrapper<cl_context, 2, -34, &(clReleaseContext), &(clRetainContext)>::~NoCLWrapper() [inlined] opencl::NoCLWrapper<cl_context, 2, -34, &(clReleaseContext), &(clRetainContext)>::release(this=0x000000010153ea00) + 42 at types.h:109
      frame Map, unmap and SVM support #4: 0x0000000103595147 opencl.nodeopencl::NoCLWrapper<_cl_context*, 2, -34, &(clReleaseContext), &(clRetainContext)>::~NoCLWrapper() [inlined] opencl::NoCLWrapper<_cl_context*, 2, -34, &(clReleaseContext), &(clRetainContext)>::~NoCLWrapper(this=0x000000010153ea00) + 14 at types.h:48 frame #5: 0x0000000103595139 opencl.nodeopencl::NoCLWrapper<cl_context, 2, -34, &(clReleaseContext), &(clRetainContext)>::~NoCLWrapper() [inlined] opencl::NoCLWrapper<cl_context, 2, -34, &(clReleaseContext), &(clRetainContext)>::~NoCLWrapper(this=0x000000010153ea00) at types.h:46
      frame fixing setKernelArg for OpenCL versions < 1.2 #6: 0x0000000103595139 opencl.nodeopencl::NoCLWrapper<_cl_context*, 2, -34, &(clReleaseContext), &(clRetainContext)>::~NoCLWrapper(this=0x000000010153ea00) + 9 at types.h:46 frame #7: 0x000000010026ef9c nodev8::internal::GlobalHandles::PendingPhantomCallback::Invoke(v8::internal::Isolate
      ) + 76
      frame New Tests  #8: 0x000000010026eecd nodev8::internal::GlobalHandles::DispatchPendingPhantomCallbacks() + 73 frame #9: 0x000000010026efd3 nodev8::internal::GlobalHandles::PostGarbageCollectionProcessing(v8::internal::GarbageCollector) + 35
      frame replace old typed arrays with v8:ArrayBuffer as node does in node::Buffer #10: 0x0000000100284995 nodev8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) + 887 frame #11: 0x00000001002843d1 nodev8::internal::Heap::CollectGarbage(v8::internal::GarbageCollector, char const
      , char const
      , v8::GCCallbackFlags) + 477
      frame Add bsd3 license #12: 0x000000010028f725 nodev8::internal::Heap::PerformIdleTimeAction(v8::internal::GCIdleTimeAction, v8::internal::GCIdleTimeHandler::HeapState, double) + 183 frame #13: 0x000000010028fc06 nodev8::internal::Heap::IdleNotification(double) + 508
      frame Port node-webcl examples #14: 0x0000000100149539 nodev8::Isolate::IdleNotification(int) + 27 frame #15: 0x0000000103591433 opencl.nodeNan::imp::FunctionCallbackWrapper(info=0x00007fff5fbff328) + 131 at nan_callbacks_12_inl.h:174
      frame add support for struct? #16: 0x0000000100156e41 nodev8::internal::FunctionCallbackArguments::Call(void (_)(v8::FunctionCallbackInfov8::Value const&)) + 159 frame #17: 0x0000000100176d2d nodev8::internal::MaybeHandlev8::internal::Object v8::internal::HandleApiCallHelper(v8::internal::Isolate*, v8::internal::(anonymous namespace)::BuiltinArguments<(v8::internal::BuiltinExtraArguments)1>&) + 946
      frame Exit hangs #18: 0x000000010017928f node`v8::internal::Builtin_HandleApiCall(int, v8::internal::Object*, v8::internal::Isolate) + 61

@andreasgal
Copy link
Contributor Author

So I think getContextInfo doesn't increment the refcnt but the wrapper tries to deallocate the context.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant