Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is the file utility telling me there are "too many program headers"?

Tags:

file

coredump

I want to analyze a core dump. I'm about to use gdb, but the first thing I did as a sanity check was use file on the core, which gave me:

ELF 32-bit LSB core file Intel 80386, version 1 (SYSV), too many program headers (489)

Now, most of that makes perfect sense. But "too many" implies that file was trying to do something, and was unable to complete its operation for some reason. Something tells me what file was looking for would be helpful to know.

What was it trying to determine, and why (exactly) did it fail in the attempt?

like image 456
Parthian Shot Avatar asked Jul 09 '15 21:07

Parthian Shot


1 Answers

Recent versions of file have added some extra parameters to limit how much of the coredump it is reading. By default it will not even look for the program name in the dump if it sees that there are more than 128 ELF program headers.

TL;DR

You should be able to get around that by calling file -Pelf_phnum=10000 core

like image 108
Till Varoquaux Avatar answered Oct 04 '22 05:10

Till Varoquaux