I have a core dump generated after a segmentation fault. Is there a way in gdb ( or somehow else ) to see the system time when this happened?
I cannot use the creation time of the core dump file because it was sent to me without this meta info.
I have a core dump generated after a segmentation fault. Is there a way in gdb ( or somehow else ) to see the system time when this happened?
I cannot use the creation time of the core dump file because it was sent to me without this meta info.
The system time is (unfortunately) not stored in a core file by default. You have a couple of options. One of them is to change the name of the core file to include the system time.
You can read more about this here.
Basically, you want to stick a "%t" into the name of the core file.
If you are running a custom kernel, you have more options.
For example, you could change the elf_prstatus structure to include other things you may want. This is an option that isn't without pain as off the shelf tools may not always be happy. You could add a custom note to the core file and include application specific information that you could then dump and inspect using readelf.
Not answer as such but perhaps an answer in the future. http://stupefydeveloper.blogspot.co.nz/2008/10/gdb-examining-core-dumps.html
They way i check when core dump is created by doing "ls -lrt" of the directory under which the core was generated.
ls -lrt
on the directory and send the coredump along. This is what we used to do in my old project.
– New to Rails
Aug 19 '13 at 6:48
tar zcf core.tar.gz core
- then it takes less space and the timestamp is retained in the tar archive. – Mats Petersson Feb 7 '13 at 15:41systemd
and logging withjournald
, then it's possible to query the journal (on that system) withsystemd-coredumpctl
about the coredump. – unthought Feb 13 '13 at 20:46