1
0
mirror of https://github.com/php/php-src.git synced 2026-04-27 10:16:41 +02:00
Commit Graph

118638 Commits

Author SHA1 Message Date
Nikita Popov ae5ca5459f Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix lcov genhtml: ERROR: cannot read [file]
  Properly detect CRC32 APIs on aarch64 from configure
2020-05-14 09:39:03 +02:00
Gerard Roche ae1d4a820a Fix lcov genhtml: ERROR: cannot read [file]
lcov is emitting several errors for generated regex files that have no code
coverage data. The fix is to add the files to the lcov exlusion list.

This is not an issue for CI because it uses gcovr to generate code coverage.

The errors:

    Processing ext/date/lib/parse_date.gcda
    geninfo: WARNING: could not open /home/code/vendor/php/php-src/parse_date.re
    geninfo: WARNING: could not open /home/code/vendor/php/php-src/<stdout>
    geninfo: WARNING: some exclusion markers may be ignored
    Processing ext/date/lib/parse_tz.gcda
    Processing ext/date/lib/tm2unixtime.gcda
    Processing ext/date/lib/parse_iso_intervals.gcda
    geninfo: WARNING: could not open /home/code/vendor/php/php-src/<stdout>
    geninfo: WARNING: could not open /home/code/vendor/php/php-src/parse_iso_intervals.re
    geninfo: WARNING: some exclusion markers may be ignored
    ...
    genhtml: ERROR: cannot read /home/code/vendor/php/php-src/parse_date.re
    Processing file /home/code/vendor/php/php-src/parse_date.re
    make: *** [Makefile:443: lcov-html] Error 2

Closes GH-5568.
2020-05-14 09:38:27 +02:00
Ondřej Surý d4bebc874b Properly detect CRC32 APIs on aarch64 from configure
The CRC32 APIs are optional for armv8-a. They became mandatory since
armv8.1-a.

Closes GH-5564.
2020-05-14 09:38:05 +02:00
Jens de Nies a4cc9d83a1 Removed pure zpp tests in the imap extension
Closes GH-5569.
2020-05-14 09:37:22 +02:00
Christoph M. Becker 69d46c3433 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix brittle shmop test
2020-05-13 23:31:09 +02:00
Christoph M. Becker 1892e3abaa Fix brittle shmop test
To solve bug #70886, the test uses random keys to prevent collisions;
however, this is not guaranteed, and as such it may even collide with
other tests in the shmop test suite.  The proper solution would be to
use a single key (which could be randomly generated), but to actually
`shmop_close()` after each `shmop_delete()`.  This would, however, not
work on Windows due to bug #65987.  Therefore we use three different
keys for now.
2020-05-13 23:25:28 +02:00
Nikita Popov 50a9f511cc Allow null callback to array_filter()
With same behavior as not passing it.
2020-05-13 17:24:13 +02:00
Dmitry Stogov 9122638ecd Set "hybrid_ret_counters" only after links to "function entry" traces. 2020-05-13 17:45:48 +03:00
Remi Collet 30077100a4 Revert "doc for enchant Object move"
This reverts commit 2c63324a4e.
2020-05-13 15:56:18 +02:00
Remi Collet 5318971bc5 Revert "convert enchant resources to objects of new classes - EnchantBroker - EnchantDict add OO interface deprecate enchant_broker_free* (use unset instead) deprecate ENCHANT_MYSPELL and ENCHANT_ISPELL constants"
This reverts commit 7db4c24a37.
2020-05-13 15:56:14 +02:00
Remi Collet ea1bebbd41 Revert "add myself as enchant maintainer"
This reverts commit f987219c69.
2020-05-13 15:56:10 +02:00
Remi Collet 2c63324a4e doc for enchant Object move 2020-05-13 15:23:07 +02:00
Remi Collet 7db4c24a37 convert enchant resources to objects of new classes - EnchantBroker - EnchantDict add OO interface deprecate enchant_broker_free* (use unset instead) deprecate ENCHANT_MYSPELL and ENCHANT_ISPELL constants 2020-05-13 15:14:50 +02:00
Nikita Popov 87e6f93fd6 Assert on unknown type in zend_get_type_by_const() 2020-05-13 15:03:44 +02:00
Dmitry Stogov fa919f9277 Fixed JIT with ON_HOT_COUNTERS trigger (opcache.jit=1235) 2020-05-13 16:00:25 +03:00
Nikita Popov c6a6ca078b Use zend_zval_type_name() API where possible
Rather than zend_get_type_by_const(Z_TYPE_P()).
2020-05-13 14:56:05 +02:00
Nikita Popov 3f51d82bca Rename zend_zval_get_type() API
We have a bunch of APIs for getting type names and it's sometimes
hard to keep them apart ... make it clear that this is the one
you definitely do not want to use.
2020-05-13 14:56:05 +02:00
Máté Kocsis 256b7da356 Convert resource to object in XML-RPC extension
Closes GH-5457
2020-05-13 14:49:13 +02:00
Dmitry Stogov 98d8bcc13a Better trace_buffer packing 2020-05-13 15:45:42 +03:00
Alex Dowad 555489dd83 Honor script time limit when calling shutdown functions
A time limit can be set on PHP script execution via `set_time_limit` (or .ini file).
When the time limit is reached, the OS will notify PHP and `timed_out` and `vm_interrupt`
flags are set. While these flags are regularly checked when executing PHP code, once the
end of the script is reached, they are not checked while invoking shutdown functions
(registered via `register_shutdown_function`).

