Skip to content

Conversation

@psumbera
Copy link
Contributor

No description provided.

@devnexen
Copy link
Member

cc @iluuu1994 at least for the CI's aspect.

--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..

# 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 .

release: "11.4-gcc"
usesh: true
copyback: false
# Temporarily disable sqlite, as FreeBSD ships it with disabled double quotes. We'll need to fix our tests.
Copy link
Member

Choose a reason for hiding this comment

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

is it really the same for 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.

No, you are right. I have removed the note and also configure options --without-sqlite3 and --without-pdo-sqlite.

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.

nice ! I struggle whether the CI part needs to have its own PR or not but other members might not be bothered by it, we'll see..

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.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants