Issue
Is it possible to add a software version number of the cored file, let's say we have 100 software versions, each with a specified number that is #defined
in the app.
When the core dump happens, how can I append this number to the core file, so that it can be mapped to the correct image?
Mapping a core file with every release I have would take some effort!
Solution
On Linux (specifically), according to core(5) and proc(5) man pages, you could change /proc/sys/kernel/core_pattern
Software don't have (necessarily) a release number. It is at most a convention that some software are following (but not others).
Perhaps you might use symlinks on your binaries. Alternatively, you could, very early in your main
, copy some version string into a well identified buffer - perhaps a variable char my_current_version[32]
(and examine that buffer in the code dump).
Answered By - Basile Starynkevitch Answer Checked By - Willingham (WPSolving Volunteer)