Commit 2377925
committed
Always preload libm.so.6 in sidecar direct spawn
The portable (musl-built, glibc-compat) libdatadog_php.so has its libc
DT_NEEDED patched out and relies on the host's libc being in the global
scope. When the sidecar is direct-spawned, ld-linux execs the DSO itself,
so anything it needs beyond libc.so.6 (which ld-linux always brings in)
must be passed with --preload.
add_glibc_direct_preloads() only did that on glibc < 2.34, assuming 2.34
had merged all four DSOs into libc. It did not merge libm: exp/log/pow
(referenced by libdd-ddsketch, libdd-telemetry and datadog-ipc's shm
stats) still live in libm.so.6 on every glibc. On glibc >= 2.34 hosts the
spawned sidecar therefore died at load with
libdatadog_php.so: symbol lookup error: undefined symbol: exp
which made every sidecar connection reset, so AppSec never started
("AppSec sidecar backend is unavailable"). This broke the FrankenPHP SSI
tests (dunglas/frankenphp:1.4-php8.4 is Debian 12, glibc 2.36): 27
FrankenphpClassicTests + 10 FrankenphpWorkerTests failures in the
"helper-rust integration coverage" job.
Preload libm.so.6 whenever the host is glibc, and keep libdl/libpthread/
librt for glibc < 2.34.
Verified with test8.4-release-zts-ssi (glibc 2.36, FrankenPHP): 27
failures before, 0 after; test8.3-release-ssi (glibc 2.31, the < 2.34
path) still green.1 parent 3eef763 commit 2377925
2 files changed
Lines changed: 25 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
43 | | - | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
23 | 25 | | |
24 | | - | |
| 26 | + | |
25 | 27 | | |
26 | 28 | | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
32 | 47 | | |
33 | 48 | | |
34 | 49 | | |
| |||
0 commit comments