Conversation
bbc1c07 to
9c9436d
Compare
|
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"); |
There was a problem hiding this comment.
is the test failing and in which manner ? because as far as I see it is supported by solaris.
There was a problem hiding this comment.
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]
There was a problem hiding this comment.
the test might need adaptation rather than disabling it, pset_create seems to set errno to ENOMEM here. We can devise about it later..
There was a problem hiding this comment.
btw do you run it under a VM ? curious also what psrset gives
There was a problem hiding this comment.
btw do you run it under a VM ? curious also what
psrsetgives
Yes, it's VM. When I run test on real machine I get:
========DIFF========
--
pcntl_setcpuaffinity(): Argument #2 ($cpu_ids) cpu id invalid value (def)
pcntl_setcpuaffinity(): Argument #2 ($cpu_ids) cpu id must be between 0 and %d (%d)
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)
pcntl_setcpuaffinity(): Argument #2 ($cpu_ids) value must be of type int|string, array given
========DONE========
FAIL pcntl_getcpuaffinity() and pcntl_setcpuaffinity() [ext/pcntl/tests/pcntl_cpuaffinity.phpt]
I don't see difference in psrset output between VM and real machine. Both give lines like:
processor set SYSpsrset_1 1: empty
..
There was a problem hiding this comment.
Ok that should be largely enough, when I implemented this feature, it I just used a openindiana VM with only 8GB.
That might be swap space issue ; I guess you re really booting a 64 bits kernel.
That would be sad to disable this test just because of particular environment context.
There was a problem hiding this comment.
Ok, there is something wrong with VM. Another one doesn't have the problem.
There was a problem hiding this comment.
Not sure about this one. For now I left it disabled:
TEST 1/1 [ext/pcntl/tests/pcntl_getcpu.phpt]
========DIFF========
bool(true)
002- int(1)
002+ int(2)
========DONE========
FAIL pcntl_getcpu() [ext/pcntl/tests/pcntl_getcpu.phpt]
There was a problem hiding this comment.
this one issue seems real at first glance, the test should not even launch on solaris/illumos. Is HAVE_SCHED_GETCPU commented in your main/php_config.h ?
There was a problem hiding this comment.
Yes, it is (/* #undef HAVE_SCHED_GETCPU */).
ext/opcache/shared_alloc_shm.c
Outdated
| # define MIN(x, y) ((x) > (y)? (y) : (x)) | ||
| #endif | ||
|
|
||
| #define SEG_ALLOC_SIZE_MAX 32*1024*1024 |
There was a problem hiding this comment.
it seems a slightly unrelated change to me (I do not say it is right or wrong tough).
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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).
9c9436d to
924f86d
Compare
trusting the call to handle invalid process id via errnos. see #20709 (comment) for rationale. close GH-20731
3971a8f to
db47277
Compare
db47277 to
eb04fc5
Compare
e711432 to
58ee7f0
Compare
998f8ba to
97b36c0
Compare
|
I believe this should be now ready to go. |
| <?php | ||
| if (getenv("SKIP_BROKEN_PSET_CREATE")) { | ||
| die("skip broken pset_create()"); | ||
| } |
There was a problem hiding this comment.
Why is this excluded specially, rather than with usual the PHP_OS_FAMILY === 'Solaris' check?
There was a problem hiding this comment.
I think the reason was that this might work sometimes. Maybe for Illumos?
e9808d1 to
7ba6892
Compare
7ba6892 to
d4d0613
Compare
|
I believe everything was resolved here. What shall be done now in order to merge this change? |
|
@psumbera There were big changes in CI. I can resolve the conflicts for you. After that I'll do another review. |
d4d0613 to
3b758f3
Compare
32fe148 to
f12d59c
Compare
f12d59c to
e23292d
Compare
e23292d to
8a8099f
Compare
No description provided.