Of course, if the shutdown functions are implemented *in* PHP, then the interrupt flag
will be checked while the VM is running PHP bytecode and the timeout will take effect.
But if the shutdown functions are built-in (implemented in C), it will not.

Since the shutdown functions are invoked through `zend_call_function`, add a check of the
`vm_interrupt` flag there. Then, the script time limit will be respected when *entering*
each shutdown function. The fact still remains that if a shutdown function is built-in and
runs for a long time, script execution will not time out until it finishes and the
interpreter tries to invoke the next one.

Still, the behavior of scripts with execution time limits will be more consistent after
this patch. To make the execution time-out feature work even more precisely, it would
be necessary to scrutinize all the built-in functions and add checks of the `vm_interrupt`
flag in any which can run for a long time. That might not be worth the effort, though.

It should be mentioned that this patch does not solely affect shutdown functions, neither
does it solely allow for interruption of running code due to script execution timeout.
Anything else which causes `vm_interrupt` to be set, such as the PHP interpreter receiving
a signal, will take effect when exiting from an internal function. And not just internal
functions which are called because they were registered to run at shutdown; there are
other cases where a series of internal functions might run in the midst of a script. In
all such cases, it will be possible to interrupt the interpreter now.

Closes GH-5543.
2020-05-13 12:47:12 +02:00
Xinchen Hui f06f260292 Revert "Fixed crash if jit.trigger is counter based with preload scripts"
This reverts commit 3d4e23aa92.
2020-05-13 18:35:00 +08:00
Xinchen Hui ded0b34a48 Merge branch 'master' of git.php.net:/php-src
* 'master' of git.php.net:/php-src:
  Use new Fast ZPP macros for string|int parar types
  utime is always available on Windows
2020-05-13 18:23:55 +08:00
Xinchen Hui 3d4e23aa92 Fixed crash if jit.trigger is counter based with preload scripts 2020-05-13 18:22:29 +08:00
George Peter Banyard 1f05966a41 Use new Fast ZPP macros for string|int parar types
Closes GH-5512
2020-05-13 12:07:02 +02:00
George Peter Banyard 0e4c7b3264 utime is always available on Windows
Therefore drop useless preprocessor if check

Closes GH-5563
2020-05-13 12:05:29 +02:00
Xinchen Hui f150b020c0 Merge branch 'master' of git.php.net:/php-src
* 'master' of git.php.net:/php-src:
  skip when mbstring missing (no warning)
2020-05-13 18:01:16 +08:00
Xinchen Hui 91b5571fcc Fixed #79582 (Crash seen when opcache.jit=1235 and opcache.jit_debug=2) 2020-05-13 18:00:16 +08:00
Remi Collet ebdcdf39ed skip when mbstring missing (no warning) 2020-05-13 10:56:10 +02:00
Gerard Roche ecc0a87ff2 run-tests: extract usage message
Put the usage message near the top of the script,
into a separate function.

Closes GH-5558.
2020-05-13 09:54:55 +02:00
Gerard Roche 10edee7f03 run-tests: cs fixes (cleanup)
I used php-cs-fixer to do the cs fixes. The configuration I used is
posted below. The reason I disabled some of the rules is because they
create too much noise and would make it difficult to review. But please
feel free to close this PR and run the php-cs-fixer yourself.

    <?php

    $config = PhpCsFixer\Config::create();
    $config->setRiskyAllowed(false);
    $config->setRules([
        '@PSR2' => true,
        '@Symfony' => true,
        'array_syntax' => false,
        'binary_operator_spaces' => false,
        'blank_line_before_statement' => false,
        'concat_space' => false,
        'increment_style' => false,
        'phpdoc_align' => false,
        'single_quote' => false,
        'trailing_comma_in_multiline_array' => false,
        'unary_operator_spaces' => false,
        'yoda_style' => false,
    ]);

    $finder = PhpCsFixer\Finder::create();
    $finder->in(getcwd());

    $finder->exclude('Zend');
    $finder->exclude('build');
    $finder->exclude('ext');
    $finder->exclude('pear');
    $finder->exclude('sapi');
    $finder->exclude('scripts');
    $finder->exclude('win32');

    $config->setFinder($finder);

    return $config;

