]> granicus.if.org Git - php/log
php
4 years agoRevert "Fix #79487: ::getStaticProperties() ignores property modifications"
Christoph M. Becker [Tue, 23 Jun 2020 17:28:51 +0000 (19:28 +0200)]
Revert "Fix #79487: ::getStaticProperties() ignores property modifications"

This reverts commit a895bb6885fbceea3e8375816969d5510d8d082e.

4 years agoFix #79487: ::getStaticProperties() ignores property modifications
Christoph M. Becker [Tue, 23 Jun 2020 16:34:07 +0000 (18:34 +0200)]
Fix #79487: ::getStaticProperties() ignores property modifications

When retrieving the static class properties via reflection, we have to
cater to possible modifications.

4 years agoMerge branch 'PHP-7.3' into PHP-7.4
Christoph M. Becker [Tue, 23 Jun 2020 13:58:49 +0000 (15:58 +0200)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fix #55857: ftp_size on large files

4 years agoFix #55857: ftp_size on large files
Christoph M. Becker [Tue, 23 Jun 2020 13:17:31 +0000 (15:17 +0200)]
Fix #55857: ftp_size on large files

`atol()` returns a `long` which is not the same as `zend_long` on
LLP64; we use `ZEND_ATOL()` instead.

There is no need for a new test case, since filesize_large.phpt already
tests for that behavior; unfortunately, the FTP test suite relies on
`pcntl_fork()` and therefore cannot be run on Windows.

4 years agoRestore XFAIL on fpm test
Nikita Popov [Tue, 23 Jun 2020 10:35:11 +0000 (12:35 +0200)]
Restore XFAIL on fpm test

Still fails intermittently.

4 years agoMerge branch 'PHP-7.3' into PHP-7.4
Christoph M. Becker [Tue, 23 Jun 2020 08:32:25 +0000 (10:32 +0200)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  7.3 is now 7.3.21-dev

4 years ago7.3 is now 7.3.21-dev
Christoph M. Becker [Tue, 23 Jun 2020 08:29:42 +0000 (10:29 +0200)]
7.3 is now 7.3.21-dev

4 years agoPHP-7.4 is now 7.4.9-dev
Derick Rethans [Tue, 23 Jun 2020 07:46:37 +0000 (08:46 +0100)]
PHP-7.4 is now 7.4.9-dev

4 years agoSplHeap: Avoid memcpy on overlapping pointer
Anatol Belski [Sun, 21 Jun 2020 20:16:56 +0000 (22:16 +0200)]
SplHeap: Avoid memcpy on overlapping pointer

Check if data would overlap and also add an assert. Previous
implementations didn't have this issue, as the direct assignment was
used.

Signed-off-by: Anatol Belski <ab@php.net>
4 years agoMerge branch 'PHP-7.3' into PHP-7.4
Nikita Popov [Fri, 19 Jun 2020 15:32:00 +0000 (17:32 +0200)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fixed bug #79570

4 years agoFixed bug #79570
Böszörményi Zoltán [Fri, 19 Jun 2020 12:31:28 +0000 (14:31 +0200)]
Fixed bug #79570

Use the same logic for getgrgid_r, getpwnam_r and getpwuid_r
as for getgrnam_r in #75696

Closes GH-5740.

4 years agoMerge branch 'PHP-7.3' into PHP-7.4
Nikita Popov [Fri, 19 Jun 2020 08:47:01 +0000 (10:47 +0200)]
Merge branch 'PHP-7.3' into PHP-7.4

4 years agoFixed bug #79710
Nikita Popov [Fri, 19 Jun 2020 08:46:02 +0000 (10:46 +0200)]
Fixed bug #79710

Make sure we don't use zresource after the stream has been destroyed.

4 years agoGenerate temporary config file when generating certificates
Nikita Popov [Fri, 19 Jun 2020 07:43:56 +0000 (09:43 +0200)]
Generate temporary config file when generating certificates

The putenv trick doesn't work on ZTS Windows, so generate a new
openssl config every time.

4 years agocheck for broken libzip versions
Remi Collet [Thu, 18 Jun 2020 14:45:39 +0000 (16:45 +0200)]
check for broken libzip versions

Closes GH-5738.

4 years agoUpdate libzip on macos
Nikita Popov [Thu, 18 Jun 2020 14:25:16 +0000 (16:25 +0200)]
Update libzip on macos

We need libzip 1.7.1, because libzip 1.7.0 is broken.

Closes GH-5737.

4 years agoFix race condition in FPM tests
Nikita Popov [Thu, 18 Jun 2020 15:01:29 +0000 (17:01 +0200)]
Fix race condition in FPM tests

The newly de-XFAILed tests have a race condition. Make sure we
terminate only after expecting all the log lines.

4 years agoUn-XFAIL FPM tests
Nikita Popov [Thu, 18 Jun 2020 13:59:32 +0000 (15:59 +0200)]
Un-XFAIL FPM tests

These were XFAILed due to a bug in the log implementation that
caused intermittent failures. However, this issue is supposed to
be resolved in the meantime, so try dropping the XFAIL marker.

4 years agoDowngrade server security level in security level test
Nikita Popov [Thu, 18 Jun 2020 13:54:02 +0000 (15:54 +0200)]
Downgrade server security level in security level test

We want to test the client side error here, so make sure the
server side can start up successfully.

4 years agoAdd SubjectAltName support to certificate generator
Nikita Popov [Thu, 18 Jun 2020 13:34:33 +0000 (15:34 +0200)]
Add SubjectAltName support to certificate generator

And switch tests using SAN certificates to the generator.

This is ugly, but there doesn't seem to be a more direct way
to privide SAN in PHP.

4 years agoAdd missing NEWS entry
Christoph M. Becker [Thu, 18 Jun 2020 13:28:19 +0000 (15:28 +0200)]
Add missing NEWS entry

I forgot to update NEWS after merging back then.

4 years agoGenerate certificates for bug69215.phpt
Nikita Popov [Thu, 18 Jun 2020 12:58:48 +0000 (14:58 +0200)]
Generate certificates for bug69215.phpt

4 years agoGenerate certificate for bug68920.phpt
Nikita Popov [Thu, 18 Jun 2020 12:49:15 +0000 (14:49 +0200)]
Generate certificate for bug68920.phpt

The certificate really doesn't matter here, but it still needs to
comply with security level...

4 years agoGenerate certificate for bug65729.pem
Nikita Popov [Thu, 18 Jun 2020 12:43:19 +0000 (14:43 +0200)]
Generate certificate for bug65729.pem

Make this test pass under security level 2.

4 years agoRevert "Fix tests regarding OpenSSL security_level"
Nikita Popov [Thu, 18 Jun 2020 12:21:04 +0000 (14:21 +0200)]
Revert "Fix tests regarding OpenSSL security_level"

This reverts commit b281493503401a2b5c45c11fcd0498d8448998c2.

4 years agoDon't generate spurious warning is security_level not supported
Nikita Popov [Thu, 18 Jun 2020 12:20:23 +0000 (14:20 +0200)]
Don't generate spurious warning is security_level not supported

People should not have to worry about the used openssl version
when downgrading security_level.

4 years agoFix tests regarding OpenSSL security_level
Christoph M. Becker [Thu, 18 Jun 2020 11:28:09 +0000 (13:28 +0200)]
Fix tests regarding OpenSSL security_level

The `security_level` stream option is only available as of OpenSSL
1.1.0, so we only set it for these versions.  Older OpenSSL versions
do not have security levels at all.

4 years agoMigrate some tests to certificate generator
Nikita Popov [Thu, 18 Jun 2020 08:32:33 +0000 (10:32 +0200)]
Migrate some tests to certificate generator

This migrates all the tests using ext/openssl/tests/streams_crypto_method.pem
to the certificate generator, so we can easily adjust needed parameters.
In particular, this makes the cert security level 2 compatible.

However, we still need to downgrade security_level to 1 in a number
of tests, because they are testing TLS < 1.2 connections.

4 years agoDon't use ternary in ini default
Nikita Popov [Thu, 18 Jun 2020 08:15:53 +0000 (10:15 +0200)]
Don't use ternary in ini default

We use sizeof() on ini defaults, so this isn't safe. I can't reproduce
the failures locally, but I expect this to fix the asan jobs.

4 years agoRemove bug48187.phpt
Nikita Popov [Thu, 18 Jun 2020 08:07:45 +0000 (10:07 +0200)]
Remove bug48187.phpt

Saw a spurious failure from this one on azure macos, presumably
the process got interrupted in the middle and waited for more than
one second to resume.

After looking a bit more closely, this test doesn't actually test
what bug #48187 reported, because there is no DateTime::diff()
anywhere to be found. This test was also added speculatively,
because the root cause was never diagnosed, and the problems seems
to have resolved itself at some point.

As such, I'm simply dropping this test, rather than figuring out
how to make it more robust.

4 years agoUse sha256 as digest algorithm in certificate generator
Nikita Popov [Wed, 17 Jun 2020 20:08:54 +0000 (22:08 +0200)]
Use sha256 as digest algorithm in certificate generator

This makes the generated certificates compatible with security
level 2, which is apparently the default on Ubuntu 20.04.

Unfortunately this does not fix all tests, because some are using
pre-generated certificates.

4 years agoSuppress zend signals check in two readline tests
Nikita Popov [Wed, 17 Jun 2020 15:13:01 +0000 (17:13 +0200)]
Suppress zend signals check in two readline tests

Installing a callback handler may cause libedit to register new
signals during the request.

4 years agoAdd mbregex skipif
Nikita Popov [Wed, 17 Jun 2020 07:35:02 +0000 (09:35 +0200)]
Add mbregex skipif

4 years agoFix non-default syntax in mb_ereg_search()
Nikita Popov [Tue, 16 Jun 2020 12:31:29 +0000 (14:31 +0200)]
Fix non-default syntax in mb_ereg_search()

4 years agoMerge branch 'PHP-7.3' into PHP-7.4
Christoph M. Becker [Sat, 13 Jun 2020 16:32:01 +0000 (18:32 +0200)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fix #79687: Sony picture - PHP Warning - Make, Model, MakerNotes

4 years agoFix #79687: Sony picture - PHP Warning - Make, Model, MakerNotes
Christoph M. Becker [Sat, 13 Jun 2020 12:09:28 +0000 (14:09 +0200)]
Fix #79687: Sony picture - PHP Warning - Make, Model, MakerNotes

Even if the length of a maker note does not match our expectations
(either because the maker note is corrupted, or because our
expectations do not quite match reality), there is no need to let
parsing fail; we can still go on parsing the other meta information.

4 years agoDrop freetype from i386
Nikita Popov [Fri, 12 Jun 2020 13:12:15 +0000 (15:12 +0200)]
Drop freetype from i386

For some reason this seems to pick up the amd64 library (though
we do install the i386 one).

4 years agoUse shared setup.yml on azure
Nikita Popov [Fri, 12 Jun 2020 13:09:43 +0000 (15:09 +0200)]
Use shared setup.yml on azure

Make sure things stay synchronized between different x64 jobs.

4 years agoMerge branch 'PHP-7.3' into PHP-7.4
Christoph M. Becker [Fri, 12 Jun 2020 12:07:16 +0000 (14:07 +0200)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fix #79676: imagescale adds black border with IMG_BICUBIC

4 years agoFix #79676: imagescale adds black border with IMG_BICUBIC
Christoph M. Becker [Fri, 5 Jun 2020 14:36:00 +0000 (16:36 +0200)]
Fix #79676: imagescale adds black border with IMG_BICUBIC

We have to loop over all image pixels to avoid the black border.  This
is also done in external libgd in `_gdScaleOneAxis` and `_gdScalePass`.

4 years agoSuppress deprecation warning in sockets.c
Nikita Popov [Fri, 12 Jun 2020 10:35:02 +0000 (12:35 +0200)]
Suppress deprecation warning in sockets.c

This one was quite a journey...

4 years agosqlite3: Fix possible use after free
Anatol Belski [Thu, 11 Jun 2020 11:09:00 +0000 (13:09 +0200)]
sqlite3: Fix possible use after free

Exception should be thrown before the db handle is destroyed.
The backtrace excerpt

==26628== Invalid read of size 4
==26628==    at 0x53C49E3: sqlite3_errmsg (in /usr/lib64/libsqlite3.so.0.8.6)
==26628==    by 0x38C4E9: zim_sqlite3_open (sqlite3.c:142)
==26628==    by 0x8977BF: ZEND_DO_FCALL_SPEC_RETVAL_UNUSED_HANDLER (zend_vm_execute.h:1618)
==26628==    by 0x8F801E: execute_ex (zend_vm_execute.h:53824)
==26628==    by 0x8FC0BB: zend_execute (zend_vm_execute.h:57920)
==26628==    by 0x828F54: zend_execute_scripts (zend.c:1672)
==26628==    by 0x793C2C: php_execute_script (main.c:2621)
==26628==    by 0x8FEA44: do_cli (php_cli.c:964)
==26628==    by 0x8FF9DC: main (php_cli.c:1359)

Signed-off-by: Anatol Belski <ab@php.net>
4 years agoUpdate NEWS wrt. bug 79681
Christoph M. Becker [Wed, 10 Jun 2020 14:44:17 +0000 (16:44 +0200)]
Update NEWS wrt. bug 79681

4 years agoFix #79681: mime_content_type/finfo returning incorrect mimetype
Christoph M. Becker [Tue, 9 Jun 2020 14:22:55 +0000 (16:22 +0200)]
Fix #79681: mime_content_type/finfo returning incorrect mimetype

We backport the respective fix for MP3s[1].

[1] <https://github.com/file/file/commit/5a55569a35eff686d4b7400b219d380f7c622890>

4 years agoExplicitly start postgres on azure
Nikita Popov [Wed, 10 Jun 2020 11:04:14 +0000 (13:04 +0200)]
Explicitly start postgres on azure

Seems to be necessary now...

4 years agoAlso support absolute Windows filenames
Christoph M. Becker [Wed, 10 Jun 2020 09:49:14 +0000 (11:49 +0200)]
Also support absolute Windows filenames

The output normalization of bless_tests.php only detected absolute Unix
filenames; we extend this for absolute Windows filenames, regardless of
the platform we're running on (tests may have been run on Windows, but
bless_tests.php may be run from WSL or a Linux VM, for instance).

4 years agoPartial fixed bug #79649 (Altering disable_functions from module init corrupts memory)
Xinchen Hui [Wed, 10 Jun 2020 03:16:42 +0000 (11:16 +0800)]
Partial fixed bug #79649 (Altering disable_functions from module init corrupts memory)

In module startup stage, we should not initiliaze
EG(modified_ini_directives) as it use zend MM, the zend MM will be
restart at the end of modules startup stage,

by say "partial", because this issue still exists if altering ZEND_USER
inis, we should add a zend_ini_deactive at the end of modules startup
stage, but it brings some new cost, and I think no one would do things
like that

4 years agoMerge branch 'PHP-7.3' into PHP-7.4
Christoph M. Becker [Tue, 9 Jun 2020 14:54:04 +0000 (16:54 +0200)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fix possibly unsupported timercmp() usage

4 years agoFix possibly unsupported timercmp() usage
Christoph M. Becker [Tue, 9 Jun 2020 08:12:32 +0000 (10:12 +0200)]
Fix possibly unsupported timercmp() usage

The `timercmp()` manpage[1] points out that some systems have a broken
implementation which does not support `>=`.  This is definitely the
case for the Windows SDK, which only supports `<` and `>`.

[1] <https://linux.die.net/man/3/timercmp>

4 years agoMerge branch 'PHP-7.3' into PHP-7.4
Christoph M. Becker [Tue, 9 Jun 2020 14:46:32 +0000 (16:46 +0200)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fix #62890: default_socket_timeout=-1 causes connection to timeout

4 years agoFix #62890: default_socket_timeout=-1 causes connection to timeout
Christoph M. Becker [Tue, 9 Jun 2020 10:42:02 +0000 (12:42 +0200)]
Fix #62890: default_socket_timeout=-1 causes connection to timeout

While unencrypted connections ignore negative timeouts, SSL/TLS
connections did not special case that, and so always failed due to
timeout.

4 years agoMerge branch 'PHP-7.3' into PHP-7.4
Christoph M. Becker [Tue, 9 Jun 2020 14:39:34 +0000 (16:39 +0200)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  [ci skip] Update NEWS

4 years ago[ci skip] Update NEWS
Christoph M. Becker [Tue, 9 Jun 2020 14:37:17 +0000 (16:37 +0200)]
[ci skip] Update NEWS

4 years agoFixed bug #79683
Nikita Popov [Tue, 9 Jun 2020 13:51:05 +0000 (15:51 +0200)]
Fixed bug #79683

Reset fake_scope during __toString() call.

I'll check if we can solve this more globally in master, by
resetting fake_scope in zend_call_function.

4 years agoMerge branch 'PHP-7.3' into PHP-7.4
Christoph M. Becker [Mon, 8 Jun 2020 21:22:16 +0000 (23:22 +0200)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fix #74267: segfault with streams and invalid data

4 years agoFix #74267: segfault with streams and invalid data
Christoph M. Becker [Mon, 8 Jun 2020 21:19:43 +0000 (23:19 +0200)]
Fix #74267: segfault with streams and invalid data

If the current character is a line break character, it cannot be a tab
or space character, so we would always fail with an invalid sequence
error.  Obviously, these `scan_stat == 4` conditions are meant to be
exclusive.

Furthermore, if `in_pp == NULL || in_left_p == NULL` is true, we hit a
segfault if we are not returning right away.  Obviously, the additional
constraints don't make sense, so we remove them.

4 years agoFixed bug #79657
Nikita Popov [Mon, 8 Jun 2020 09:31:28 +0000 (11:31 +0200)]
Fixed bug #79657

Throwing an exception should count as an initialization for this
purpose.

4 years agoDisable mysqlnd compression on msan build
Nikita Popov [Mon, 8 Jun 2020 08:35:05 +0000 (10:35 +0200)]
Disable mysqlnd compression on msan build

This recently got enabled when detection was fixed. However,
we don't want this for msan builds, because our zlib is not
instrumented.

4 years agoAllow defining of uname value for reproducible builds
Jelle van der Waa [Fri, 5 Jun 2020 20:50:58 +0000 (22:50 +0200)]
Allow defining of uname value for reproducible builds

Extend configure.ac to accept PHP_UNAME as env variable to set the value of the
PHP_UNAME define in a reproducible manner. This allows distributions to set a
fixed value for php_uname and keep the default behaviour if PHP_UNAME is not
set.

Motivation: https://reproducible-builds.org/

Closes GH-5671.

4 years agoRemove unnecessary "poo" rmdirs
Nikita Popov [Fri, 5 Jun 2020 14:26:09 +0000 (16:26 +0200)]
Remove unnecessary "poo" rmdirs

"poo" was only used in the opendir_edgecases test, but rmdir'ed
in some other tests as well.

I've also taken the liberty of renaming this directory...

4 years agoUpdate intl test suite for ICU 67.1
Christoph M. Becker [Fri, 24 Apr 2020 08:43:42 +0000 (10:43 +0200)]
Update intl test suite for ICU 67.1

Cherry-picked from c915c601710e2a44e6c7f89fcb12b8047c968108.

4 years agoRespect --program-prefix/suffix when installing phar
Nathan Porter [Sat, 30 May 2020 22:39:11 +0000 (15:39 -0700)]
Respect --program-prefix/suffix when installing phar

Currently ./configure --enable-phar --program-suffix=7.4 will
result in binaries named php7.4 and phar but should instead
result in php7.4 and phar7.4

Closes GH-5650.

4 years agoMerge branch 'PHP-7.3' into PHP-7.4
Christoph M. Becker [Thu, 4 Jun 2020 11:38:14 +0000 (13:38 +0200)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fix #73527: Invalid memory access in php_filter_strip

4 years agoFix #73527: Invalid memory access in php_filter_strip
Christoph M. Becker [Thu, 4 Jun 2020 09:49:59 +0000 (11:49 +0200)]
Fix #73527: Invalid memory access in php_filter_strip

4 years agomysqlnd: Remove unnecessary check for HAVE_ZLIB
talyz [Wed, 3 Jun 2020 19:21:18 +0000 (21:21 +0200)]
mysqlnd: Remove unnecessary check for HAVE_ZLIB

If MYSQLND_COMPRESSION_WANTED is set, we already guarantee that
zlib is linked, but don't necessarily set HAVE_ZLIB.

Closes GH-5658.

4 years agoMerge branch 'PHP-7.3' into PHP-7.4
Christoph M. Becker [Thu, 4 Jun 2020 06:47:25 +0000 (08:47 +0200)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fix #79668: get_defined_functions(true) may miss functions

4 years agoFix #79668: get_defined_functions(true) may miss functions
Christoph M. Becker [Wed, 3 Jun 2020 10:05:00 +0000 (12:05 +0200)]
Fix #79668: get_defined_functions(true) may miss functions

Instead of some brittle and unefficient string matching, we can just
check for the function handler.

4 years agoReport len as -1 instead of INT_MAX
Nikita Popov [Wed, 3 Jun 2020 08:15:54 +0000 (10:15 +0200)]
Report len as -1 instead of INT_MAX

Per docs it should be -1. And would be on 32-bit systems, but
not on 64-bit systems.

4 years agoSkip new watch point test under asan
Nikita Popov [Wed, 3 Jun 2020 08:01:57 +0000 (10:01 +0200)]
Skip new watch point test under asan

4 years agoFix #73927: phpdbg fails with windows error prompt at "watch array"
Christoph M. Becker [Wed, 27 May 2020 16:26:32 +0000 (18:26 +0200)]
Fix #73927: phpdbg fails with windows error prompt at "watch array"

We expect zvals, so we should request zvals.

We also suppress spurious watchpoint removal notices.

4 years agoMerge branch 'PHP-7.3' into PHP-7.4
Christoph M. Becker [Tue, 2 Jun 2020 08:46:35 +0000 (10:46 +0200)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fix #79664: PDOStatement::getColumnMeta fails on empty result set

4 years agoFix #79664: PDOStatement::getColumnMeta fails on empty result set
Christoph M. Becker [Tue, 2 Jun 2020 07:36:39 +0000 (09:36 +0200)]
Fix #79664: PDOStatement::getColumnMeta fails on empty result set

As its name suggests, `sqlite3_data_count` returns the number of
columns in the current row of the result set; we are interested in the
number of columns regardless of the current row, so we have to use
`sqlite3_column_count` instead.

4 years agoMerge branch 'PHP-7.3' into PHP-7.4
Christoph M. Becker [Mon, 1 Jun 2020 11:23:59 +0000 (13:23 +0200)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fix #79650: php-win.exe 100% cpu lockup

4 years agoFix #79650: php-win.exe 100% cpu lockup
Christoph M. Becker [Sun, 31 May 2020 11:28:09 +0000 (13:28 +0200)]
Fix #79650: php-win.exe 100% cpu lockup

As of PHP 7.3.0, `sapi_cli_single_write()` is supposed to return `< 0`
on failure, but `fwrite()` returns a `size_t`, and signals error by
setting the stream's error indicator.  We have to cater to that.

4 years agoMerge branch 'PHP-7.3' into PHP-7.4
Christoph M. Becker [Thu, 28 May 2020 13:34:09 +0000 (15:34 +0200)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fix PVS-Studio integration

4 years agoFix PVS-Studio integration
Christoph M. Becker [Thu, 28 May 2020 13:20:06 +0000 (15:20 +0200)]
Fix PVS-Studio integration

Without this configuration option, PVS-Studio looks for preprocessed
files (*.i), but these do not exists.

4 years agoUse automatic port assignment in socket_import/export test
Nikita Popov [Thu, 28 May 2020 08:18:01 +0000 (10:18 +0200)]
Use automatic port assignment in socket_import/export test

4 years agoMerge branch 'PHP-7.3' into PHP-7.4
Dmitry Stogov [Wed, 27 May 2020 08:26:25 +0000 (11:26 +0300)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fixed possible usage of uninitialized value

4 years agoFixed possible usage of uninitialized value
Dmitry Stogov [Wed, 27 May 2020 08:25:18 +0000 (11:25 +0300)]
Fixed possible usage of uninitialized value

4 years agoEnable phpdbg tests on AppVeyor
Christoph M. Becker [Mon, 25 May 2020 22:16:36 +0000 (00:16 +0200)]
Enable phpdbg tests on AppVeyor

4 years agoMake phpdbg test portable
Christoph M. Becker [Mon, 25 May 2020 22:13:54 +0000 (00:13 +0200)]
Make phpdbg test portable

4 years agoFix several mostly Windows related phpdbg bugs
Christoph M. Becker [Mon, 25 May 2020 17:12:24 +0000 (19:12 +0200)]
Fix several mostly Windows related phpdbg bugs

* Properly initialize PHPDBG_G(watch_tmp)

  Otherwise that may cause segfaults in ZTS builds.

* Deactivate potentially remaining watchpoints after REPL

  Otherwise the memory could still be protected, resulting in segfaults
  during shutdown.

* NULL zend_handlers_table after freeing

  As of commit 4130fe4[1], the `zend_handlers_table` is explicitly
  freed in the `zend_vm_dtor()`.  Since phpdbg (and maybe some other
  SAPIs) may restart the engine afterwards, we have to make sure that
  the table is also NULLed.

* Only set context option if there is a context

  In other words, we must not follow the null pointer.

* Cater to file handles without attached console

  File handles do not necessarily have an attached console (for
  instance, pipes do not), in which case `GetConsoleScreenBufferInfo()`
  fails.  In this case we set a default value (`40`) for lines like on
  other systems.

[1] <http://git.php.net/?p=php-src.git;a=commit;h=4130fe437a5db7ead1444d3748bd0fbad9829cb2>

4 years agoFix #73926: phpdbg will not accept input on restart execution
Christoph M. Becker [Tue, 19 May 2020 12:45:47 +0000 (14:45 +0200)]
Fix #73926: phpdbg will not accept input on restart execution

We are more liberal, and accept Windows line endings (CRLF) as well.

4 years agoFix #79595: zend_init_fpu() alters FPU precision
Christoph M. Becker [Tue, 26 May 2020 06:57:31 +0000 (08:57 +0200)]
Fix #79595: zend_init_fpu() alters FPU precision

On startup, PHP deliberately changes the floating point control word to
enforce binary64 format for the calculations for best consistency
across platforms.  However, this is unnessary for x86_64 architectures,
because in this case SSE instructions are used by default, and there is
no good reason to pass `-mfpmath=i387` or such.

Therefore, we can skip the modification, which has the benefit that
system libraries are free to work in the mode of their liking.

4 years agoAdd (expected) release date, and new header for 7.4.8
Derick Rethans [Tue, 26 May 2020 13:20:06 +0000 (14:20 +0100)]
Add (expected) release date, and new header for 7.4.8

4 years agoThis bug fix was cherry picked into 7.4.6
Derick Rethans [Tue, 26 May 2020 13:18:19 +0000 (14:18 +0100)]
This bug fix was cherry picked into 7.4.6

4 years agoRespect typed references in catch assignment
Nikita Popov [Tue, 26 May 2020 12:59:40 +0000 (14:59 +0200)]
Respect typed references in catch assignment

I decided to null out EG(exception) early here, which means only
the exception from the dtor / ref assign is preserved, and the
previous exception is not chained in. This is more robust, and
I don't think this situation is common enough to be bothered about
the precise behavior.

4 years agoFix zend_assign_to_typed_ref() implementation
Nikita Popov [Tue, 26 May 2020 12:06:36 +0000 (14:06 +0200)]
Fix zend_assign_to_typed_ref() implementation

There was some confusion going on here regarding the original
value vs the copied value.

I've dropped the needs_copy variable, because this code is not
inlined, so it would always be true anyway.

What we need to do is perform a move-assignment of the copied
value (in which case we don't care about performing the assignment
before destroying garbage), and destroying the original value
for the VAR/TMP cases. This is a bit complicated by the fact that
references are passed in via a separate ref variable, so we can't
just ptr_dtor the original variable.

4 years agoFixed historical dates in NEWS
Derick Rethans [Tue, 26 May 2020 10:47:26 +0000 (11:47 +0100)]
Fixed historical dates in NEWS

4 years agoMerge branch 'PHP-7.3' into PHP-7.4
Christoph M. Becker [Tue, 26 May 2020 08:56:28 +0000 (10:56 +0200)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  7.3.20 will be next

4 years ago7.3.20 will be next
Christoph M. Becker [Tue, 26 May 2020 08:53:22 +0000 (10:53 +0200)]
7.3.20 will be next

4 years agoRevert "Fix #79595: zend_init_fpu() alters FPU precision"
Nikita Popov [Fri, 22 May 2020 14:57:14 +0000 (16:57 +0200)]
Revert "Fix #79595: zend_init_fpu() alters FPU precision"

This reverts commit 88dfc475c5937822399843e8aed9b98a36a01813.

4 years agoShow diffs for failed tests on Azure CI
Alex Dowad [Fri, 22 May 2020 12:09:20 +0000 (14:09 +0200)]
Show diffs for failed tests on Azure CI

It's currently not possible to view the "Tests" tab on Azure if
you're not signed in, so also display diffs in the log.

Closes GH-5612.

4 years agoFix #79595: zend_init_fpu() alters FPU precision
Christoph M. Becker [Wed, 20 May 2020 11:23:17 +0000 (13:23 +0200)]
Fix #79595: zend_init_fpu() alters FPU precision

On startup, PHP deliberately changes the floating point control word to
enforce binary64 format for the calculations for best consistency
across platforms.  However, this is unnessary when compiling under
`__SSE__`, because in this case the x87 instructions are not used.
Therefore, we can skip the modification, which has the benefit that
system libraries are free to work in the mode of their liking.

4 years agoMerge branch 'PHP-7.3' into PHP-7.4
Christoph M. Becker [Fri, 22 May 2020 07:18:42 +0000 (09:18 +0200)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fix #79615: Wrong GIF header written in GD GIFEncode

4 years agoFix #79615: Wrong GIF header written in GD GIFEncode
Christoph M. Becker [Fri, 22 May 2020 07:11:28 +0000 (09:11 +0200)]
Fix #79615: Wrong GIF header written in GD GIFEncode

The color resolution is expected in bits 4-6 of the packed fields byte
of the logical screen descriptor (byte 10 of the GIF data stream),
according to the specification[1], section 18.

[1] <https://www.w3.org/Graphics/GIF/spec-gif89a.txt>

4 years agoUpdate msan symbolizer path
Nikita Popov [Fri, 15 May 2020 08:21:59 +0000 (10:21 +0200)]
Update msan symbolizer path

To account for the newer version of LLVM on Ubuntu 18.04.

4 years agoFix bug #79603, by retrying on RTD key collision
Nikita Popov [Tue, 19 May 2020 08:13:25 +0000 (10:13 +0200)]
Fix bug #79603, by retrying on RTD key collision

This is a non-intrusive fix for 7.4, still trying to find a good
solution for master.

Closes GH-5597.

4 years agoFix static property indirections in file cache
Nikita Popov [Wed, 20 May 2020 08:55:36 +0000 (10:55 +0200)]
Fix static property indirections in file cache

If the class is already linked, we need to serialize and
unserialize INDIRECTed static properties. Normally these would
be set up when copying from cache.

4 years agoDon't require rc=1 for function static variables
Nikita Popov [Wed, 20 May 2020 08:26:08 +0000 (10:26 +0200)]
Don't require rc=1 for function static variables

If file cache only is used, then static_variables_ptr may point
to an immutable static_variables HT, which we do not want to
destroy here.