My GPU code works well in cuda-memcheck model but crashes in normal running model

Hello!
I’m a beginner in CUDA.
My GPU code has some memory problems:

Error in `bin/parser': free(): invalid next size (normal): 0x00007f71e8001f50 ***

and I use the cuda-memcheck mode to debug. But I found that it works very well in the cuda-memcheck mode!
Could anyone tell me why? Thanks!

cuda-memcheck is a tool for checking the device code running on the GPU. The error message shown above looks like it is coming from glibc, and thus indicates a problem with your host code running on the CPU. Try valgrind to track down memory corruption in host code.

Thanks for your post.
I have tried the valgrind before cuda-memcheck, but I found it often reports wrong alerts in cuda code. So I tried the cuda-memcheck for debugging. What makes me curious is my code crashed in normal running way but it works very well in the cuda-memcheck model!