Skip to content

ext/opcache JIT: attempt to fix EPERM on unprotecting dasm buffer. #13351

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
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
1 change: 1 addition & 0 deletions .github/actions/brew/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ runs:
tidy-html5 \
libxml2 \
libjpeg \
libsodium \
libxslt \
postgresql
brew link icu4c gettext --force
36 changes: 18 additions & 18 deletions .github/actions/configure-macos/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,25 @@ runs:
- shell: bash
run: |
set -x
export PATH="/usr/local/opt/bison/bin:$PATH"
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/opt/openssl@1.1/lib/pkgconfig"
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/opt/curl/lib/pkgconfig"
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/opt/krb5/lib/pkgconfig"
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/opt/libffi/lib/pkgconfig"
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/opt/libxml2/lib/pkgconfig"
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/opt/libxslt/lib/pkgconfig"
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/opt/zlib/lib/pkgconfig"
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/opt/icu4c/lib/pkgconfig"
BREW_OPT="$(brew --prefix)"/opt
export PATH="$BREW_OPT/bison/bin:$PATH"
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$BREW_OPT/openssl@1.1/lib/pkgconfig"
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$BREW_OPT/curl/lib/pkgconfig"
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$BREW_OPT/krb5/lib/pkgconfig"
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$BREW_OPT/libffi/lib/pkgconfig"
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$BREW_OPT/libxml2/lib/pkgconfig"
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$BREW_OPT/libxslt/lib/pkgconfig"
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$BREW_OPT/zlib/lib/pkgconfig"
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$BREW_OPT/icu4c/lib/pkgconfig"
./buildconf --force
./configure \
--enable-option-checking=fatal \
--prefix=/usr/local \
--enable-fpm \
--with-pdo-mysql=mysqlnd \
--with-mysqli=mysqlnd \
--with-pgsql=/usr/local/opt/libpq \
--with-pdo-pgsql=/usr/local/opt/libpq \
--with-pgsql="$BREW_OPT"/libpq \
--with-pdo-pgsql="$BREW_OPT"/libpq \
--with-pdo-sqlite \
--without-pear \
--enable-gd \
Expand All @@ -39,25 +40,24 @@ runs:
--enable-soap \
--enable-xmlreader \
--with-xsl \
--with-tidy=/usr/local/opt/tidy-html5 \
--with-tidy="$BREW_OPT"/tidy-html5 \
--with-libxml \
--enable-sysvsem \
--enable-sysvshm \
--enable-shmop \
--enable-pcntl \
--with-readline=/usr/local/opt/readline \
--with-readline="$BREW_OPT"/readline \
--enable-mbstring \
--with-curl \
--with-gettext=/usr/local/opt/gettext \
--with-gettext="$BREW_OPT"/gettext \
--enable-sockets \
--with-bz2=/usr/local/opt/bzip2 \
--with-bz2="$BREW_OPT"/bzip2 \
--with-openssl \
--with-gmp=/usr/local/opt/gmp \
--with-iconv=/usr/local/opt/libiconv \
--with-gmp="$BREW_OPT"/gmp \
--with-iconv="$BREW_OPT"/libiconv \
--enable-bcmath \
--enable-calendar \
--enable-ftp \
--with-pspell=/usr/local/opt/aspell \
--with-kerberos \
--enable-sysvmsg \
--with-ffi \
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/verify-generated-files/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ runs:
- shell: bash
run: |
set -x
[[ "$OSTYPE" == "darwin"* ]] && export PATH="/usr/local/opt/bison/bin:$PATH"
[[ "$OSTYPE" == "darwin"* ]] && export PATH="$(brew --prefix)/opt/bison/bin:$PATH"
scripts/dev/credits
scripts/dev/genfiles
Zend/zend_vm_gen.php
Expand Down
120 changes: 79 additions & 41 deletions .github/nightly_matrix.php
Original file line number Diff line number Diff line change
@@ -1,23 +1,16 @@
<?php

const BRANCHES = ['master', 'PHP-8.2', 'PHP-8.1', 'PHP-8.0'];
const BRANCHES = [
['name' => 'master', 'ref' => 'master', 'version' => ['major' => 8, 'minor' => 4]],
['name' => 'PHP-8.3', 'ref' => 'PHP-8.3', 'version' => ['major' => 8, 'minor' => 3]],
['name' => 'PHP-8.2', 'ref' => 'PHP-8.2', 'version' => ['major' => 8, 'minor' => 2]],
['name' => 'PHP-8.1', 'ref' => 'PHP-8.1', 'version' => ['major' => 8, 'minor' => 1]],
];

function get_branch_commit_cache_file_path(): string {
return dirname(__DIR__) . '/branch-commit-cache.json';
}

function get_branch_matrix(array $branches) {
$result = array_map(function ($branch) {
$branch_key = strtoupper(str_replace('.', '', $branch));
return [
'name' => $branch_key,
'ref' => $branch,
];
}, $branches);

return $result;
}

