Skip to content

Commit 3c0d0f9

Browse files
authored
Use valgrind suppressions instead of disabling valgrind (#2708)
Signed-off-by: Bob Weinand <[email protected]>
1 parent 72632b8 commit 3c0d0f9

File tree

4 files changed

+12
-2
lines changed

4 files changed

+12
-2
lines changed

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -154,14 +154,14 @@ test_with_init_hook: $(SO_FILE) $(INIT_HOOK_TEST_FILES)
154154
test_extension_ci: $(SO_FILE) $(TEST_FILES) $(TEST_STUB_FILES)
155155
( \
156156
set -xe; \
157+
export PATH="$(PROJECT_ROOT)/tests/ext/valgrind:$$PATH"; \
157158
export DD_TRACE_CLI_ENABLED=1; \
158159
export TEST_PHP_JUNIT=$(JUNIT_RESULTS_DIR)/normal-extension-test.xml; \
159160
$(MAKE) -C $(BUILD_DIR) CFLAGS="-g" clean all; \
160161
$(RUN_TESTS_CMD) -d extension=$(SO_FILE) $(BUILD_DIR)/$(TESTS); \
161162
\
162163
export TEST_PHP_JUNIT=$(JUNIT_RESULTS_DIR)/valgrind-extension-test.xml; \
163164
export TEST_PHP_OUTPUT=$(JUNIT_RESULTS_DIR)/valgrind-run-tests.out; \
164-
export DD_TRACE_SIDECAR_TRACE_SENDER=0; \
165165
$(RUN_TESTS_CMD) -d extension=$(SO_FILE) -m -s $$TEST_PHP_OUTPUT $(BUILD_DIR)/$(TESTS) && ! grep -e 'LEAKED TEST SUMMARY' $$TEST_PHP_OUTPUT; \
166166
)
167167

tests/ext/background-sender/agent_sampling_sidecar.phpt

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
The sidecar trace flusher sender informs about changes to the agent sample rate
33
--SKIPIF--
44
<?php include __DIR__ . '/../includes/skipif_no_dev_env.inc'; ?>
5-
<?php if ((getenv('USE_ZEND_ALLOC') === '0' && !getenv("SKIP_ASAN")) || getenv("TEST_PHP_JUNIT")) die('skip: valgrind reports sendmsg(msg.msg_control) points to uninitialised byte(s), but it is unproblematic and outside our control in rust code'); ?>
65
--ENV--
76
DD_TRACE_LOG_LEVEL=info,startup=off
87
DD_AGENT_HOST=request-replayer

tests/ext/valgrind/suppressions.txt

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
<sendmsg in rust has unitialized bytes>
3+
Memcheck:Param
4+
sendmsg(msg.msg_control)
5+
fun:sendmsg
6+
fun:*send_with_fd*
7+
}

tests/ext/valgrind/valgrind

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
DIR=$(dirname "$0")
3+
export PATH=${PATH/${DIR//\//\\\/}:/}
4+
exec valgrind "--suppressions=$DIR/suppressions.txt" "$@"

0 commit comments

Comments
 (0)