[minicoredumper] [External] Debugging corrupt tar files (invalid sparse archive member)

John Ogness john.ogness at linutronix.de
Thu Feb 9 12:50:56 CET 2023


On 2023-02-09, "Jos Hulzink (Ellips B.V.)" <jos.hulzink at ellips.com> wrote:
> Sounds good. I can simply tell my colleagues that if the inflated core
> dump size is close to 8 GB, you should expect it to be incomplete and
> less reliable.

FYI, I did various tests with the upcoming version (that truncates the
core file).

In my crashing test application, I use mmap() to allocate anonymous
memory to specific virtual addresses below the anticipated heap usage
area and then use that memory for the thread stacks (via
pthread_attr_setstack). This ensures that the thread stacks are near the
beginning of the core file. Then, even for truncated core files, the
stack of the crashing thread is available. (Note that applications doing
this should probably implement randomization within a range to avoid
predictable stack locations.)

I'm not recommending that minicoredumper users start implementing these
tricks to workaround the minicoredumper 8GB core size limit in tar
files. But I did want to document that it is possible in order to
guarantee full thread backtraces on crashes.

John Ogness


More information about the minicoredumper mailing list