1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

161 Commits

Author SHA1 Message Date
Petr Sumbera
ce1cadba29 Fix Solaris tests and add nightly CI job
Closes GH-20709
2026-03-04 10:12:03 +01:00
David Carlier
2fd3433ed0 Merge branch 'PHP-8.5'
* PHP-8.5:
  ext/pcntl: add new tests to ver invalid signals handling.
2026-02-28 20:23:11 +00:00
David Carlier
2bbca7c9b9 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  ext/pcntl: add new tests to ver invalid signals handling.
2026-02-28 20:23:00 +00:00
David Carlier
cf9d6f454a ext/pcntl: add new tests to ver invalid signals handling.
from pcntl_sigprocmask(), pcntl_sigwaitinfo(), and pcntl_sigtimedwait().

close GH-21297
2026-02-28 20:21:54 +00:00
David Carlier
9b01f51701 ext/pcntl: Reject negative values in pcntl_alarm()
internal refactorings:

- pcntl_signal_get_handler() max signals handling simplification,
 reusing the num_signals global.
- pcntl_alarm() accepts a zend_long (signed) but passes it to alarm(),
which takes an unsigned int. Negative values silently wrap to large
unsigned values, scheduling an alarm far in the future instead of
raising an error. Also reject large values above unsigned long
max value.

close GH-21282
2026-02-26 18:06:40 +00:00
David Carlier
92baeddd42 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  ext/pcntl: fix pcntl_signal_dispatch() stale tail pointer and exception handling.
2026-02-23 21:26:06 +00:00
David Carlier
296fad10fb ext/pcntl: fix pcntl_signal_dispatch() stale tail pointer and exception handling.
close GH-21259
2026-02-23 21:24:38 +00:00
Vladimir Vrzić
aea3ade74f ext/pcntl: Added rusage parameter to pcntl_waitid
This functionality is not part of the POSIX interface.

- On FreeBSD, the wait6 system call provides it
- On Linux, the raw waitid system call provides it (glibc does not)

