Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,15 @@ jobs:

- name: Run Valgrind memory leak test suite
run: |
# run-tests.php -m invokes Valgrind memcheck with USE_ZEND_ALLOC=0
NO_INTERACTION=1 REPORT_EXIT_STATUS=1 php run-tests.php -m -q --show-diff tests/
# make test loads the freshly built modules/judy.so via -d extension=…;
# invoking run-tests.php directly does not, which silently reduces the
# suite to SKIPs (issue #202). Flags ride in TESTS, which the generated
# Makefile appends to the run-tests.php invocation. -m wraps each test
# in Valgrind memcheck (--trace-children=yes) with USE_ZEND_ALLOC=0.
# pcre.jit=0: PCRE2's sljit-generated code trips uninitialised-value
# reports inside the php binary itself; without it every preg_*-using
# test is flagged LEAK with no judy.so frame in the stack.
make test TESTS="-j$(nproc) -m -q --show-diff -d pcre.jit=0 tests/" NO_INTERACTION=1 REPORT_EXIT_STATUS=1

- name: Report or Update Nightly Failure Issue
if: failure() && github.event_name == 'schedule'
Expand All @@ -75,11 +82,12 @@ jobs:
'',
`- **Commit**: [${context.sha}](${context.payload.repository?.html_url}/commit/${context.sha})`,
`- **Workflow Run**: [View Failed Run Logs](${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId})`,
'- **Failing Target**: `php run-tests.php -m` (Valgrind memcheck)',
'- **Failing Target**: `make test TESTS="-m …"` (Valgrind memcheck)',
'',
'#### Local Reproduction Command:',
'```bash',
'USE_ZEND_ALLOC=0 valgrind --leak-check=full php run-tests.php -m -q --show-diff tests/',
'phpize && ./configure --with-judy=/usr CFLAGS="-g -O0 -Wall" && make',
'make test TESTS="-m -q --show-diff -d pcre.jit=0 tests/" NO_INTERACTION=1 REPORT_EXIT_STATUS=1',
'```'
].join('\n');

Expand Down
4 changes: 4 additions & 0 deletions tests/bench_compare_drift_001.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ bench-compare: PHP control decides contamination; uniform real shifts keep per-c
--SKIPIF--
<?php
if (substr(PHP_OS, 0, 3) === 'WIN') die('skip POSIX shell required');
// run-tests -m exports USE_ZEND_ALLOC=0 and traces children: every child PHP
// this test spawns runs under memcheck too, distorting timings and surfacing
// child-side bailout noise as leaks of this test (issue #202).
if (getenv('USE_ZEND_ALLOC') === '0') die('skip spawns child PHP processes; not meaningful under Valgrind');
$root = dirname(__DIR__);
if (!is_file("$root/scripts/bench-compare.php")) die('skip scripts/bench-compare.php not present');
if (!is_file("$root/modules/judy.so")) die('skip requires in-tree build (modules/judy.so)');
Expand Down
4 changes: 4 additions & 0 deletions tests/bench_memory_limit_001.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ judy-bench: memory_limit is a floor a caller can raise, not a cap that overrides
--SKIPIF--
<?php
if (substr(PHP_OS, 0, 3) === 'WIN') die('skip POSIX shell required');
// run-tests -m exports USE_ZEND_ALLOC=0 and traces children: memory_limit
// fatals in child PHP processes leave everything unfreed by design, which
// memcheck then reports as leaks of this test (issue #202).
if (getenv('USE_ZEND_ALLOC') === '0') die('skip spawns child PHP processes; not meaningful under Valgrind');
$root = dirname(__DIR__);
if (!is_file("$root/examples/benchmarks/judy-bench.php")) die('skip judy-bench.php not present');
if (!is_file("$root/modules/judy.so")) die('skip requires in-tree build (modules/judy.so)');
Expand Down
4 changes: 4 additions & 0 deletions tests/bench_memory_measurement_001.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ judy-bench: memory is measured as peak RSS, not the emalloc heap (issue #172)
--SKIPIF--
<?php
if (substr(PHP_OS, 0, 3) === 'WIN') die('skip POSIX shell required');
// run-tests -m exports USE_ZEND_ALLOC=0 and traces children: memcheck inflates
// the child processes' RSS by an order of magnitude, breaking every heap-vs-RSS
// relationship this test asserts (issue #202).
if (getenv('USE_ZEND_ALLOC') === '0') die('skip spawns child PHP processes; RSS assertions invalid under Valgrind');
if (!function_exists('getrusage')) die('skip getrusage() not available');
if (!function_exists('shell_exec')) die('skip shell_exec() disabled');
$root = dirname(__DIR__);
Expand Down
Loading