On 1/26/2019 6:12 PM, Peng Yu wrote:
I have an executable. If I just run on its own, there will be segmentation fault. But if I run it using valgrind, it finishes successfully. Does anybody how can this happen? How to debug such a program? Thanks.
Maybe not the sort of answer you have in mind, but I might start with using gdb. It should still segfault under those conditions. You can then try recompiling to -g to get debug symbols. Doing that might affect whether the bug exhibits, but it would make debugging easier. Valgrind might be useful if you think the fault has to do with improper freeing or lack of initialization of pointers ... Regards - Eliot Moss _______________________________________________ Valgrind-users mailing list Valgrind-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/valgrind-users