Skip to content
Open
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
85 changes: 85 additions & 0 deletions .github/actions/solaris/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: Solaris
inputs:
configurationParameters:
default: ''
required: false
runExtraTests:
default: false
required: false
runs:
using: composite
steps:
- name: Solaris
uses: vmactions/solaris-vm@v1
with:
release: "11.4-gcc"
usesh: true
copyback: false
prepare: |
cd $GITHUB_WORKSPACE
pkg install bison developer/icu libzip oniguruma re2c

./buildconf -f
CC=gcc CXX=g++ \
PATH=/usr/gnu/bin:/usr/bin \
PKG_CONFIG_PATH=/usr/lib/amd64/pkgconfig \
./configure \
--prefix=/usr/local \
--enable-debug \
--enable-option-checking=fatal \
--enable-fpm \
--without-pear \
--with-bz2 \
--with-jpeg \
--with-webp \
--with-freetype \
--enable-gd \
--enable-exif \
--with-zip \
--with-zlib \
--enable-soap \
--enable-xmlreader \
--with-xsl \
--with-libxml \
--enable-shmop \
--enable-pcntl \
--enable-mbstring \
--with-curl \
--enable-sockets \
--with-openssl \
--enable-bcmath \
--enable-calendar \
--enable-ftp \
--enable-zend-test \
--enable-dl-test=shared \
--enable-intl \
--with-mhash \
--with-config-file-path=/etc \
--with-config-file-scan-dir=/etc/php.d \
${{ inputs.configurationParameters }}

gmake -j2
mkdir /etc/php.d
gmake install > /dev/null
echo opcache.enable_cli=1 > /etc/php.d/opcache.ini
echo opcache.protect_memory=1 >> /etc/php.d/opcache.ini
echo opcache.preload_user=root >> /etc/php.d/opcache.ini
run: |
cd $GITHUB_WORKSPACE

export SKIP_IO_CAPTURE_TESTS=1
export CI_NO_IPV6=1
export STACK_LIMIT_DEFAULTS_CHECK=1
PATH=/usr/gnu/bin:/usr/bin \
sapi/cli/php run-tests.php \
-P -q -j1 \
-g FAIL,BORK,LEAK,XLEAK \
--no-progress \
--offline \
--show-diff \
--show-slow 1000 \
--set-timeout 120

if test "${{ inputs.runExtraTests }}" = "true"; then
sapi/cli/php run-extra-tests.php
fi
24 changes: 24 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ on:
run_freebsd_zts:
required: true
type: boolean
run_solaris_zts:
required: true
type: boolean
ubuntu_version:
required: true
type: string
Expand Down Expand Up @@ -1034,3 +1037,24 @@ jobs:
configurationParameters: >-
--${{ matrix.zts && 'enable' || 'disable' }}-zts
runExtraTests: true
SOLARIS:
strategy:
fail-fast: false
matrix:
zts: [true, false]
exclude:
- zts: ${{ !inputs.run_solaris_zts && true || '*never*' }}
name: "SOLARIS_${{ matrix.zts && 'ZTS' || 'NTS' }}"
runs-on: ubuntu-latest
timeout-minutes: 50
steps:
- name: git checkout
uses: actions/checkout@v5
with:
ref: ${{ inputs.branch }}
- name: Solaris
uses: ./.github/actions/solaris
with:
configurationParameters: >-
--${{ matrix.zts && 'enable' || 'disable' }}-zts
runExtraTests: true
11 changes: 11 additions & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ on:
- PHP-8.4
- PHP-8.5
- master
- github-solaris-ci
pull_request:
paths-ignore: *ignore_paths
branches:
Expand Down Expand Up @@ -409,3 +410,13 @@ jobs:
uses: actions/checkout@v5
- name: FreeBSD
uses: ./.github/actions/freebsd
SOLARIS:
if: github.repository == 'psumbera/php-src' || github.event_name == 'pull_request'
name: SOLARIS
runs-on: ubuntu-latest
timeout-minutes: 50
steps:
- name: git checkout
uses: actions/checkout@v5
- name: Solaris
uses: ./.github/actions/solaris
1 change: 1 addition & 0 deletions .github/workflows/root.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ jobs:
run_linux_ppc64: ${{ (matrix.branch.version[0] == 8 && matrix.branch.version[1] >= 4) || matrix.branch.version[0] >= 9 }}
run_macos_arm64: ${{ (matrix.branch.version[0] == 8 && matrix.branch.version[1] >= 4) || matrix.branch.version[0] >= 9 }}
run_freebsd_zts: ${{ (matrix.branch.version[0] == 8 && matrix.branch.version[1] >= 3) || matrix.branch.version[0] >= 9 }}
run_solaris_zts: ${{ (matrix.branch.version[0] == 8 && matrix.branch.version[1] >= 3) || matrix.branch.version[0] >= 9 }}
ubuntu_version: ${{
(((matrix.branch.version[0] == 8 && matrix.branch.version[1] >= 5) || matrix.branch.version[0] >= 9) && '24.04')
|| '22.04' }}
Expand Down
4 changes: 3 additions & 1 deletion Zend/tests/stack_limit/stack_limit_010.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ $expectedMaxSize = match(php_uname('s')) {
'true' => 16*1024*1024, // https://github.com/actions/runner-images/pull/3328
default => 8*1024*1024,
},
'SunOS' => 10 * 1024 * 1024,
'SunOS' => preg_match('/(omnios|illumos|smartos|oi-|openindiana|joyent)/i', php_uname('v'))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does it represent all flavors of illumos ? maybe the reverse logic might be simpler ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hope it does. Solaris 11.4 returns e.g. 11.4.90.211.0 and Solaris 10 e.g.Generic_150400-29. Not sure when Illuoms did relevant change. But it must have been originally the same value as is in Solaris.