close GH-15921
2025-06-24 19:21:03 +01:00
Gina Peter Banyard
8cd4f95ea3 ext/pcntl: Remove bool type coercions in tests 2025-06-23 14:29:59 +02:00
David Carlier
951d2f81c7 Merge branch 'PHP-8.4' 2025-01-15 20:37:19 +00:00
David Carlier
6979a7a954 ext/pcntl: Fix pcntl_setcpuaffinity exception type for invalid cpu id.
found while working [on the doc](https://github.com/php/doc-en/pull/4346).

close GH-17474
2025-01-15 20:36:18 +00:00
Gina Peter Banyard
b53b52985b ext/pcntl: Refactor pcntl_exec() (#17172)
* Refactor usage of strlcpy

As we allocate the buffer, we know the string will fit inside the buffer.

* Throw ValueErrors when strings contain null bytes

The underlying C calls work with C strings, which are NULL terminated.

* exec_pcntl() always return false

Thus, update stubs to formally have a return type of `false`.
2024-12-17 13:19:10 +00:00
Gina Peter Banyard
e02c226725 Merge branch 'PHP-8.4'
* PHP-8.4:
  ext/pcntl: Fix memory leak in cleanup code of pcntl_exec()
2024-12-15 22:14:25 +00:00
Gina Peter Banyard
47b262086a Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  ext/pcntl: Fix memory leak in cleanup code of pcntl_exec()
2024-12-15 22:13:54 +00:00
Gina Peter Banyard
2df9f32732 ext/pcntl: Fix memory leak in cleanup code of pcntl_exec() 2024-12-15 22:13:27 +00:00
David Carlier
53e5c09052 Merge branch 'PHP-8.4' 2024-11-13 12:12:25 +00:00
David Carlier
b8115d6c5e Fix GH-16769: php_pcntl_set_user_signal_infos aborts when a signal is a reference.
close GH-16772
2024-11-13 12:11:43 +00:00
Ilija Tovilo
fb257ee83c Upgrade master to Ubuntu 24.04 (GH-16704) 2024-11-07 16:32:45 +01:00
Peter Kokot
13f041163c Remove Travis artefacts (#15714)
Travis was suspended https://github.com/php/php-src/pull/15314

This removes 404 errored Travis image in README, travis configuration
directory and YAML file and usages in tests.

[skip ci]

Co-authored-by: Gina Peter Banyard <girgias@php.net>
2024-09-04 01:15:10 +02:00
Gina Peter Bnayard
5853cdb73d Use "must not" instead of "cannot" wording 2024-08-21 21:12:17 +01:00
Gina Peter Bnayard
c811d58953 ext/pcntl: Use standard wording for ValueError 2024-08-21 21:12:17 +01:00
David Carlier
17cf7b381a ext/pcntl adding Pcntl namespace for Qos class.
Close GH-14892
2024-07-10 19:15:04 +01:00
Vladimir Vrzić
c2fd071db7 ext/pcntl: Added new function pcntl_waitid
to obtain status information pertaining termination, stop, and/or
continue events in one the caller's child processes.

close GH-14617
2024-07-07 11:04:14 +01:00
David Carlier
d40726670f ext/pcntl: pcntl_getqos_class/pcntl_setqos_class addition.
Introducting macOs Quality Of Service through those two calls.
on macOs arm64/M*, there is no concept of individual cores, thus
the old thread policy for cpu affinity does not work here.
Instead, the user can apply to the current process the level of
 performance/energy consumption they wish from the highest
QosClass::UserInteractive to QosClass::Background.

Close GH-13945
2024-04-15 18:52:28 +01:00
Dmitry Stogov
a37d661db5 Fix false positive test failure 2024-04-10 09:01:46 +03:00
David Carlier
d8f2900574 ext/pcntl: adding pcntl_getcpu.
using sched_getcpu under the hood (Linux and FreeBSD).
Returns the current cpu id for the current process.
For Linux, we need to see beyond the sole presence of the symbol
to consider it.
Mostly useful, for now, in the cpu affinity context since
the os can migrate processes as it sees fits otherwise.

Clos GH-13908
2024-04-07 20:05:03 +01:00
David CARLIER
dd2ffaab2c ext/pcntl: pcntl affinity improves EINVAL handling in both cases. (#13907)
also disable tests on travis.
2024-04-07 16:43:36 +01:00
David Carlier
1cf8291c85 ext/pcntl: cpu affinity api introduction.
For now, working on Linux, FreeBSD >= 13.x and DragonFlyBSD.
Handy wrapper to assign an array of cpu ids or to retrieve the cpu ids
assigned to a given process.

pcntl_setaffinity inserts valid unique cpu ids (within the range of available
cpus).

Close GH-13893
2024-04-07 00:56:54 +01:00
David Carlier
ae4978a139 ext/pcntl: adding pcntl_setns for Linux >= 5.3
allows a given process to join an existing Linux namespace, relatively
complementary to the existing pcntl_unshare.

Close GH-13878
2024-04-04 18:45:15 +01:00
David CARLIER
7db7c420f1 ext/pcntl: pcntl_unshare minor error message clarification (for EINVAL). (#13872)
it is not necessarily a bad flag but can just be unsupported by the
current kernel.
2024-04-02 23:26:07 +01:00
divinity76
6d0a3e86f0 [skip ci] accidentally used print() instead of die() (#13158) 2024-01-17 01:40:04 +01:00
Gina Peter Banyard
1bdb0fddc1 Refactor pcntl_sigprocmask()/pcntl_sigwaitinfo()/pcntl_sigtimedwait() (#11860) 2023-11-16 00:40:18 +00:00
Ilija Tovilo
8eb740b432 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix getpriority test with negative return value
2023-09-22 10:26:10 +02:00
Ilija Tovilo
645ea22390 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix getpriority test with negative return value
2023-09-22 10:26:01 +02:00
Ilija Tovilo
181598d403 Fix getpriority test with negative return value
Negative return values are valid and denote higher priority.

https://man7.org/linux/man-pages/man2/setpriority.2.html
2023-09-22 10:25:15 +02:00
Niels Dossche
633e7455e5 Merge branch 'PHP-8.2'
* PHP-8.2:
  Revert the fix for GH-11498
2023-08-03 21:59:35 +02:00
Niels Dossche
c59bfc8d98 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Revert the fix for GH-11498
2023-08-03 21:59:21 +02:00
Niels Dossche
f7be15dbad Revert the fix for GH-11498
People relied on manually waiting for children, but the fix for GH-11498
broke this. Fixing this in PHP is fundamentally incompatible with doing
the wait loop in userland. This reverts to the old behaviour.

Closes GH-11863.
2023-08-03 21:48:34 +02:00
Ilija Tovilo
28117d718f Merge branch 'PHP-8.2'
* PHP-8.2:
  Attempt to fix gh11498.phpt on MSAN
2023-06-30 09:42:46 +02:00
Ilija Tovilo
04cd8859dd Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Attempt to fix gh11498.phpt on MSAN
2023-06-30 09:42:34 +02:00
Ilija Tovilo
07dd0c80a8 Attempt to fix gh11498.phpt on MSAN
The issue might be that due to slow instrumentation the process might end before
we get to add it to the processes list. If the SIGCHLD handler executes before
adding the process to the list it will never be removed again.
2023-06-30 09:39:19 +02:00
Ilija Tovilo
db2ac3a656 Merge branch 'PHP-8.2'
* PHP-8.2:
  Fix use of uninitialized memory in pcntl SIGCHLD handling
2023-06-27 11:03:48 +02:00
Ilija Tovilo
7d188491c4 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix use of uninitialized memory in pcntl SIGCHLD handling
2023-06-27 11:03:42 +02:00
Ilija Tovilo
003cf9da78 Fix use of uninitialized memory in pcntl SIGCHLD handling
psig needs to stay the tail, so that we don't get a dangling element on the end.

Closes GH-11536
2023-06-27 11:02:59 +02:00
Niels Dossche
0de8bc270d Merge branch 'PHP-8.2'
* PHP-8.2:
  Fix GH-11498: SIGCHLD is not always returned from proc_open
2023-06-23 22:04:40 +02:00
Niels Dossche
022b6aa4cb Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix GH-11498: SIGCHLD is not always returned from proc_open
2023-06-23 21:58:05 +02:00
nielsdos
f39b513916 Fix GH-11498: SIGCHLD is not always returned from proc_open
Linux, and maybe other unixes, may merge multiple standard signals into
a single one. This causes issues when keeping track of process IDs.
Solve this by manually checking which children are dead using waitpid().

Test case is based on taka-oyama's test code.

Closes GH-11509.
2023-06-23 21:56:21 +02:00
Mikhail Galanin
a6911cbd4d Suppress warning when the test run under non-root (#11400)
When we run the test under non-root user, the test gets BORKed with:

Warning: pcntl_unshare(): Error 1: No privilege to use these flags in ext/pcntl/tests/pcntl_unshare_03.skip.php on line 8
skip Insufficient privileges for CLONE_NEWUSER

It looks like for the root-user there is the similar warning which is already suppressed (see the following "skip").
Let us skip the test properly if we aren't able to execute it
2023-06-08 16:16:47 +02:00
Ilija Tovilo
fc88f155be Add zend_alloc XLEAK support
In the future we may want to use a different exit code to warn for tests that
didn't leak.

Closes GH-10999
2023-04-03 12:55:26 +02:00
Ilija Tovilo
b08901b63f Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Migrate i386 to GitHub actions
2022-11-03 14:37:59 +01:00