Closes GH-5557.
2020-05-13 09:52:44 +02:00
Dmitry Stogov 7d66e4f323 Replace zend_jit_trace_info.loop_kind by zend_jit_trace_info.flags 2020-05-13 00:56:04 +03:00
Dmitry Stogov 25b7df4283 Fixed invalid index 2020-05-12 23:45:34 +03:00
Dmitry Stogov 2224f63bb5 Prevent usage of uninitialized class entry 2020-05-12 23:34:07 +03:00
George Peter Banyard c0997130ec Fix [-Wundef] warning in PHPDBG SAPI 2020-05-12 22:02:51 +02:00
George Peter Banyard 56698afb6d Fix [-Wundef] warning in CLI SAPI 2020-05-12 22:02:12 +02:00
George Peter Banyard f87743de9f Fix [-Wundef] warning in FPM SAPI 2020-05-12 22:02:03 +02:00
George Peter Banyard 25acc4a6b4 Fix [-Wundef] warning in Zend folder 2020-05-12 22:01:51 +02:00
George Peter Banyard 8e66d22f7e Fix [-Wundef] warning in streams implementation 2020-05-12 22:01:20 +02:00
George Peter Banyard 1df3f97c21 Fix [-Wundef] warning in main folder 2020-05-12 22:01:00 +02:00
Christoph M. Becker 3689807998 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix #79588: Boolean opcache settings ignore on/off values
2020-05-12 19:50:16 +02:00
Christoph M. Becker 129fd647a1 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79588: Boolean opcache settings ignore on/off values
2020-05-12 19:48:12 +02:00
Christoph M. Becker 5bdb4ab786 Fix #79588: Boolean opcache settings ignore on/off values
We should display boolean INI settings as boolean.
2020-05-12 19:44:39 +02:00
Alex Dowad f152fece02 Test setting SplDoublyLinkedList iterator mode to IT_MODE_LIFO 2020-05-12 17:24:35 +02:00
Alex Dowad d4d0852c23 SplDoublyLinkedList uses iteration flags in iterator struct
The 'flags' field in spl_dllist_it was formerly unused. This means that if one started to
iterate over an SplDoublyLinkedList using 'foreach', and then *changed* the iteration mode
halfway, the 'foreach' loop would start iterating in the opposite direction. Probably this
was not what was intended.

Therefore, use the 'flags' field in spl_dllist_it for iteration via 'foreach'. For explicit
iteration using methods like '::next()' and '::current()', continue to use the flags in
the SplDoublyLinkedList object itself.
2020-05-12 17:22:31 +02:00
Alex Dowad 9999e7faa3 Remove useless prototype for spl_dllist_get_iterator 2020-05-12 17:21:21 +02:00
Nikita Popov f83a23e59d Display errors in shutdown function timeout test 2020-05-12 17:14:16 +02:00
Alex Dowad f0960879e4 zend_timeout is not a signal handler function
The 'int dummy' parameter to this function makes it appear that it was intended as a
signal handler, but it is not being used as such. So remove the redundant parameter.
2020-05-12 17:13:46 +02:00
Nikita Popov 53f5cfd99e Drop multi_convert_* APIs
These are no longer used internally, and I'd rather they weren't
used externally either.
2020-05-12 17:10:06 +02:00
Rod Elias 682e2f6c20 Trim trailing whitespaces and fix code style
Closes GH-5554.
2020-05-12 17:00:11 +02:00
Gerard Roche 16f23cd159 run-tests: remove use of FILE_BINARY constant
The FILE_BINARY (and FILE_TEXT) constants are not really valid or useful
constants. It looks like they were added in 5.2.7 and have "no effect,
and are only available for forward compatibility."

See: https://www.php.net/manual/en/filesystem.constants.php

The default value of the file_put_contents() flags parameter is 0 and
FILE_BINARY is set to 0, so removing it doesn't change functionality.

P.S. Maybe those constants should be deprecated or removed in 8.0.

Closes GH-5556.
2020-05-12 16:59:25 +02:00