1
0
mirror of https://github.com/php/php-src.git synced 2026-04-04 22:52:40 +02:00
Commit Graph

55110 Commits

Author SHA1 Message Date
Dmitry Stogov
eae6df494d Wrong condition 2020-05-18 15:04:39 +03:00
Dmitry Stogov
7a07deca0f Fixed JIT with non-HYBRID VM 2020-05-18 14:56:39 +03:00
Dmitry Stogov
99611573f0 Tracing JIT with -O1 doesn't need to do type inference and abstract stack maintaining 2020-05-18 14:39:49 +03:00
Dmitry Stogov
a463197d7a func_info should be empty 2020-05-18 14:30:55 +03:00
Dmitry Stogov
0695048e20 JIT refactoring to allow run-time changes of JIT options (triggers, optimization_level, debug flags, etc) 2020-05-18 10:23:06 +03:00
Máté Kocsis
1179686f62 Improve error messages for invalid property access
Closes GH-5446
Co-authored-by:  Nikita Popov <nikita.ppv@gmail.com>
2020-05-18 08:27:00 +02:00
Remi Collet
b1fddec717 relax test (TS issue) 2020-05-18 07:53:03 +02:00
George Peter Banyard
7c33644fed Fix [-Wextra-tokens] warning in MySQLi extension which breaks build
Didn't double check and this slipped through with my big search and replace
2020-05-18 01:00:47 +02:00
George Peter Banyard
1330359515 Fix [-Wundef] warning in MySQLnd extension 2020-05-18 00:37:20 +02:00
George Peter Banyard
82afcf4401 Fix [-Wundef] warning in MySQLi extension 2020-05-18 00:37:19 +02:00
George Peter Banyard
5f0128e1e0 Fix [-Wundef] warning in ZIP extension 2020-05-18 00:37:18 +02:00
George Peter Banyard
bc9497695e Fix [-Wundef] warning in Tidy extension 2020-05-18 00:37:18 +02:00
George Peter Banyard
714c5f0b70 Fix [-Wundef] warning in Sysvmsg extension 2020-05-18 00:37:17 +02:00
George Peter Banyard
2df6482db9 Fix [-Wundef] warning in Sysvsem extension 2020-05-18 00:37:17 +02:00
George Peter Banyard
418bb5ebda Fix [-Wundef] warning in Sysvshm extension 2020-05-18 00:37:16 +02:00
George Peter Banyard
046ff29958 Fix [-Wundef] warnings in LDAP extension 2020-05-18 00:37:15 +02:00
George Peter Banyard
35e0a91db7 Fix [-Wundef] warnings in libxml extension 2020-05-16 15:31:23 +02:00
George Peter Banyard
68164f40ce Fix [-Wundef] warning in MBString extension 2020-05-16 15:31:20 +02:00
George Peter Banyard
c19887496e Fix [-Wundef] warning in IMAP extension 2020-05-16 15:31:18 +02:00
George Peter Banyard
2cf24ff923 Fix [-Wundef] warning in GetText extension 2020-05-16 15:31:17 +02:00
George Peter Banyard
8a18116dba Fix [-Wundef] warning in FTP extension 2020-05-16 15:31:17 +02:00
George Peter Banyard
fb5114c675 Fix [-Wundef] warning in Filter extension 2020-05-16 15:31:16 +02:00
George Peter Banyard
e37501e6c7 Fix [-Wundef] warning in EXIF extension 2020-05-16 15:31:16 +02:00
George Peter Banyard
62b1d2cb69 Fix [-Wundef] warning in DOM extension 2020-05-16 15:31:15 +02:00
George Peter Banyard
93b51f4e26 Fix [-Wundef] warning in cURL extension 2020-05-16 15:31:13 +02:00
George Peter Banyard
b35addc585 Fix [-Wundef] warning in CType extension 2020-05-16 15:31:13 +02:00
George Peter Banyard
0e016f2843 Fix [-Wundef] warning in BZip2 extension 2020-05-16 15:31:12 +02:00
George Peter Banyard
2bb1cc4ba9 Fix [-Wundef] warning in BCMath extension 2020-05-16 15:31:11 +02:00
George Peter Banyard
b91c2845cf Drop check for HAVE_NSLDAP
This constant is never defined thus useless
2020-05-16 00:40:37 +02:00
George Peter Banyard
197cac65fd Use ZEND_FCI_INITIALIZED macro
Instead of manually checking that the fci.size is different than 0
2020-05-16 00:36:15 +02:00
Nikita Popov
406c95758d Remove some uses of zend_inline_hash_func
There's no need to force-inline the hashing for all of these.
2020-05-15 10:14:22 +02:00
Dmitry Stogov
ba0731cd53 Merge branch 'master' of git.php.net:php-src
* 'master' of git.php.net:php-src:
  fixed typo of bug id (#79599)
  master doesn't been affected since we are not passing errcontext now
  Fixed bug #97599 (coredump in set_error_handler)
  Fix #79557: extension_dir = ./ext now use current directory for base
  Fix #79596: MySQL FLOAT truncates to int some locales
  [ci skip] Fix NEWS
2020-05-15 10:44:14 +03:00
Christoph M. Becker
2393692937 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix #79596: MySQL FLOAT truncates to int some locales
2020-05-15 09:13:22 +02:00
Christoph M. Becker
844a1245ef Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79596: MySQL FLOAT truncates to int some locales
2020-05-15 09:11:44 +02:00
Christoph M. Becker
d1cd489a53 Fix #79596: MySQL FLOAT truncates to int some locales
We must not do locale aware float to string conversion here; instead
we using our `snprintf()` implementation with the `F` specifier.
2020-05-15 09:09:41 +02:00
Dmitry Stogov
e5e25d6352 Added HALT symbol 2020-05-15 01:06:47 +03:00
Máté Kocsis
93640db4d5 Improve error message for deprecated methods 2020-05-14 17:23:31 +02:00
Nikita Popov
e696732850 Merge branch 'PHP-7.4'
* PHP-7.4:
  Canonicalize bison error during ini parsing
2020-05-14 14:16:22 +02:00
Nikita Popov
3978d3a957 Canonicalize bison error during ini parsing
Bison 3.6 seems to use "end of file" rather than "$end" for this.
Force the same on older bison versions to be consistent.
2020-05-14 14:15:56 +02:00
Máté Kocsis
68527a7834 Add stubs for some SAPIs
For apache2handler, fpm, litespeed, phpdbg, specifically.
Partially implements GH-5295
2020-05-14 13:35:12 +02:00
Dmitry Stogov
161ee110bf Tracing JIT support for delayed call chain 2020-05-14 14:21:46 +03:00
Máté Kocsis
9198faa67f Convert resource to object in Sysvmsg
Closes GH-5546
2020-05-14 12:56:06 +02:00
Nikita Popov
75bac16788 Avoid duplicating the proc_open cleanup logic
Use a slightly ugly "goto unreachable" pattern to share this code,
so we don't have to duplicate cleanup logic for the success and
the failure cases.
2020-05-14 10:35:33 +02:00
Alex Dowad
dc1496e4a3 Further refactoring of proc_open.c
This time a number of comments have been added to make it easy for new devs to understand
what is going on. Also adjusted error message to use colons rather than dashes.
2020-05-14 10:25:52 +02:00
Alex Dowad
b983580dd7 Don't leak memory if wrong resource type is passed to proc_open
proc_open can accept stream resources in the descriptorspec, like this:

    proc_open("command", array(0 => $resource), $pipes);

Previously, if a resource which was *not* of type "stream" was passed, proc_open would
return without freeing dynamically allocated memory. It's fixed now.
2020-05-14 10:25:37 +02:00
Alex Dowad
a84cd96e86 Add PTY support to proc_open (again after 16 long years)
Back in 2004, a feature was added to proc_open which allowed it to open a PTY,
connecting specific FDs in the child process to the slave end of the PTY and returning
the master end of the PTY (wrapped as a PHP stream) in the `$pipes` array. However,
this feature was disabled just about a month later. Little information is available
about why this was done, but from talking to the original implementer, it seems there
were portability problems with some rare flavors of Unix.

Re-enable this feature with a simplified implementation which uses openpty(). No
attempt is made to support PTYs if the platform does not have openpty(). The configure
script checks if linking with -lutil is necessary to use openpty(), but if anything
else is required, like including some special header or linking with some other library,
PTY support will be disabled.

The original PTY support for proc_open automatically daemonized the child process
(disassociating it from the TTY session and process group of the parent). However,
I don't think this is a good idea. Just because a user opens a child process in a
PTY, it doesn't mean they want it to continue running even when the parent process
is killed. Of course, if the child process is some kind of server, it will likely
daemonize itself; but we have no reason to preempt that decision.

It turns out that since 2015, there has been one test case for PTY support in
proc_open() in the test suite. This test was added in GitHub PR #1588
(https://github.com/php/php-src/pull/1588). That PR mentioned that the PHP
binary in the Debian/Ubuntu repositories is patched to *enable* PTY support. Checking
the Debian PHP repository (https://salsa.debian.org/php-team/php.git) shows that this
is still true. Debian's patch does not modify the implementation from 2004 in any
way; it just removes the #if 0 line which disables it.

Naturally, the test case is skipped if PTY support is not enabled. This means that ever
since it was added, every test run against the 'vanilla' PHP codebase has skipped it.

Interestingly, the test case which was added in 2015 fails on my Linux Mint PC... both
with this simplified implementation *and* when enabling the original implementation.
Investigation reveals the reason: when the child process using the slave end of the
PTY exits and its FDs are all closed, and all buffered data is read from the master
end of the PTY, any further attempt to read from the master end fails with EIO. The
test case seems to expect that reading from the master end will always return an
empty string if no data is available.

Likely this is because PHP's fread() was updated to report errors from the underlying
system calls only recently.

One way out of this dilemma: IF at least one FD referring to the slave end of the PTY is
kept open *in the parent process*, the failure with EIO will not occur even after the child
process exits. However, that would raise another issue: we would need a way to ensure the FD
will be closed eventually in long-running programs.

Another discovery made while testing this code is that fread() does not always return
all the data written to the slave end of the PTY in a single call, even if the data was
written with a single syscall and it is only a few bytes long.

Specifically, when the child process in the test case writes "foo\n" to the PTY, the parent
sometimes receives "foo" (3 bytes) and sometimes "foo\r\n" (5 bytes). (The "\r" is from the
TTY line discipline converting "\n" to "\r\n".) A second call to fread() does return the
remaining bytes, though sometimes all the data is read in the first call, and by the time
the second call is made, the child process has already exited. It seems that liberal use
of the @ operator is needed when using fread() on pipes.

Thanks to Nikita Popov for suggesting that we should just use openpty() rather than
grantpt(), unlockpt(), etc.
2020-05-14 10:25:37 +02:00
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
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