bcov
bcov copied to clipboard
bcov -m patch / Error: string offset exceeds section size
$ 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
Probably related to https://github.com/aclements/libelfin/blob/master/elf/elf.cc#L320
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:
-
open an issue (or better a pull request) to resolve this issue on https://github.com/aclements/libelfin. Once resolved, I can backport the fixes to the version of
libelfin
that is distributed withbcov
. -
open a pull request here that fixes this issue. I'm happy to accept it, if concise and easy to review.
Unfortunately, I cannot offer more help because I have moved on to pursue other projects.