1
0
mirror of https://github.com/php/php-src.git synced 2026-04-23 07:58:20 +02:00
Commit Graph

5168 Commits

Author SHA1 Message Date
zhdaniel 844b261e3a Fix typo 2019-08-15 09:32:35 +02:00
Stephen Reay 66b750d07e Add stubs for PCRE extension
Closes GH-4501.
2019-08-11 12:46:42 +02:00
Nikita Popov 2b1073eb19 Merge branch 'PHP-7.4' 2019-07-30 10:19:01 +02:00
Nikita Popov 0ed6c37140 Fix FPM timer event re-registration
Make sure that fpm_event_add calls inside a timer callback work by
unregistering the event from the queue before invoking its callback.

The read timeout in tester.inc is increased because the added test
needs two seconds (one for SIGTERM, one for SIGKILL) until the
reload succeeds, so we should wait longer than that for a response.
2019-07-30 10:16:57 +02:00
Peter Kokot 9af6d5545a Merge branch 'PHP-7.4'
* PHP-7.4:
  Remove AC_FPM_POLL
2019-07-24 22:04:24 +02:00
Peter Kokot a3169964c0 Remove AC_FPM_POLL
AC_FPM_POLL defines HAVE_POLL symbol which is already checked by
configure.ac and function poll in AC_CHECK_FUNCTIONS.

Closes GH-4449
2019-07-24 22:03:47 +02:00
Nikita Popov 0fcd017340 Merge branch 'PHP-7.4' 2019-07-24 12:07:04 +02:00
David Carlier b05f364333 Fix bindpath mem leak in cgi
Closes GH-4451.
2019-07-24 12:06:40 +02:00
Nikita Popov 173ebe4c44 Merge branch 'PHP-7.4' 2019-07-24 10:44:40 +02:00
Nikita Popov d9680272c7 Revert "Drop free_filename field from zend_file_handle"
This reverts commit e0eca26285.

free_filename is used by the wincache extension, restore this
field for PHP 7.4.
2019-07-24 10:43:37 +02:00
Nikita Popov a1e2c8870e Merge branch 'PHP-7.4' 2019-07-22 17:26:01 +02:00
Nikita Popov d59aac58b3 Report errors from stream read and write operations
The php_stream_read() and php_stream_write() functions now return
an ssize_t value, with negative results indicating failure. Functions
like fread() and fwrite() will return false in that case.

