Skip to content

Commit 86a7237

Browse files
committed
Investigation
1 parent 23d037e commit 86a7237

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

build/cmake/FindLibunwind.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
SET(LIBUNWIND_VERSION "v1.8.1-custom-2")
1+
SET(LIBUNWIND_VERSION "v1.8.1-custom-3")
22

33
SET(LIBUNWIND_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/libunwind-prefix/src/libunwind-build)
44

55
ExternalProject_Add(libunwind
66
GIT_REPOSITORY https://github.com/DataDog/libunwind.git
7-
GIT_TAG kevin/v1.8.1-custom-2
7+
GIT_TAG gleocadie/v1.8.1-custom-3
88
GIT_PROGRESS true
99
INSTALL_COMMAND ""
1010
UPDATE_COMMAND ""

profiler/src/ProfilerEngine/Datadog.Profiler.Native.Linux/LibrariesInfoCache.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,12 @@ bool LibrariesInfoCache::StartImpl()
6161
// Note: unw_set_iterate_phdr_function will call tdep_init() if needed,
6262
// which has once-initialization semantics, so this is thread-safe.
6363
unw_set_iterate_phdr_function(unw_local_addr_space, LibrariesInfoCache::DlIteratePhdr);
64+
auto fn = unw_get_iterate_phdr_function(unw_local_addr_space);
65+
if (fn != LibrariesInfoCache::DlIteratePhdr)
66+
{
67+
Log::Error("Failed to register custom iterate_phdr_function with libunwind.");
68+
return false;
69+
}
6470

6571
// CRITICAL: Force a memory barrier to ensure the write to iterate_phdr_function
6672
// is visible to all CPU cores. libunwind's unw_set_iterate_phdr_function does

0 commit comments

Comments
 (0)