Sergei Turchanov [Wed, 28 Aug 2019 03:05:14 +0000 (13:05 +1000)]
Fixed bug #78469
fcgi_accept_request function is supposed to call a FastCGI implementation's
on_accept hook when entering an "accepting" stage (that is right before
calling "accept"). This hook implementation (fpm_request_accepting) updates
a worker state to an "accepting" state which is effectively an "Idle" state,
and updates counters on the scoreboard of the corresponding pool (idle++,
active--).
But this is not done when listening for client connections on a named pipe on
Windows platform. In that case a combination of
ConnectNamedPipe/WaitForSingleObject is used (to be able to catch in_shutdown
as far as I understand), but it is nonetheless functionally equivalent to
"accept" call. Also by not calling on_hook neither a worker's state is updated
to "accepting" state nor scoreboard counters are updated.
Nikita Popov [Tue, 27 Aug 2019 18:54:50 +0000 (20:54 +0200)]
Add job for community projects
Run some open-source projects through an aggressive debug
configuration with asan and ubsan. We don't care about test results,
only check that we don't assert or crash.
Peter Kokot [Wed, 28 Aug 2019 15:21:46 +0000 (17:21 +0200)]
Fix #78460: PEAR installation failure
When building PHP outside of the source tree:
mkdir custom-build-dir
cd custom-build-dir
../path/to/php-src/configure
The directories need to be manually created including the pear directory
so the pear installation PHAR file doesn't need to be downloaded from
the remote location.
Nikita Popov [Thu, 29 Aug 2019 12:33:31 +0000 (14:33 +0200)]
Addref static vars when not copying private method
While we don't need to give this method separate static vars, we
do still need to perform an addref, as there will be a corresponding
delref in the dtor.
Nikita Popov [Mon, 26 Aug 2019 15:48:05 +0000 (17:48 +0200)]
Remove properties HT from nested GC data
The properties HT may be a GC root itself, so we need to remove it.
I'm not sure this issue actually applies to PHP 7.2, but committing
it there to be safe. As seen from the test case, the handling here
is rather buggy on 7.2.
Tyson Andre [Sun, 25 Aug 2019 14:48:52 +0000 (10:48 -0400)]
Fix opcache optimizer info for time_nanosleep
This can also return an array. See
https://www.php.net/manual/en/function.time-nanosleep.php#refsect1-function.time-nanosleep-returnvalues
> If the delay was interrupted by a signal, an associative array will be
returned with the components:
>
> - seconds - number of seconds remaining in the delay
> - nanoseconds - number of nanoseconds remaining in the delay
Sending a SIGUSR1 to the below program would trigger this behavior.
```
pcntl_signal(\SIGUSR1, function ($signo, $signinfo) {
echo "Handling a signal $signo\n";
});
echo "Sleeping for 100 seconds\n";
var_export(time_nanosleep(100, 0));
```
The incomplete signature existed since c88ffa9a5.
No phpt tests existed for time_nanosleep returning an array
Nikita Popov [Mon, 26 Aug 2019 08:23:23 +0000 (10:23 +0200)]
Fix overflow in memory limit checks
Due to overflows in the memory limit checks, we were missing cases
where the allocation size was close to the address space size, and
caused an OOM condition rather than a memory limit error.
Fix #77812: Interactive mode does not support PHP 7.3-style heredoc
As of PHP 7.3.0, the rules regarding the heredoc and nowdoc closing
identifier have been relaxed. While formerly, the closing identifier
was required to be placed at the beginning of a line and to be
immediately followed by (a semicolon and) a line break, it may now be
preceeded by whitespace, and may be followed by any non-word character.
We adjust the recognition logic respectively.
Fix #78438: Corruption when __unserializing deeply nested structures
When storing two temporary variables for delayed __unserialize() calls,
we have to make sure that both fit into the same linked list element.
To that end we introduce the internal API `tmp_var` which allows to
reserve `num` slots in the same list element.
We also fix the `var_dtor_entries` struct definition to use the proper
size, namely `VAR_DTOR_ENTRIES_MAX`.
Fix #78386: fstat mode has unexpected value on PHP 7.4
We must not assume that any file which is not a directory is a regular
file. Therefore we employ `GetFileType()` in this case to properly
distinguish between character special, FIFO special and regular files.
As of Windows 1903, when the OneDrive on-demand feature is enabled, the
OneDrive folder is reported as reparse point by `FindFirstFile()`, but
trying to get information about the reparse point using
`DeviceIoControl()` fails with `ERROR_NOT_A_REPARSE_POINT`. We work
around this problem by falling back to `GetFileInformationByHandle()`
if that happens, but only if the reparse point is reported as cloud
reparse point, and only if PHP is running on Windows 1903 or later.
The patch has been developed in collaboration with ab@php.net.
We should keep an eye on the somewhat quirky OneDrive behavior, since
it might change again in a future Windows release.
Nikita Popov [Sat, 17 Aug 2019 08:57:26 +0000 (10:57 +0200)]
Fixed bug #77922
In PHP 7.3 shadow properties are no longer duplicated. Make sure we
only release them if the property was defined on the parent class,
which means that it changed from private->shadow, which is where
duplication does happen.