cuCtxDestroy bug bug report

It appears cuCtxDestroy is broken on CUDA 1.1 (Linux, 64-bit RH Fedora 7).

cuCtxCreate(&ctx, 0, dev);
// Do nothing.
// Exception and crash!

Note that there are no intervening calls between the Create and Destroy.

However, this is a workaround:

cuCtxCreate (&ctx, 0, dev);
// Do nothing.

Detach is supposed to destroy the context if the reference count drops to 0, which of course it does in this case.

All of this works on Windows XP with CUDA 2.0 on a different card so I don’t know if the bug is specific to Linux, 64-bit, or the CUDA or driver version.