Cannot generate cuda coredump when cuda kernel access illegal address

I tried to generate a cuda coredump to debug my code.
I set CUDA_ENABLE_COREDUMP_ON_EXCEPTION to 1 and test with two code snippets.
The first one can get coredump file as expected. This sample use a dereference on a null pointer to generate coredump:
global void k(int *d){
int *x = NULL;
*d = *x;
}

The second one cannot get coredump file. This sammple produced a accessing array out of bound error:
global void k(int *d){
*(d+0x10000000) = 1;
}

I guess the second one produced just a runtime error but not a exception so no coredump file generated?
Any comments are appreciated. Many thanks!

Hi @leeyoung48,
Can it be the case that (d + 0x10000000) points to other valid object in global memory?

I dont think so. BTW, I run these snippets on qnx platform, and using cuda-memcheck can raise cuda exception and get coredump file.

@AKravets Any luck to find some explanation for this? Eventually I have to run this code without memecheck. So memcheck works wont help.

Hi @leeyoung48
How do you run memcheck? Are you using set cuda memcheck on in cuda-gdb?

If so, the difference is the following:

  • CUDA_ENABLE_COREDUMP_ON_EXCEPTION=1 would generate coredump on MMU exception (so accessing another object via d pointer would not trigger an error)
  • set cuda memcheck on in cuda-gdb wold actually check for out of bound access (so accessing another object via d pointer would trigger an error)

@AKravets ,Thanks for your quick reply.
I didnt use cuda-gdb.
I used "cuda-memcheck my_test_app" to get the core file.
I think your reply make sense.
If that, perhaps low level mmu mechanism of QNX makes coredump file not generated for my sacond case.

@leeyoung48
Glad I was able to help! Do you need any additional help with the tools?

Nope, thanks.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.