cuda-gdb error or bug

I am getting the following when I try to run cuda-gdb.

[Context Push of context 0x19cf7530 on Device 0]
/home/buildmeister/build/rel/gpgpu/toolkit/r4.0/debugger/cuda-gdb/gdb/cuda-tdep.c:934: internal-error: cuda_context_push: Assertion `!err’ failed.

I started this session with ‘set cuda memcheck on’

My code has pthreads, and does try to push a new context.

I am not sure if there is something I can change to make this go way, or if this is a bug?

here is my code that the thread is executing:

CUcontext localc;
cuCtxCreate(&localc, 0, Metrics::dev);

cuCtxPushCurrent( localc );
size_t stacksize;
cudaThreadGetLimit(&stacksize, cudaLimitStackSize);
stacksize *= 32; //32MB stack size
cudaThreadSetLimit(cudaLimitStackSize, stacksize);



I thought maybe I was having a problem that you could not cuCtxPushCurrent() more than one thread at a time, but I have tried to “pop” the context from the main thread, and only push the new one in a single worker thread, and I still get the error.

Do you hit this error even with one thread?