I run a program which terminates apparently correctly, but then a segmentation message appears:
./run_program
Start processing
Successfully finished.
Segmentation fault (core dumped)
How do I go about debugging the above ? I have run the program through a debugger and it gets to the last line and exits, then a segmentation fault message appears. If the segmentation fault occurred during the program I would have seen it during the debugging, so I am guessing it occurs at the moment the program is exiting, when some memory is liberated incorrectly or something like that. But I don't know how I can find out where that might be without some debugging.
Based on what I have seen elsewhere, it seems I need to look for the core dump. But I cannot find it. I am using a Red Hat 7 machine. I don't know where cores get dumped on that machine. Can anyone suggest where I should look ?