As a special case, EWOULDBLOCK and EAGAIN on non-blocking streams
should not be regarded as error conditions, and be reported as
successful zero-length reads/writes instead. The handling of EINTR
remains unclear and is internally inconsistent (e.g. some code-paths
will automatically retry on EINTR, while some won't).

I'm landing this now to make sure the stream wrapper ops API changes
make it into 7.4 -- however, if the user-facing changes turn out to
be problematic we have the option of clamping negative returns to
zero in php_stream_read() and php_stream_write() to restore the
old behavior in a relatively non-intrusive manner.
2019-07-22 17:17:28 +02:00
Nikita Popov a9969ec1bd Merge branch 'PHP-7.4' 2019-07-22 12:41:20 +02:00
Nikita Popov 72b9105d30 Merge branch 'PHP-7.3' into PHP-7.4 2019-07-22 12:41:15 +02:00
Nikita Popov b59a9381b9 Remove test for bug #77185
Seems to be very unreliable in CI.
2019-07-22 12:40:26 +02:00
Nikita Popov 8092604ec2 Merge branch 'PHP-7.4' 2019-07-22 11:19:32 +02:00
Nikita Popov b2915fc332 Merge branch 'PHP-7.3' into PHP-7.4 2019-07-22 11:19:24 +02:00
Nikita Popov 5e4dbce586 Reduce number of workers in test
4 seems to be enough to reliably reproduce the issue. Let's see
if this works better in CI.
2019-07-22 11:18:38 +02:00
Nikita Popov a16ca769af Merge branch 'PHP-7.4' 2019-07-22 10:34:58 +02:00
Nikita Popov 97b80bd83b Merge branch 'PHP-7.3' into PHP-7.4 2019-07-22 10:34:32 +02:00
Maksim Nikulin bdf24f8d6d Prevent use after free in fpm_event_epoll_wait
epoll event backend does not guarantee that child input/output events
are reported before SIGCHILD due to finished worker. While a bunch of
events received by epoll is being processed, child-related structures
may be removed before dispatching of an I/O event for the same child.
The result may be attempt to access to memory region allocated for
another purpose, segfault of the master process, and unavailable web
sites.

Postpone processing of SIGCHILD events till other events in the same
bunch are processed.

Fix Bug #62418 php-fpm master process crashes
Fix Bug #65398 Race condition between SIGCHLD and child stdout/stderr event leads to segfault
Fix Bug #75112 php-fpm crashing, hard to reproduce
Fix Bug #77114 php-fpm master segfaults in fpm_event_epoll_wait/fpm_event_fire
Fix Bug #77185 Use-after-free in FPM master event handling
2019-07-22 10:32:58 +02:00
George Wang e4f6744552 Merge branch 'PHP-7.4' 2019-07-21 00:02:03 -04:00
George Wang 30de357fa1 Merge branch 'PHP-7.3' into PHP-7.4 2019-07-21 00:01:39 -04:00
George Wang 82f35ab089 Merge branch 'PHP-7.2' into PHP-7.3 2019-07-21 00:01:06 -04:00
George Wang eb7e45f662 Checked in LiteSpeed SAPI 7.5, addressed two main problems in "clean shutdown" introduced in 7.4.3,
1. falls in an infinite loop because PHP engine's inconsistent state, now override the ITIMER_PROF to 0.1 second, clean shutdown must finish before that.
2. generate too much error log, we completely disable "error_reporting" before calling php_request_shutdown().
2019-07-20 23:59:43 -04:00
Nikita Popov eb766751dc Merge branch 'PHP-7.4' 2019-07-19 10:06:30 +02:00
rjhdby d574df63dc Deprecate alternative array access syntax
RFC: https://wiki.php.net/rfc/deprecate_curly_braces_array_access
2019-07-19 10:06:10 +02:00
Peter Kokot f33d12096d Merge branch 'PHP-7.4'
* PHP-7.4:
  Remove duplicate socklen_t check
2019-07-18 12:11:45 +02:00
Peter Kokot bbdbc2658c Remove duplicate socklen_t check
- Use Autoconf's default AC_CHECK_TYPES

Closes GH-4418
2019-07-18 12:11:19 +02:00
Nikita Popov b32e9a9227 Merge branch 'PHP-7.4' 2019-07-17 10:41:34 +02:00
Nikita Popov a986e70991 Avoid double buffering in Zend streams
Disable buffering in PHP streams, to avoid storing and copying the
file contents twice.

This will call stream_set_option() on custom stream wrapper as
well, so the method needs to be implemented to avoid a warning.
2019-07-17 10:40:04 +02:00
Nikita Popov c4a6998c62 Merge branch 'PHP-7.4' 2019-07-16 17:45:03 +02:00
Nikita Popov b317f0eb59 Remove ZEND_HANDLE_MAPPED
The buf/len members are now simply used in addition to the main
stream, without changing the handle kind.
2019-07-16 17:44:32 +02:00
Nikita Popov e0eca26285 Drop free_filename field from zend_file_handle
free_filename was always zero.
2019-07-16 17:07:26 +02:00
Nikita Popov 3faa903d47 Merge branch 'PHP-7.4' 2019-07-16 16:44:46 +02:00
Nikita Popov 49bac9b77b Introduce zend_stream_init_filename()
Avoid more ad-hoc initialization of zend_file_handle structures.
2019-07-16 16:44:37 +02:00
Nikita Popov 46faf8f018 Introduce zend_stream_init_fp() API
Reduce the amount of code that mucks around with zend_file_handle
initialization.
2019-07-16 16:44:37 +02:00
Nikita Popov c562d71d12 Merge branch 'PHP-7.4' 2019-07-16 11:11:08 +02:00
Nikita Popov ebfa05677b Merge branch 'PHP-7.3' into PHP-7.4 2019-07-16 11:11:00 +02:00
Nikita Popov eea9d61763 Merge branch 'PHP-7.2' into PHP-7.3 2019-07-16 11:10:51 +02:00
Nikita Popov 8a19fe29de Fixed bug #78297 2019-07-16 11:09:17 +02:00
Nikita Popov 9207aef60c Merge branch 'PHP-7.4' 2019-07-15 16:26:25 +02:00
Nikita Popov c5f1b384b5 Move shebang handling into the lexer
Instead of handling shebang lines by adjusting the file pointer in
individual SAPIs, move the handling into the lexer, where this is
both a lot simpler and more robust. Whether the shebang should be
skipped is controlled by CG(skip_shebang) -- we might want to do
that in more cases.

This fixed bugs #60677 and #78066.
2019-07-15 16:25:49 +02:00
Nikita Popov 74bf7bfb88 Merge branch 'PHP-7.4' 2019-07-11 15:49:02 +02:00
Nikita Popov 17f7fb7605 Switch to using shell-less proc_open() in various server tests 2019-07-11 15:48:10 +02:00
Nikita Popov bbd12b3d30 Merge branch 'PHP-7.4' 2019-07-10 11:11:30 +02:00
Nikita Popov dfe5fd2a37 Avoid invalid array access in fcgi.inc 2019-07-10 11:09:34 +02:00
Nikita Popov 5f0c8f5e30 Merge branch 'PHP-7.4' 2019-07-09 16:20:12 +02:00
David Carlier aa0e29a668 CGI: Fix memory leak on error paths 2019-07-09 16:19:41 +02:00
Peter Kokot 35709b56e4 Merge branch 'PHP-7.4'
* PHP-7.4:
  Remove some more Apache 1 left overs
2019-07-07 12:10:59 +02:00