Skip to content

Commit 3e9f2fa

Browse files
authored
Avoid dl() in run-tests.php (GH-16126)
Prior to running the tests, the test runner checks for all generally available extensions; it does this by scanning the `extension_dir` for files matching the typical extension pattern, but verifies that the file is actually a PHP extension by calling `dl()`. However, `dl()` has known issues[1]. On Windows CI we always get an ugly "zend_mm_heap corrupted" message, and we even can't `dl()` ext/mysql when OPcache is enabled[2]. So we better avoid the double-check with `dl()`, which is unlikely to be necessary anyway. [1] <#9196> [2] <#8508>
1 parent fbfc899 commit 3e9f2fa

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

.github/scripts/windows/test_task.bat

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,6 @@ rem set SSLEAY_CONF=
8484

8585
rem prepare for OPcache
8686
if "%OPCACHE%" equ "1" set OPCACHE_OPTS=-d opcache.enable=1 -d opcache.enable_cli=1 -d opcache.protect_memory=1 -d opcache.jit_buffer_size=64M -d opcache.jit=tracing
87-
rem work-around for failing to dl(mysqli) with OPcache (https://github.com/php/php-src/issues/8508)
88-
if "%OPCACHE%" equ "1" set OPCACHE_OPTS=%OPCACHE_OPTS% -d extension=mysqli
8987

9088
rem prepare for enchant
9189
mkdir %~d0\usr\local\lib\enchant-2

run-tests.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -867,7 +867,7 @@ function write_information(array $user_tests, $phpdbg): void
867867
$ext_dir = ini_get('extension_dir');
868868
foreach (scandir($ext_dir) as $file) {
869869
if (preg_match('/^(?:php_)?([_a-zA-Z0-9]+)\.(?:so|dll)$/', $file, $matches)) {
870-
if (!extension_loaded($matches[1]) && @dl($matches[1])) {
870+
if (!extension_loaded($matches[1])) {
871871
$exts[] = $matches[1];
872872
}
873873
}

0 commit comments

Comments
 (0)