diff --git a/loader/dd_library_loader.c b/loader/dd_library_loader.c index 39bc258ae6..0a3365c493 100644 --- a/loader/dd_library_loader.c +++ b/loader/dd_library_loader.c @@ -8,6 +8,7 @@ #include #include #include +#include #include
#include @@ -316,9 +317,13 @@ static void ddloader_telemetryf(telemetry_reason reason, const char *format, ... snprintf(payload, sizeof(payload), template, runtime_version, runtime_version, tracer_version, loader_pid, points); char *argv[] = {telemetry_forwarder_path, "library_entrypoint", payload, NULL}; - if (execv(telemetry_forwarder_path, argv)) { - LOG(ERROR, "Telemetry: cannot execv") - } + + execv(telemetry_forwarder_path, argv); + LOG(ERROR, "Telemetry: cannot execv: %s", strerror(errno)) + + // If execv failed, exit immediately + // Return 127 for the most likely case of a missing file + exit(127); } static char *ddloader_find_ext_path(const char *ext_dir, const char *ext_name, int module_api, bool is_zts, bool is_debug) {