-
Notifications
You must be signed in to change notification settings - Fork 379
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement requirement.json
for injection
#4019
Conversation
4b742d0
to
c75462f
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #4019 +/- ##
=======================================
Coverage 97.73% 97.73%
=======================================
Files 1338 1338
Lines 80246 80245 -1
Branches 4014 4014
=======================================
Hits 78430 78430
+ Misses 1816 1815 -1 ☔ View full report in Codecov by Sentry. |
BenchmarksBenchmark execution time: 2024-10-22 16:33:08 Comparing candidate commit c75462f in PR branch Found 0 performance improvements and 2 performance regressions! Performance is the same for 22 metrics, 2 unstable metrics. scenario:profiler - hold / resume
scenario:tracing - Propagation - Datadog
|
lib-injection/requirements.json
Outdated
{ | ||
"arch": "x86", | ||
"supported": true, | ||
"min": "2.28" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2.28 is quite high for x86, do you know what symbol/dependency requires it?
running nm -D library_file | grep U
will give you that answer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The pipeline is using registry.ddbuild.io/images/mirror/buildpack-deps:buster
as a base:
dd-trace-rb/.gitlab/Dockerfile-3.2.2
Line 4 in 1ec3900
FROM registry.ddbuild.io/images/mirror/buildpack-deps:buster |
With which we get a glibc 2.28:
$ ldd --version
ldd (Debian GLIBC 2.28-10+deb10u2) 2.28
So gems with native extensions are built against that.
The version requirement comes from there.
This results in the following max version referenced (== min version required):
aarch64
:
tmp/arm64/3.2.0/extensions/aarch64-linux/3.2.0-static/datadog-2.4.0/datadog_profiling_loader.3.2.2_aarch64-linux.so: GLIBC_2.17
tmp/arm64/3.2.0/extensions/aarch64-linux/3.2.0-static/datadog-2.4.0/libdatadog_api.3.2_aarch64-linux.so: GLIBC_2.17
tmp/arm64/3.2.0/extensions/aarch64-linux/3.2.0-static/ffi-1.16.3/ffi_c.so: GLIBC_2.27
tmp/arm64/3.2.0/extensions/aarch64-linux/3.2.0-static/msgpack-1.7.3/msgpack/msgpack.so: GLIBC_2.17
tmp/arm64/3.2.0/gems/datadog-2.4.0/lib/datadog_profiling_loader.3.2.2_aarch64-linux.so: GLIBC_2.17
tmp/arm64/3.2.0/gems/datadog-2.4.0/lib/libdatadog_api.3.2_aarch64-linux.so: GLIBC_2.17
tmp/arm64/3.2.0/gems/ffi-1.16.3/lib/ffi_c.so: GLIBC_2.27
tmp/arm64/3.2.0/gems/libdatadog-13.1.0.1.0-aarch64-linux/vendor/libdatadog-13.1.0/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl/lib/libdatadog_profiling.so: GLIBC_2.0
tmp/arm64/3.2.0/gems/libdatadog-13.1.0.1.0-aarch64-linux/vendor/libdatadog-13.1.0/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu/lib/libdatadog_profiling.so: GLIBC_2.17
tmp/arm64/3.2.0/gems/libddwaf-1.14.0.0.0-aarch64-linux/vendor/libddwaf/libddwaf-1.14.0-linux-aarch64/lib/libddwaf.so:
tmp/arm64/3.2.0/gems/msgpack-1.7.3/lib/msgpack/msgpack.so: GLIBC_2.17
x86_64
:
tmp/x86_64/3.2.0/extensions/x86_64-linux/3.2.0-static/datadog-2.4.0/datadog_profiling_loader.3.2.2_x86_64-linux.so: GLIBC_2.2.5
tmp/x86_64/3.2.0/extensions/x86_64-linux/3.2.0-static/datadog-2.4.0/libdatadog_api.3.2_x86_64-linux.so: GLIBC_2.2.5
tmp/x86_64/3.2.0/extensions/x86_64-linux/3.2.0-static/ffi-1.16.3/ffi_c.so: GLIBC_2.27
tmp/x86_64/3.2.0/extensions/x86_64-linux/3.2.0-static/msgpack-1.7.3/msgpack/msgpack.so: GLIBC_2.14
tmp/x86_64/3.2.0/gems/datadog-2.4.0/lib/datadog_profiling_loader.3.2.2_x86_64-linux.so: GLIBC_2.2.5
tmp/x86_64/3.2.0/gems/datadog-2.4.0/lib/libdatadog_api.3.2_x86_64-linux.so: GLIBC_2.2.5
tmp/x86_64/3.2.0/gems/ffi-1.16.3/lib/ffi_c.so: GLIBC_2.27
tmp/x86_64/3.2.0/gems/libdatadog-13.1.0.1.0-x86_64-linux/vendor/libdatadog-13.1.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl/lib/libdatadog_profiling.so:
tmp/x86_64/3.2.0/gems/libdatadog-13.1.0.1.0-x86_64-linux/vendor/libdatadog-13.1.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/lib/libdatadog_profiling.so: GLIBC_2.16
tmp/x86_64/3.2.0/gems/libddwaf-1.14.0.0.0-x86_64-linux/vendor/libddwaf/libddwaf-1.14.0-linux-x86_64/lib/libddwaf.so:
tmp/x86_64/3.2.0/gems/msgpack-1.7.3/lib/msgpack/msgpack.so: GLIBC_2.14
ffi
is the one using GLIBC_2.27
. So we can lower it to 2.27 but until we move to building against a lower glibc (which comes with its own set of issues) we're stuck with that. FYI using manylinux is under consideration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if it helps you can pick agent build images or the ones used by the injector:
Given that you download the source codes, won't building ffi on those machines improve your coverage? Or are there specific recent symbols that are required
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think memfd_create
needs glibc 2.27.
It looks like libffi
has fallback mechanisms if it is absent (see Memory Usage), but it is an important security feature.
Note: we're looking into removing the ffi
dependency entirely mid-term.
51020e3
to
357ec4c
Compare
|
Change log entry
None
What does this PR do?
Add
requirement.json
for injection.Motivation:
Prevent injection when:
Additional Notes:
JIRA
How to test the change?
Should be tested by CI in the added JSON test cases.