Skip to content

Commit

Permalink
Relax assert to handle multiple vdso segments and multiple re-attaches
Browse files Browse the repository at this point in the history
  • Loading branch information
derekbruening committed Nov 17, 2023
1 parent 8fb133e commit cb9c2d1
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions clients/drcachesim/tracer/instru_offline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,14 @@ offline_instru_t::load_custom_module_data(module_data_t *module, int seg_idx)
// We used to store the vdso contents, but we now use separate block encodings
// for vdso code. So we just find the vdso here, and pass through the user's data
// for all modules.
if ((name != nullptr &&
(strstr(name, "linux-gate.so") == name ||
strstr(name, "linux-vdso.so") == name)) ||
(module->names.file_name != NULL && strcmp(name, "[vdso]") == 0)) {
DR_ASSERT(vdso_modbase_.load(std::memory_order_acquire) == 0);
if (seg_idx == 0 &&
((name != nullptr &&
(strstr(name, "linux-gate.so") == name ||
strstr(name, "linux-vdso.so") == name)) ||
(module->names.file_name != NULL && strcmp(name, "[vdso]") == 0))) {
DR_ASSERT(vdso_modbase_.load(std::memory_order_acquire) == 0 ||
vdso_modbase_.load(std::memory_order_acquire) ==
reinterpret_cast<uintptr_t>(module->start));
vdso_modbase_.store(reinterpret_cast<uintptr_t>(module->start),
std::memory_order_release);
}
Expand Down

0 comments on commit cb9c2d1

Please sign in to comment.