abenkhadra / bcov

Static instrumentation tool for efficient binary-level coverage analysis.
Other
144 stars 9 forks source link

bcov -m patch / Error: string offset exceeds section size #2

Open Semnodime opened 2 years ago

Semnodime commented 2 years ago

$ bcov -m patch -p any -v 5 -i ./foo -o ./foo_patched

terminate called after throwing an instance of 'std::range_error'
  what():  string offset 2425393159 exceeds section size

Further info provided by rizin

fd       3
file     foo
size     0xbb8728
humansz  11.7M
mode     r-x
format   elf64
iorw     false
block    0x100
type     EXEC (Executable file)
arch     x86
baddr    0x400000
binsz    12287845
bintype  elf
bits     64
canary   true
class    ELF64
compiler GCC: (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4
crypto   false
endian   little
havecode true
intrp    /lib64/ld-linux-x86-64.so.2
laddr    0x0
lang     c++
linenum  false
lsyms    false
machine  AMD x86-64 architecture
maxopsz  16
minopsz  1
nx       true
os       linux
pcalign  0
pic      false
relocs   false
relro    partial
rpath    $ORIGIN:$ORIGIN/foo:$ORIGIN/../foo
sanitiz  false
static   false
stripped true
subsys   linux
va       true
Semnodime commented 2 years ago

Probably related to https://github.com/aclements/libelfin/blob/master/elf/elf.cc#L320

abenkhadra commented 2 years ago

Thank you for giving bcov a try.

Yes, I think that the exception is thrown by libelfin as you have mentioned. So I see two options:

Unfortunately, I cannot offer more help because I have moved on to pursue other projects.