function get_branches() {
$branch_commit_cache_file = get_branch_commit_cache_file_path();
$branch_commit_map = [];
Expand All @@ -27,19 +20,19 @@ function get_branches() {

$changed_branches = [];
foreach (BRANCHES as $branch) {
$previous_commit_hash = $branch_commit_map[$branch] ?? null;
$current_commit_hash = trim(shell_exec('git rev-parse origin/' . $branch));
$previous_commit_hash = $branch_commit_map[$branch['ref']] ?? null;
$current_commit_hash = trim(shell_exec('git rev-parse origin/' . $branch['ref']));

if ($previous_commit_hash !== $current_commit_hash) {
$changed_branches[] = $branch;
}

$branch_commit_map[$branch] = $current_commit_hash;
$branch_commit_map[$branch['ref']] = $current_commit_hash;
}

file_put_contents($branch_commit_cache_file, json_encode($branch_commit_map));

return get_branch_matrix($changed_branches);
return $changed_branches;
}

function get_matrix_include(array $branches) {
Expand All @@ -53,27 +46,28 @@ function get_matrix_include(array $branches) {
'configuration_parameters' => "CFLAGS='-fsanitize=undefined,address -DZEND_TRACK_ARENA_ALLOC' LDFLAGS='-fsanitize=undefined,address'",
'run_tests_parameters' => '--asan',
'test_function_jit' => false,
'asan' => true,
];
$jobs[] = [
'name' => '_REPEAT',
'branch' => $branch,
'debug' => true,
'zts' => false,
'run_tests_parameters' => '--repeat 2',
'timeout_minutes' => 360,
'test_function_jit' => true,
'asan' => false,
];
$jobs[] = [
'name' => '_VARIATION',
'branch' => $branch,
'debug' => true,
'zts' => true,
'configuration_parameters' => "CFLAGS='-DZEND_RC_DEBUG=1 -DPROFITABILITY_CHECKS=0 -DZEND_VERIFY_FUNC_INFO=1 -DZEND_VERIFY_TYPE_INFERENCE'",
'timeout_minutes' => 360,
'test_function_jit' => true,
'asan' => false,
];
if ($branch['ref'] !== 'PHP-8.0') {
$jobs[] = [
'name' => '_REPEAT',
'branch' => $branch,
'debug' => true,
'zts' => false,
'run_tests_parameters' => '--repeat 2',
'timeout_minutes' => 360,
'test_function_jit' => true,
];
$jobs[] = [
'name' => '_VARIATION',
'branch' => $branch,
'debug' => true,
'zts' => true,
'configuration_parameters' => "CFLAGS='-DZEND_RC_DEBUG=1 -DPROFITABILITY_CHECKS=0 -DZEND_VERIFY_FUNC_INFO=1'",
'timeout_minutes' => 360,
'test_function_jit' => true,
];
}
}
return $jobs;
}
Expand All @@ -97,17 +91,61 @@ function get_windows_matrix_include(array $branches) {
return $jobs;
}

function get_macos_matrix_include(array $branches) {
$jobs = [];
foreach ($branches as $branch) {
foreach([true, false] as $debug) {
foreach([true, false] as $zts) {
$jobs[] = [
'branch' => $branch,
'debug' => $debug,
'zts' => $zts,
'os' => $branch === 'master' ? '13' : '12',
'arch' => 'X64',
];
if ($branch['version']['minor'] >= 4 || $branch['version']['major'] >= 9) {
$jobs[] = [
'branch' => $branch,
'debug' => $debug,
'zts' => $zts,
'os' => '14',
'arch' => 'ARM64',
];
}
}
}
}
return $jobs;
}

function get_current_version(): array {
$file = dirname(__DIR__) . '/main/php_version.h';
$content = file_get_contents($file);
preg_match('(^#define PHP_MAJOR_VERSION (?<num>\d+)$)m', $content, $matches);
$major = $matches['num'];
preg_match('(^#define PHP_MINOR_VERSION (?<num>\d+)$)m', $content, $matches);
$minor = $matches['num'];
return ['major' => $major, 'minor' => $minor];
}

$trigger = $argv[1] ?? 'schedule';
$attempt = (int) ($argv[2] ?? 1);
$discard_cache = ($trigger === 'schedule' && $attempt !== 1) || $trigger === 'workflow_dispatch';
if ($discard_cache) {
@unlink(get_branch_commit_cache_file_path());
}
$branch = $argv[3] ?? 'master';

$branches = get_branches();
$branches = $branch === 'master'
? get_branches()
: [['name' => strtoupper($branch), 'ref' => $branch, 'version' => get_current_version()]];
$matrix_include = get_matrix_include($branches);
$windows_matrix_include = get_windows_matrix_include($branches);
$macos_matrix_include = get_macos_matrix_include($branches);

echo '::set-output name=branches::' . json_encode($branches, JSON_UNESCAPED_SLASHES) . "\n";
echo '::set-output name=matrix-include::' . json_encode($matrix_include, JSON_UNESCAPED_SLASHES) . "\n";
echo '::set-output name=windows-matrix-include::' . json_encode($windows_matrix_include, JSON_UNESCAPED_SLASHES) . "\n";
$f = fopen(getenv('GITHUB_OUTPUT'), 'a');
fwrite($f, 'branches=' . json_encode($branches, JSON_UNESCAPED_SLASHES) . "\n");
fwrite($f, 'matrix-include=' . json_encode($matrix_include, JSON_UNESCAPED_SLASHES) . "\n");
fwrite($f, 'windows-matrix-include=' . json_encode($windows_matrix_include, JSON_UNESCAPED_SLASHES) . "\n");
fwrite($f, 'macos-matrix-include=' . json_encode($macos_matrix_include, JSON_UNESCAPED_SLASHES) . "\n");
fclose($f);
Loading