? 10 * 1024 * 1024
: 8 * 1024 * 1024,
'Windows NT' => 67108864 - 4*4096, // Set by sapi/cli/config.w32
};

Expand Down
6 changes: 6 additions & 0 deletions ext/calendar/tests/unixtojd.phpt
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
--TEST--
unixtojd()
--SKIPIF--
<?php
if (PHP_OS_FAMILY === 'Solaris') {
die("skip Solaris localtime() produces different Julian day");
}
?>
--EXTENSIONS--
calendar
--ENV--
Expand Down
6 changes: 6 additions & 0 deletions ext/ctype/tests/bug25745.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
Bug #25745 (ctype functions fail with non-ascii characters)
--EXTENSIONS--
ctype
--SKIPIF--
<?php
if (PHP_OS_FAMILY === 'Solaris') {
die("skip not valid fo Solaris");
}
?>
--INI--
error_reporting=E_ALL&~E_DEPRECATED
--FILE--
Expand Down
13 changes: 10 additions & 3 deletions ext/date/lib/parse_date.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,14 @@ static const timelib_tz_lookup_table timelib_timezone_utc[] = {
};

#if defined(_POSIX_TZNAME_MAX)
# define MAX_ABBR_LEN _POSIX_TZNAME_MAX
/* Solaris exposes _POSIX_TZNAME_MAX = 3 unless _XPG6 is defined.
* That is too small for real-world timezone abbreviations ("EDT", "CEST", ...).
*/
#if defined(__sun__) && _POSIX_TZNAME_MAX < 6
#define MAX_ABBR_LEN 6
#else
#define MAX_ABBR_LEN _POSIX_TZNAME_MAX
#endif
#elif defined(TZNAME_MAX)
# define MAX_ABBR_LEN TZNAME_MAX
#else
Expand Down Expand Up @@ -24863,10 +24870,10 @@ timelib_time *timelib_strtotime(const char *s, size_t len, timelib_error_contain
in.errors->error_messages = NULL;

if (len > 0) {
while (isspace(*s) && s < e) {
while (isspace((unsigned char)*s) && s < e) {
s++;
}
while (isspace(*e) && e > s) {
while (isspace((unsigned char)*e) && e > s) {
e--;
}
}
Expand Down
2 changes: 1 addition & 1 deletion ext/date/tests/bug33532.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ error_reporting=2047
date.timezone=UTC
--SKIPIF--
<?php
if(PHP_OS == 'Darwin' || defined('PHP_WINDOWS_VERSION_MAJOR')) die("skip strftime uses system TZ on Darwin and Windows");
if(PHP_OS == 'Darwin' || PHP_OS_FAMILY === 'Solaris' || defined('PHP_WINDOWS_VERSION_MAJOR')) die("skip strftime uses system TZ on Darwin and Windows");
if (!@strftime('%Z')) die('skip strftime does not support %Z');
?>
--FILE--
Expand Down
3 changes: 3 additions & 0 deletions ext/date/tests/gmstrftime_variation16.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ Test gmstrftime() function : usage variation - Checking time related formats whi
if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') {
die("skip Test is not valid for Windows");
}
if (PHP_OS_FAMILY === 'Solaris') {
die("skip Solaris uses ' 8:08:08 AM' for %r (time format differs)");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as a follow-up PR, might be worth doing solaris only versions of tests related to time formats.

}
?>
--FILE--
<?php
Expand Down
3 changes: 3 additions & 0 deletions ext/date/tests/strftime_variation16.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ Test strftime() function : usage variation - Checking time related formats which
if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') {
die("skip Test is not valid for Windows");
}
if (PHP_OS_FAMILY === 'Solaris') {
die("skip Solaris uses ' 8:08:08 AM' for %r (time format differs)");
}
?>
--FILE--
<?php
Expand Down
6 changes: 6 additions & 0 deletions ext/fileinfo/tests/finfo_upstream.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
Fileinfo run upstream tests
--EXTENSIONS--
fileinfo
--SKIPIF--
<?php
if (PHP_OS_FAMILY === 'Solaris') {
die("skip timezone-dependent libmagic output differs on Solaris");
}
?>
--ENV--
TZ=UTC
--FILE--
Expand Down
3 changes: 3 additions & 0 deletions ext/iconv/tests/bug37773.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ if ($test === false) {
die("skip UTF-8 is not supported?");
}

if (PHP_OS_FAMILY === 'Solaris') {
die("skip Solaris iconv behaves differently");
}
?>
--FILE--
<?php
Expand Down
6 changes: 6 additions & 0 deletions ext/iconv/tests/bug52211.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
Bug #52211 (iconv() returns part of string on error)
--EXTENSIONS--
iconv
--SKIPIF--
<?php
if (PHP_OS_FAMILY === 'Solaris') {
die("skip Solaris iconv behaves differently");
}
?>
--FILE--
<?php

Expand Down
6 changes: 6 additions & 0 deletions ext/iconv/tests/bug69840.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
Bug #69840 (iconv_substr() doesn't work with UTF-16BE)
--EXTENSIONS--
iconv
--SKIPIF--
<?php
if (PHP_OS_FAMILY === 'Solaris') {
die("skip Solaris iconv behaves differently");
}
?>
--FILE--
<?php
$str = iconv_substr("a\x00b\x00", 0, 1, 'UTF-16LE');
Expand Down
6 changes: 6 additions & 0 deletions ext/iconv/tests/eucjp2iso2022jp.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
EUC-JP to ISO-2022-JP
--EXTENSIONS--
iconv
--SKIPIF--
<?php
if (PHP_OS_FAMILY === 'Solaris') {
die("skip Solaris iconv behaves differently");
}
?>
--INI--
error_reporting=2039
--FILE--
Expand Down
6 changes: 6 additions & 0 deletions ext/iconv/tests/iconv003.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
iconv() test 3
--EXTENSIONS--
iconv
--SKIPIF--
<?php
if (PHP_OS_FAMILY === 'Solaris') {
die("skip Solaris iconv behaves differently");
}
?>
--FILE--
<?php
for ($i = 0; $i < 3; ++$i) {
Expand Down
1 change: 1 addition & 0 deletions ext/iconv/tests/iconv_basic_001.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ iconv
if (substr(PHP_OS, 0, 3) == 'WIN' ) {die('skip not for windows');}
if (setlocale(LC_ALL, 'invalid') === 'invalid') { die('skip setlocale() is broken /w musl'); }
if (setlocale(LC_ALL, "en_US.utf8") === false) { die('skip en_US.utf8 locales not available'); }
if (PHP_OS_FAMILY === 'Solaris') { die("skip Solaris native iconv lacks GNU transliteration"); }
?>
--FILE--
<?php
Expand Down
6 changes: 6 additions & 0 deletions ext/iconv/tests/iconv_mime_encode.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ iconv_mime_encode()
iconv
--INI--
iconv.internal_charset=iso-8859-1
--SKIPIF--
<?php
if (PHP_OS_FAMILY === 'Solaris') {
die("skip Solaris native iconv does not support MIME encoding");
}
?>
--FILE--
<?php
function my_error_handler($errno, $errmsg, $filename, $linenum)
Expand Down
6 changes: 6 additions & 0 deletions ext/iconv/tests/iconv_strrpos.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
iconv_strrpos()
--EXTENSIONS--
iconv
--SKIPIF--
<?php
if (PHP_OS_FAMILY === 'Solaris') {
die("skip Solaris iconv behaves differently");
}
?>
--INI--
iconv.internal_charset=ISO-8859-1
--FILE--
Expand Down
6 changes: 6 additions & 0 deletions ext/iconv/tests/iconv_substr_out_of_bounds.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
iconv_substr() with out of bounds offset
--EXTENSIONS--
iconv
--SKIPIF--
<?php
if (PHP_OS_FAMILY === 'Solaris') {
die("skip Solaris iconv behaves differently");
}
?>
--FILE--
<?php

Expand Down
2 changes: 1 addition & 1 deletion ext/libxml/tests/bug61367-write.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,5 @@ bool(true)

Warning: DOMDocument::save(): open_basedir restriction in effect. File(%s) is not within the allowed path(s): (.) in %s on line %d

Warning: DOMDocument::save(%s): Failed to open stream: Operation not permitted in %s on line %d
Warning: DOMDocument::save(%s): Failed to open stream: %s in %s on line %d
bool(false)
2 changes: 2 additions & 0 deletions ext/mysqli/tests/gh9590.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ if (mysqli_get_server_version($link) < 50012)

if (!function_exists('posix_setrlimit') || !posix_setrlimit(POSIX_RLIMIT_NOFILE, 2048, -1))
die('skip Failed to set POSIX_RLIMIT_NOFILE');
if (PHP_OS_FAMILY === 'Solaris')
die('skip Solaris LP64 FD_SETSIZE=65536 not practically exceedable here');
?>
--FILE--
<?php
Expand Down
2 changes: 1 addition & 1 deletion ext/opcache/shared_alloc_shm.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
# define MIN(x, y) ((x) > (y)? (y) : (x))
#endif

#define SEG_ALLOC_SIZE_MAX 32*1024*1024
Copy link
Member

@devnexen devnexen Dec 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it seems a slightly unrelated change to me (I do not say it is right or wrong tough).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On Solaris, OPcache uses the SysV SHM allocator (shared_alloc_shm.c), which hard-limits individual segments to 32 MB (SEG_ALLOC_SIZE_MAX). With JIT enabled, OPcache reserves a default 64 MB buffer (ZEND_JIT_DEFAULT_BUFFER_SIZE) from the last shared segment during zend_shared_alloc_startup(). This makes startup fail with “Insufficient shared memory!” because the last segment can never satisfy the reservation.

Copy link
Member

@devnexen devnexen Dec 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, but what I understood from the comment is opcache on solaris can't work without this change ? If that is the case, this change needs to be a PR on its own as a bug fix (from the lowest branch it needs to apply).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have created #20719 .

#define SEG_ALLOC_SIZE_MAX 64*1024*1024 /* 64MB to match ZEND_JIT_DEFAULT_BUFFER_SIZE */
#define SEG_ALLOC_SIZE_MIN 2*1024*1024

typedef struct {
Expand Down
1 change: 1 addition & 0 deletions ext/pcntl/tests/pcntl_cpuaffinity.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ pcntl
--SKIPIF--
<?php
if (!function_exists("pcntl_setcpuaffinity")) die("skip pcntl_setcpuaffinity is not available");
if (PHP_OS_FAMILY === 'Solaris') die("skip CPU affinity not supported on Solaris");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is the test failing and in which manner ? because as far as I see it is supported by solaris.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It fails like this:

Running selected tests.
TEST 1/1 [ext/pcntl/tests/pcntl_cpuaffinity.phpt]
========DIFF========
001- bool(true)
002- array(0) {
003- }
004- array(0) {
005- }
006- bool(true)
007- pcntl_setcpuaffinity(): Argument #2 ($cpu_ids) must not be empty
008- pcntl_setcpuaffinity(): Argument #2 ($cpu_ids) cpu id invalid value (def)
009- pcntl_setcpuaffinity(): Argument #2 ($cpu_ids) cpu id must be between 0 and %d (%d)
010- pcntl_setcpuaffinity(): Argument #2 ($cpu_ids) cpu id must be between 0 and %d (-1024)
011- pcntl_getcpuaffinity(): Argument #1 ($process_id) invalid process (-1024)
012- pcntl_setcpuaffinity(): Argument #2 ($cpu_ids) value must be of type int|string, array given
001+ Warning: pcntl_setcpuaffinity(): pset_create: Cannot allocate memory in /root/php-src/ext/pcntl/tests/pcntl_cpuaffinity.php on line 3
002+ bool(false)
003+ 
004+ Warning: pcntl_getcpuaffinity(): pset_create: Cannot allocate memory in /root/php-src/ext/pcntl/tests/pcntl_cpuaffinity.php on line 4
005+ 
006+ Fatal error: Uncaught TypeError: array_diff(): Argument #2 must be of type array, false given in /root/php-src/ext/pcntl/tests/pcntl_cpuaffinity.php:5
007+ Stack trace:
008+ #0 /root/php-src/ext/pcntl/tests/pcntl_cpuaffinity.php(5): array_diff(Array, false)
009+ #1 {main}
010+   thrown in /root/php-src/ext/pcntl/tests/pcntl_cpuaffinity.php on line 5
========DONE========
FAIL pcntl_getcpuaffinity() and pcntl_setcpuaffinity() [ext/pcntl/tests/pcntl_cpuaffinity.phpt] 

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the test might need adaptation rather than disabling it, pset_create seems to set errno to ENOMEM here. We can devise about it later..

?>
--FILE--
<?php
Expand Down
Loading