aclements / libelfin

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

file name index exceeded #40

Closed jesperpedersen closed 4 years ago

jesperpedersen commented 4 years ago

Getting

terminate called after throwing an instance of 'std::out_of_range'
  what():  file name index 25 exceeds file table size of 22

when running.

Related to https://github.com/plasma-umass/coz/issues/107

jesperpedersen commented 4 years ago

A hack

diff --git a/dwarf/line.cc b/dwarf/line.cc
index be766d3..b16fdae 100644
--- a/dwarf/line.cc
+++ b/dwarf/line.cc
@@ -49,7 +49,7 @@ struct line_table::impl
         // know we've gathered all file names.
         bool file_names_complete;

-        impl() : last_file_name_end(0), file_names_complete(false) {};
+        impl() : file_names(10000), last_file_name_end(0), file_names_complete(false) {};

         bool read_file_entry(cursor *cur, bool in_header);
 };
hunger commented 4 years ago

I think this is not a bug in libelfin, but in coz.

See https://github.com/plasma-umass/coz/issues/120 for what I think is going wrong.

jesperpedersen commented 4 years ago

Correct