1
0
mirror of https://github.com/php/php-src.git synced 2026-03-29 11:42:17 +02:00
Commit Graph

5525 Commits

Author SHA1 Message Date
Nikita Popov
dfe8dbdc0d Destroy file handle earlier in execute fuzzer
I'm not quite sure why this is relevant, but if matches what other
code does and fixes oss-fuzz #32517.
2021-04-15 12:55:58 +02:00
Nikita Popov
0c7cdbbaba Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix return type of sparc atomic helper
2021-04-13 14:37:26 +02:00
Nikita Popov
ec24f14820 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix return type of sparc atomic helper
2021-04-13 14:37:18 +02:00
David Carlier
5ccb5fd91e Fix return type of sparc atomic helper
Closes GH-6808.
2021-04-13 14:36:58 +02:00
Josh Soref
462da6e09c Fix spelling and grammar mistakes
This PR corrects misspellings identified by the check-spelling action.

The misspellings have been reported at jsoref@b6ba3e2#commitcomment-48946465

The action reports that the changes in this PR would make it happy: jsoref@602417c

Closes GH-6822.
2021-04-13 12:09:37 +02:00
Sammy Kaye Powers
12c558981a Add some documentation to the embed SAPI (#6856)
* Add some documentation to the embed SAPI

* Apply suggestions from code review

Co-authored-by: Nikita Popov <nikita.ppv@googlemail.com>

* Remove superfluous sapi/ include step

Co-authored-by: Nikita Popov <nikita.ppv@googlemail.com>
2021-04-12 14:34:21 -04:00
Dmitry Stogov
4dcde9cf18 Don't evalutae ZEND_AST_CLASS_CONST to ZEND_AST_CONSTANT ar
compile-time. Keep at to run-time and use Fast Class Cache during
run-time evaluation.
2021-04-09 17:48:28 +03:00
Nikita Popov
4ce5d2ea88 Add known strings for jit autoglobals
We always create interned strings for all autoglobals anyway, so
we might as well add known strings to make them more widely usable.
2021-04-09 15:37:59 +02:00
George Peter Banyard
5caaf40b43 Introduce pseudo-keyword ZEND_FALLTHROUGH
And use it instead of comments
2021-04-07 00:46:29 +01:00
Jakub Zelenka
4361fffaea Add extra run test for pm.max_spawn_rate 2021-03-28 21:06:45 +01:00
Paulius Sapragonas
eac1609a84 Max spawn child processes rate an once
* Add functionality to expect log config options
2021-03-28 20:53:58 +01:00
Nikita Popov
5da23eb46c Free static variables in execute fuzzer
Fixes a leak in the seed corpus.
2021-03-26 11:59:14 +01:00
Nikita Popov
74075896e1 Revert "Do not check exact values of unstable metrices in FPM status test"
This reverts commit 5b01c4863f.

The previous commit fixes the 32-bit issue. Maybe this one is also
needed, but let's see if any failures of this form turn up first.
2021-03-24 10:07:56 +01:00
Nikita Popov
9403840ae3 Fix printf type in fpm status 2021-03-24 10:07:53 +01:00
Jakub Zelenka
5b01c4863f Do not check exact values of unstable metrices in FPM status test 2021-03-23 22:10:30 +00:00
Jakub Zelenka
72a22d92cd Fix types in FPM status openmetrics format 2021-03-22 21:32:15 +00:00
Jakub Zelenka
118cd3efd3 Merge branch 'PHP-8.0' 2021-03-21 19:01:50 +00:00
Jakub Zelenka
713b82131b Merge branch 'PHP-7.4' into PHP-8.0 2021-03-21 19:00:38 +00:00
Jakub Zelenka
c483b59124 Fix bug #80024: Duplication of info about inherited socket after pool removing 2021-03-21 18:52:07 +00:00
David CARLIER
d54fa6f778 fpm master/child process rename, enable on mac os.
Note the change appears mainly in command like ps.
2021-03-21 18:36:12 +00:00
Jakub Zelenka
c6c571d92b Fix indent in FPM openmetrics status 2021-03-21 18:24:46 +00:00
Cees-Jan Kiewiet
d36ac9640a Add support for openmetrics formatting to FPM status 2021-03-21 18:08:53 +00:00
Dmitry Stogov
c732ab400a Change Zend Stream API to use zend_string* instead of char*.
This allows to eliminate re-calculation of string lenght and hash value.
See the detailed list of changes in UPGRADING.INTERNALS.
2021-03-16 20:31:36 +03:00
George Wang
16c2afb8b9 Merge branch 'PHP-8.0' 2021-03-05 11:01:27 -05:00
George Wang
8462a3de1a Merge branch 'PHP-7.4' into PHP-8.0 2021-03-05 11:00:53 -05:00
George Wang
797edd6211 LiteSpeed SAPI v7.9: Process manager keeps forked child process alive for longer time based on load. Reduces PM overhead for busy setup. 2021-03-05 10:46:12 -05:00
Nikita Popov
47a2e5c785 Reference dynamic functions through dynamic_defs
Currently, dynamically declared functions and closures are inserted
into the function table under a runtime definition key, and then later
possibly renamed. When opcache is not used and a file containing a
closure is repeatedly included, this leads to a very large memory leak,
as the no longer needed closure declarations will never be freed
(https://bugs.php.net/bug.php?id=76982).

With this patch, dynamic functions are instead stored in a
dynamic_func_defs member on the op_array, which opcodes reference
by index. When the parent op_array is destroyed, the dynamic_func_defs
it contains are also destroyed (unless they are stilled used elsewhere,
e.g. because they have been bound, or are used by a live closure). This
resolves the fundamental part of the leak, though doesn't completely
fix it yet due to some arena allocations.

The main non-obvious change here is to static variable handling:
We can't destroy static_variables_ptr in destroy_op_array, as e.g.
that would clear the static variables in a dynamic function when
the op_array containing it is destroyed. Static variable destruction
is separated out for this reason (we already do static variable
destruction separately for normal functions, so we only need to
handle main scripts).

Closes GH-5595.
2021-03-01 11:35:54 +01:00
Dmitry Stogov
13e4ce386b Improve SPL directory and stat() cache using zend_srting* instead of char* 2021-02-26 02:28:46 +03:00
Nikita Popov
4a8b93425d Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix potential file collision in dom tests
  Fix bug #80757 (Exit code is 0 when could not open file)
  Update NEWS
2021-02-24 21:31:03 +01:00
Felipe Pena
aaea81de7c Merge branch 'PHP-7.4' into PHP-8.0 2021-02-24 19:07:22 +00:00
Felipe Pena
3ec37a74a2 Fix bug #80757 (Exit code is 0 when could not open file) 2021-02-24 18:50:27 +00:00
Christoph M. Becker
d03be8bf86 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix #80771: phpinfo(INFO_CREDITS) displays nothing in CLI
2021-02-22 14:34:45 +01:00
Christoph M. Becker
1d2bbce532 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #80771: phpinfo(INFO_CREDITS) displays nothing in CLI
2021-02-22 14:34:21 +01:00
Christoph M. Becker
073b6ea818 Fix #80771: phpinfo(INFO_CREDITS) displays nothing in CLI
There is no good reason not to show the credits in text based SAPIs,
except for brevity.  Thus, we suppress the credits from `php -i`.

Closes GH-6710.
2021-02-22 14:31:51 +01:00
Máté Kocsis
bf0f6aaf18 Improve class entry generation
Related to GH-6701
2021-02-16 13:09:56 +01:00
David Carlier
fe01a7c515 Avoid repeatedly calling strlen in FPM setproctitle implementation
Closes GH-6689.
2021-02-15 11:29:18 +01:00
Máté Kocsis
31088eef45 Enable class entry generation for sapi extensions 2021-02-14 12:03:48 +01:00
Nikita Popov
8786625e1e Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix CLI server worker support
2021-02-04 15:24:20 +01:00
Nikita Popov
5cb25a2d32 Fix CLI server worker support
If we create separate listening sockets in each worker using
SO_REUSEADDR, then an incoming connection may be load-balanced
to a process that is already busy, either due to a long-running
request, or because it is a recursive request (in which case we
would deadlock).

Instead, only create one listening socket, and only create worker
forks afterwards. This way the incoming request will be served
by one of the workers that is currently listening for an incoming
connection.
2021-02-04 15:22:34 +01:00
Nikita Popov
d281cd8b4b Merge branch 'PHP-8.0'
* PHP-8.0:
  Update year to 2021
2021-02-02 16:47:03 +01:00
Nikita Popov
f1cf553437 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Update year to 2021
2021-02-02 16:46:52 +01:00
Peter Kokot
8c04944b66 Update year to 2021
Closes GH-6636.
2021-02-02 16:46:16 +01:00
Nikita Popov
26f573840f Remove unused mmap member in phpdbg_file_source 2021-01-26 17:11:06 +01:00
Dmitry Stogov
ba89dcb75a Fixed crash in ZTS build with --repeat option 2021-01-21 11:39:13 +03:00
Nikita Popov
3e01f5afb1 Replace zend_bool uses with bool
We're starting to see a mix between uses of zend_bool and bool.
Replace all usages with the standard bool type everywhere.

Of course, zend_bool is retained as an alias.
2021-01-15 12:33:06 +01:00
Christoph M. Becker
91eb9a1383 Merge branch 'PHP-8.0'
* PHP-8.0:
  Revert fix for bug 76813 and re2c version bump
2021-01-11 17:21:42 +01:00
Christoph M. Becker
95a13ca989 Revert fix for bug 76813 and re2c version bump
CentOS 7 ships with re2c 0.13.5 by default, so we should not have
bumped the required re2c version to 0.13.7.  However, 0.13.5 does not
support default rules, so we cannot use them to fix bug 76813.

This reverts commit 420184ad52 and
5e15c9c41f.

Closes GH-6593.
2021-01-11 17:19:52 +01:00
Nikita Popov
3b542021e4 Fuzzer: Gracefully handle hashes that cannot be serialized 2021-01-11 15:45:43 +01:00
Christoph M. Becker
25103c37aa Revert "Fix #76813: Access violation near NULL on source operand"
This reverts commit 5e15c9c41f, since
re2c default rules are only available as of re2c 0.13.7.
2021-01-11 13:21:12 +01:00
Nikita Popov
3c68f38fda Restrict allowed usages of $GLOBALS
This restricts allowed usage of $GLOBALS, with the effect that
plain PHP arrays can no longer contain INDIRECT elements.

RFC: https://wiki.php.net/rfc/restrict_globals_usage

Closes GH-6487.
2021-01-06 12:46:24 +01:00