I am setting
ulimit -c unlimited.
And in c++ program we are doing
struct rlimit corelimit; if (getrlimit(RLIMIT_CORE,
Similar issue happened when I killed the program manually with kill -3. It happened simply because I did not wait enough time for core file to finish generating.
Make sure that the file stopped growing in size, and only then open it.