Skip to content

Commit

Permalink
Fix JIT unwind info registration
Browse files Browse the repository at this point in the history
For `UNW_INFO_FORMAT_IP_OFFSET`, the `table_len` is the size of the `table_data`
in `unw_word_t` (i.e. `uintptr_t`) for whatever reason.

Fix JuliaLang#19360 (which is only failing on the centos buildbot likely because the
fallback methods somehow do not work on such an old glibc)
  • Loading branch information
Yichao Yu authored and fcard committed Feb 28, 2017
1 parent 371e2e0 commit 0ed555c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/debuginfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1894,8 +1894,8 @@ void register_eh_frames(uint8_t *Addr, size_t Size)
// I'm not a great fan of the naming of this constant, but it means the
// right thing, which is a table of FDEs and ips.
di->format = UNW_INFO_FORMAT_IP_OFFSET;
di->u.ti.name_ptr = 0;
di->u.ti.segbase = (unw_word_t)Addr;
di->u.rti.name_ptr = 0;
di->u.rti.segbase = (unw_word_t)Addr;
// Now first count the number of FDEs
size_t nentries = 0;
processFDEs((char*)Addr, Size, [&](const char*){ nentries++; });
Expand Down Expand Up @@ -2001,8 +2001,8 @@ void register_eh_frames(uint8_t *Addr, size_t Size)
}
assert(end_ip != 0);

di->u.ti.table_len = nentries;
di->u.ti.table_data = (unw_word_t*)table;
di->u.rti.table_len = nentries * sizeof(*table) / sizeof(unw_word_t);
di->u.rti.table_data = (unw_word_t)table;
di->start_ip = start_ip;
di->end_ip = end_ip;

Expand Down

0 comments on commit 0ed555c

Please sign in to comment.