aclements / libelfin

C++11 ELF/DWARF parser
MIT License
314 stars 99 forks source link

A Segmentation fault in elf.cc:293:56 #45

Open seviezhou opened 4 years ago

seviezhou commented 4 years ago

System info

Ubuntu X64, gcc (Ubuntu 5.5.0-12ubuntu1), dump-syms (latest master 946dde)

Command line

./examples/dump-syms @@

Output

Symbol table '.dynsym':
   Num: Value            Size  Type    Binding Index Name
Segmentation fault

AddressSanitizer output

AddressSanitizer:DEADLYSIGNAL
=================================================================
==62483==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000014 (pc 0x00000052317a bp 0x7ffd570d1fd0 sp 0x7ffd570d1ec0 T0)
==62483==The signal is caused by a READ memory access.
==62483==Hint: address points to the zero page.
    #0 0x523179 in elf::section::as_strtab() const /home/seviezhou/libelfin/elf/elf.cc
    #1 0x525305 in elf::section::as_symtab() const /home/seviezhou/libelfin/elf/elf.cc:293:56
    #2 0x51c45e in main /home/seviezhou/libelfin/examples/dump-syms.cc:32:37
    #3 0x7f2d8cf4c83f in __libc_start_main /build/glibc-e6zv40/glibc-2.23/csu/../csu/libc-start.c:291
    #4 0x41bbd8 in _start (/home/seviezhou/libelfin/examples/dump-syms+0x41bbd8)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV /home/seviezhou/libelfin/elf/elf.cc in elf::section::as_strtab() const
==62483==ABORTING

POC

SEGV-as_symtab-elf-293.zip