This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
gdb and ELF limitation and Linux
- From: KAMEZAWA Hiroyuki <kamezawa dot hiroyu at jp dot fujitsu dot com>
- To: gdb at sourceware dot org
- Date: Fri, 12 Jun 2009 09:37:15 +0900
- Subject: gdb and ELF limitation and Linux
Hi,
I encountered following problem recently. Does anyone have a workaround ?
Assume a program which call abort() when mmap(), munmap(), mprotect() failes
with -ENOMEM. And It makes a core dump.
In this case, the number of program's maps reaches max_map_count(=65536 at
default). When the kernel writes a coredump, a phdr of ELF is made per a map
and some more phdrs are added.
But, elf(32|64)_hdr->e_phnum is 16bit (Elf(32|64)_Half) and it overflows.
As a result, this coredump can't be opened by gdb.
Now, I wonder I should send a patch to lkml to make the default max_map_count
to be smaller (65530 or some).
But max_map_count is configurable for allowing over 65536 maps, anyway.
Thanks,
-Kame