[minicoredumper] Infinite loop while executing read_remote
John Ogness
john.ogness at linutronix.de
Tue Aug 3 22:01:28 CEST 2021
On 2021-08-03, "Jos Hulzink (Ellips B.V.)" <jos.hulzink at ellips.com> wrote:
> We run into the following issue when using the minicoredumper:
> Sometimes, minicoredumper fills /var/log completely when processing a
> crashed process with the following messages:
>
> <snip>
> 4 Jul 9 08:54:14 TrueSort minicoredumper: recept: /etc/minicoredumper/generic.recept.json
> 5 Jul 9 08:54:14 TrueSort minicoredumper: dump: auxv phdrs: 560 bytes @ 0x400040
> 6 Jul 9 08:54:14 TrueSort minicoredumper: read_remote failed: len=4, addr=0x2094c80, dest=0xf47c6fc, errno="Success"
> 7 Jul 9 08:54:14 TrueSort minicoredumper: read_remote failed: len=4, addr=0x2094c90, dest=0xf47c6fc, errno="Success"
> 8 Jul 9 08:54:14 TrueSort minicoredumper: read_remote failed: len=4, addr=0x2094ca0, dest=0xf47c6fc, errno="Success"
> 9 Jul 9 08:54:14 TrueSort minicoredumper: read_remote failed: len=4, addr=0x2094cb0, dest=0xf47c6fc, errno="Success"
> 10 Jul 9 08:54:14 TrueSort minicoredumper: read_remote failed: len=4, addr=0x2094cc0, dest=0xf47c6fc, errno="Success"
> 11 Jul 9 08:54:14 TrueSort minicoredumper: read_remote failed: len=4, addr=0x2094cd0, dest=0xf47c6fc, errno="Success"
> <continue until disk full>
So it seems you are caught in this loop:
https://github.com/diamon/minicoredumper/blob/master/src/minicoredumper/corestripper.c#L3211
Unfortunately that loop does not limit itself if DT_NULL is never
read. The loop is quite dangerous because of this. It should be changed
to break out if the first read_remote() (line 3215) does not return 0.
However, aside from avoiding your hard drive filling up, it is not going
to help you get a core file. The minicoredumper needs to find DT_DEBUG
so that it can begin processing the mappings.
Some questions from me:
Is there anything special about this binary?
Is it dynamically linked?
Do you use special link options?
Do you use a linker other than ld, the GNU linker?
Are you stripping your binary? If yes, with what options?
Are you using any special minicoredumper features, such as
linking with libminicoredumper?
Are you specifying any files in the "dump_by_name" option of the recept
file?
Is this application running in any special environments? Such as
memory-bound containers or memory-limited process resources? If yes, is
it possible that these limits are being hit?
Thanks.
John Ogness
More information about the minicoredumper
mailing list