To obtain core dump, the line bellow is mandatory.
ulimit -c unlimited
Check out generate coredumps to help developer for debugging for more details of ulimit.
Core dump will be generated automatically if a program crashed due to segmentation fault or some other reason. But core dump will not be generated if an application halt and been terminate by control+c or conventional way of kill or pkill. Therefore, how we are going to investigate the reason of the halt process? There is an option that you can gdb a current running process by specified the GID. But what if you are not the author of the program? You are just a support engineer who wants to escalate the bugs to development team by providing the core file, what can you do?
You can abort the apps and obtain the core dump using kill or pkill. If you check kill man page, you will discover abort signal from the list of signal description with various purpose
... ABRT 6 core ...
To abort the halt process is easy, with kill you need to specified the GID
kill -6 12345
With pkill, you provide it with the process name.
pkill -6 myapp