Install libdd_profiling-embedded.so to fix /tmp extraction and CAP_PERFMON loss#536
Open
xroche wants to merge 1 commit intoDataDog:mainfrom
Open
Install libdd_profiling-embedded.so to fix /tmp extraction and CAP_PERFMON loss#536xroche wants to merge 1 commit intoDataDog:mainfrom
xroche wants to merge 1 commit intoDataDog:mainfrom
Conversation
Contributor
Author
|
cc @r1viollet — this fixes the /tmp extraction issue from #529. The embedded library was never installed, so the loader's bare-name dlopen always fell back to extracting to /tmp. |
The loader tries dlopen("libdd_profiling-embedded.so") before falling
back to extracting the embedded copy to /tmp. But the embedded library
was never included in the install targets, so the dlopen always fails.
The /tmp copy of ddprof lacks file capabilities (CAP_PERFMON), which
causes perf_event_open to fail with EPERM.
Add dd_profiling-embedded to the install targets when USE_LOADER is ON
so the loader finds it via standard dlopen and never falls back to /tmp.
Upstream: DataDog#535
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
00cccd7 to
ca4b743
Compare
Collaborator
|
Thanks for the fix, I'll handover the integration to @nsavoire as I'm off for a few days. |
Collaborator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When
USE_LOADER=ON, the loader triesdlopen("libdd_profiling-embedded.so")before falling back to extracting the embedded copy. This dlopen always fails becausedd_profiling-embeddedis built but not included in the install targets.As a result, the loader extracts both
libdd_profiling-embedded.soandddprofto/tmp. The extractedddprofcopy lacks file capabilities (CAP_PERFMON), soperf_event_openfails withEPERM.Fix
Add
dd_profiling-embeddedto the CMake install targets whenUSE_LOADER=ON. The loader findslibdd_profiling-embedded.sovia standard dlopen, skips extraction, andexecvp("ddprof")uses the installed binary with its file capabilities.Refs