]> granicus.if.org Git - php/log
php
5 years agoMerge branch 'PHP-7.3' into PHP-7.4
Christoph M. Becker [Fri, 29 Nov 2019 16:00:11 +0000 (17:00 +0100)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Adapt test cases for Oniguruma 6.9.4

5 years agoAdapt test cases for Oniguruma 6.9.4
Christoph M. Becker [Fri, 29 Nov 2019 15:47:10 +0000 (16:47 +0100)]
Adapt test cases for Oniguruma 6.9.4

Apparently, bug 78633 has now really been fixed; the former fix only
catered to the buffer overflow, but yielded a wrong result.  Also,
the order of the named captures has been fixed.

5 years agoPrevent parallel test conflicts
Christoph M. Becker [Wed, 27 Nov 2019 13:02:44 +0000 (14:02 +0100)]
Prevent parallel test conflicts

The better solution would be to actually use different directory names,
but adding respective CONFLICTS sections solves the issue for now.

5 years agoMerge branch 'PHP-7.3' into PHP-7.4
Christoph M. Becker [Wed, 27 Nov 2019 08:33:36 +0000 (09:33 +0100)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fix #78840: imploding $GLOBALS crashes

5 years agoFix #78840: imploding $GLOBALS crashes
Christoph M. Becker [Tue, 26 Nov 2019 09:19:27 +0000 (10:19 +0100)]
Fix #78840: imploding $GLOBALS crashes

We add support for IS_INDIRECT zvals to implode().

5 years agoMerge branch 'PHP-7.3' into PHP-7.4
Christoph M. Becker [Mon, 25 Nov 2019 14:57:13 +0000 (15:57 +0100)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fix #77638: var_export'ing certain class instances segfaults

5 years agoFix #77638: var_export'ing certain class instances segfaults
Christoph M. Becker [Mon, 25 Nov 2019 14:44:15 +0000 (15:44 +0100)]
Fix #77638: var_export'ing certain class instances segfaults

If objects return immutable property hash tables (typically,
`zend_empty_array`), we must not try to apply recursion protection on
those.

5 years agoMerge branch 'PHP-7.3' into PHP-7.4
Dmitry Stogov [Mon, 25 Nov 2019 11:09:18 +0000 (14:09 +0300)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fixed bug #78868 (Calling __autoload() with incorrect EG(fake_scope) value)

5 years agoFixed bug #78868 (Calling __autoload() with incorrect EG(fake_scope) value)
Dmitry Stogov [Mon, 25 Nov 2019 11:05:43 +0000 (14:05 +0300)]
Fixed bug #78868 (Calling __autoload() with incorrect EG(fake_scope) value)

5 years agoConsolidate NEWS for 7.4.0 release
Derick Rethans [Sun, 24 Nov 2019 09:23:33 +0000 (10:23 +0100)]
Consolidate NEWS for 7.4.0 release

5 years agoWIP: Merge NEWS
Derick Rethans [Sat, 23 Nov 2019 19:00:51 +0000 (20:00 +0100)]
WIP: Merge NEWS

5 years agoHandle reallocated root buffer during GC destroy phase (v2)
Tyson Andre [Wed, 20 Nov 2019 00:12:56 +0000 (19:12 -0500)]
Handle reallocated root buffer during GC destroy phase (v2)

We no longer protect GC during the destroy phase, so we need to
deal with buffer reallocation.

Note that the implementation of spl_SplObjectStorage_free_storage
will call the destructor of SplObjectStorage, and free the instance properties,
which I think is what caused the root buffer to be reallocated.
(`current` is a pointer for an index within the root buffer?)

This fixes bug #78811 for me.

Closes GH-4935

5 years agoMerge branch 'PHP-7.3' into PHP-7.4
Christoph M. Becker [Fri, 22 Nov 2019 18:28:49 +0000 (19:28 +0100)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fix #78853: preg_match() may return integer > 1

5 years agoFix #78853: preg_match() may return integer > 1
Christoph M. Becker [Fri, 22 Nov 2019 18:21:43 +0000 (19:21 +0100)]
Fix #78853: preg_match() may return integer > 1

Commit 54ebebd[1] optimized the match loop, but for this case it has
been overlooked, that we must only loop if we're doing global matching.

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

5 years agoMerge branch 'PHP-7.3' into PHP-7.4
George Wang [Thu, 21 Nov 2019 22:58:44 +0000 (17:58 -0500)]
Merge branch 'PHP-7.3' into PHP-7.4

5 years agoMerge branch 'PHP-7.2' into PHP-7.3
George Wang [Thu, 21 Nov 2019 22:58:16 +0000 (17:58 -0500)]
Merge branch 'PHP-7.2' into PHP-7.3

5 years agoAdded environment LSAPI_CLEAN_SHUTDOWN to control clean shutdown. Update SAPI version...
George Wang [Thu, 21 Nov 2019 22:57:50 +0000 (17:57 -0500)]
Added environment LSAPI_CLEAN_SHUTDOWN to control clean shutdown. Update SAPI version to LiteSpeed v7.6 .

5 years agoMerge branch 'PHP-7.3' into PHP-7.4
Christoph M. Becker [Thu, 21 Nov 2019 09:02:12 +0000 (10:02 +0100)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fix #78849: GD build broken with -D SIGNED_COMPARE_SLOW

5 years agoMerge branch 'PHP-7.2' into PHP-7.3
Christoph M. Becker [Thu, 21 Nov 2019 09:00:31 +0000 (10:00 +0100)]
Merge branch 'PHP-7.2' into PHP-7.3

* PHP-7.2:
  Fix #78849: GD build broken with -D SIGNED_COMPARE_SLOW

5 years agoFix #78849: GD build broken with -D SIGNED_COMPARE_SLOW
Christoph M. Becker [Thu, 21 Nov 2019 08:49:29 +0000 (09:49 +0100)]
Fix #78849: GD build broken with -D SIGNED_COMPARE_SLOW

Apparently, this has not been tested for a long time, and might be a
refactoring relict.  Anyhow, we have to pass the context to
`GIFNextPixel` as well.

5 years agoMake the UPGRADING note about ArrayObject more explicit.
Adam Harvey [Wed, 20 Nov 2019 23:33:04 +0000 (15:33 -0800)]
Make the UPGRADING note about ArrayObject more explicit.

We noticed the BC break when testing `curl_setopt()`, and hadn't interpreted
this note as affecting internal functions in general, so this adds a sub-bullet
to note that.

This overlaps a bit with the previous bullet, but since I don't know exactly
which operations were in mind at the time, I've elected to preserve them both.
Bits are cheap.

5 years agoMerge branch 'PHP-7.3' into PHP-7.4
Christoph M. Becker [Mon, 18 Nov 2019 11:48:31 +0000 (12:48 +0100)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Update NEWS

5 years agoMerge branch 'PHP-7.2' into PHP-7.3
Christoph M. Becker [Mon, 18 Nov 2019 11:47:29 +0000 (12:47 +0100)]
Merge branch 'PHP-7.2' into PHP-7.3

* PHP-7.2:
  Update NEWS

5 years agoUpdate NEWS
Christoph M. Becker [Mon, 18 Nov 2019 11:36:01 +0000 (12:36 +0100)]
Update NEWS

5 years agoMerge branch 'PHP-7.3' into PHP-7.4
Dmitry Stogov [Mon, 18 Nov 2019 08:27:43 +0000 (11:27 +0300)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fix $x = (bool)$x; for undefined with opcache

5 years agoMerge branch 'PHP-7.2' into PHP-7.3
Dmitry Stogov [Mon, 18 Nov 2019 08:26:30 +0000 (11:26 +0300)]
Merge branch 'PHP-7.2' into PHP-7.3

* PHP-7.2:
  Fix $x = (bool)$x; for undefined with opcache

5 years agoFix $x = (bool)$x; for undefined with opcache
Tyson Andre [Fri, 15 Nov 2019 17:47:32 +0000 (12:47 -0500)]
Fix $x = (bool)$x; for undefined with opcache

And `$x = !$x`

Noticed while working on GH-4912

The included test would not emit undefined variable errors in php 8.0
with opcache enabled. The command used:

```
php -d zend_extension=opcache.so --no-php-ini -d error_reporting=E_ALL \
    -d opcache.file_cache= -d opcache.enable_cli=1  test.php
```

5 years agoAdd NEWS entry for bug #76601 fix
Jakub Zelenka [Sun, 17 Nov 2019 14:52:36 +0000 (14:52 +0000)]
Add NEWS entry for bug #76601 fix

5 years agoDo not let PHP-FPM children miss SIGTERM, SIGQUIT
Maksim Nikulin [Mon, 21 Oct 2019 07:23:29 +0000 (14:23 +0700)]
Do not let PHP-FPM children miss SIGTERM, SIGQUIT

Postpone signal delivery while spawning children.
Prevent the following case:

- Reload (reexec) is in progress.
- New master is forking to start enough children for pools
  where `pm` is not `on-demand`.
- Another `SIGUSR2` is received by the master process.
- Master process switches to reloading state.
- Some child has not set its own signal handlers.
- `SIGQUIT` and `SIGTERM` sent by master process are caught
  by signal handler set by master process and so they are ignored.
- A child is running, it has no reason to finish

Before pull request #4465 this scenario could cause deadlock,
however with 0ed6c37140 reload finishes after `SIGKILL`.

Use sigprocmask() around fork() to avoid race of delivery signal to children
and setting of own signal handlers.

Fixes bug #76601

5 years agoHandle reallocated root buffer during GC destroy phase
Nikita Popov [Fri, 15 Nov 2019 14:53:49 +0000 (15:53 +0100)]
Handle reallocated root buffer during GC destroy phase

We no longer protect GC during the destroy phase, so we need to
deal with buffer reallocation.

Possible fix for bug #78811.

5 years agoZend Engine version is no longer in -dev
Derick Rethans [Fri, 15 Nov 2019 14:27:20 +0000 (14:27 +0000)]
Zend Engine version is no longer in -dev

5 years agoPHP-7.4 is now 7.4.1-dev
Derick Rethans [Fri, 15 Nov 2019 14:22:14 +0000 (14:22 +0000)]
PHP-7.4 is now 7.4.1-dev

5 years agoFixed bug #78810
Nikita Popov [Fri, 15 Nov 2019 11:06:17 +0000 (12:06 +0100)]
Fixed bug #78810

5 years agoMerge branch 'PHP-7.3' into PHP-7.4
Christoph M. Becker [Fri, 15 Nov 2019 08:47:34 +0000 (09:47 +0100)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fix ASLR related invalid opline handler issues

5 years agoFix ASLR related invalid opline handler issues
Christoph M. Becker [Tue, 12 Nov 2019 15:12:59 +0000 (16:12 +0100)]
Fix ASLR related invalid opline handler issues

Opcache stores `opline->handler`s in shared memory.  These pointers are
invalid, if the main PHP DLL is loaded at another base address due to
ASLR.  We therefore store the address of `execute_ex` in the mmap base
file, and check on startup whether it matches its current address.  If
not, we fall back on the file cache if enabled, and bail out otherwise.

This still does not address cases where the opline handler is located
inside of another DLL (e.g. for some profilers, debuggers), but there
seems to be no general solution for now.

(cherry picked from commit 8ba10b8fbc020dc225d3b19d8f088f1351a3e304)

5 years agoAdd more CONFLICTS tags
Fabien Villepinte [Wed, 13 Nov 2019 19:59:23 +0000 (20:59 +0100)]
Add more CONFLICTS tags

Closes GH-4908.

5 years agoMerge branch 'PHP-7.3' into PHP-7.4
Dmitry Stogov [Tue, 12 Nov 2019 10:00:27 +0000 (13:00 +0300)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fixed wrong constant usage

5 years agoFixed wrong constant usage
Dmitry Stogov [Tue, 12 Nov 2019 09:59:50 +0000 (12:59 +0300)]
Fixed wrong constant usage

5 years agows
Dmitry Stogov [Tue, 12 Nov 2019 07:51:55 +0000 (10:51 +0300)]
ws

5 years agoMerge branch 'PHP-7.3' into PHP-7.4
Stanislav Malyshev [Tue, 12 Nov 2019 07:08:44 +0000 (23:08 -0800)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fix bug #78804 - Segmentation fault in Locale::filterMatches

5 years agoMerge branch 'PHP-7.2' into PHP-7.3
Stanislav Malyshev [Tue, 12 Nov 2019 07:08:38 +0000 (23:08 -0800)]
Merge branch 'PHP-7.2' into PHP-7.3

* PHP-7.2:
  Fix bug #78804 - Segmentation fault in Locale::filterMatches

5 years agoFix bug #78804 - Segmentation fault in Locale::filterMatches
Stanislav Malyshev [Tue, 12 Nov 2019 06:30:08 +0000 (22:30 -0800)]
Fix bug #78804 - Segmentation fault in Locale::filterMatches

5 years agoFix test case for Windows
Christoph M. Becker [Mon, 11 Nov 2019 11:48:17 +0000 (12:48 +0100)]
Fix test case for Windows

5 years agoFix test cases which fail on Windows debug builds
Christoph M. Becker [Mon, 11 Nov 2019 11:14:05 +0000 (12:14 +0100)]
Fix test cases which fail on Windows debug builds

We use the portable {TMP} instead of the hard-coded /tmp, and skip
mysqli_debug_append.phpt on Windows, because unlinking the trace file
while the connection is still open won't work there.

5 years agoFixed bug #78714 (funcs returning pointer can't use call convention spec)
Dmitry Stogov [Mon, 11 Nov 2019 09:07:48 +0000 (12:07 +0300)]
Fixed bug #78714 (funcs returning pointer can't use call convention spec)

5 years agoFix conflicts in windows ACL tests
Fabien Villepinte [Sat, 9 Nov 2019 12:55:42 +0000 (13:55 +0100)]
Fix conflicts in windows ACL tests

Closes GH-4898.

5 years agoMake test runner runnable without arguments
Fabien Villepinte [Fri, 8 Nov 2019 19:33:19 +0000 (20:33 +0100)]
Make test runner runnable without arguments

The default PHP executable was not set when no args were provided.

Closes GH-4894.

5 years agoMerge branch 'PHP-7.3' into PHP-7.4
Levi Morrison [Fri, 8 Nov 2019 15:02:49 +0000 (08:02 -0700)]
Merge branch 'PHP-7.3' into PHP-7.4

5 years agoWrap php_random.h in C++ portability macros
Levi Morrison [Thu, 7 Nov 2019 21:51:21 +0000 (14:51 -0700)]
Wrap php_random.h in C++ portability macros

Also remove portability headers. This goes against the existing
conventions of these files.

5 years agoMerge branch 'PHP-7.3' into PHP-7.4
Nikita Popov [Thu, 7 Nov 2019 13:42:11 +0000 (14:42 +0100)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Wrap hrtime in `extern "c" {}`

5 years agoWrap hrtime in `extern "c" {}`
Levi Morrison [Wed, 6 Nov 2019 17:30:09 +0000 (10:30 -0700)]
Wrap hrtime in `extern "c" {}`

This allows it to be used by C++ extensions without them having to do their own forward declares.

Closes GH-4890.

5 years agoMerge branch 'PHP-7.3' into PHP-7.4
Nikita Popov [Thu, 7 Nov 2019 13:31:55 +0000 (14:31 +0100)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fix php_pcre_mutex_free()

5 years agoFix php_pcre_mutex_free()
Nikita Popov [Thu, 7 Nov 2019 13:29:51 +0000 (14:29 +0100)]
Fix php_pcre_mutex_free()

We should only set the mutex to NULL if we actually freed it.
Due to missing braces non-main threads may currently set it to
NULL first.

5 years agoMerge branch 'PHP-7.3' into PHP-7.4
Nikita Popov [Thu, 7 Nov 2019 13:06:48 +0000 (14:06 +0100)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Remove outdated comments in test

5 years agoMerge branch 'PHP-7.2' into PHP-7.3
Nikita Popov [Thu, 7 Nov 2019 13:06:33 +0000 (14:06 +0100)]
Merge branch 'PHP-7.2' into PHP-7.3

* PHP-7.2:
  Remove outdated comments in test

5 years agoRemove outdated comments in test
Nikita Popov [Thu, 7 Nov 2019 13:06:23 +0000 (14:06 +0100)]
Remove outdated comments in test

5 years agoDisable ifunc resolvers under thread sanitizer as well
Nikita Popov [Thu, 7 Nov 2019 12:08:03 +0000 (13:08 +0100)]
Disable ifunc resolvers under thread sanitizer as well

5 years agoAdd UPGRADING note about default object from empty value
Nikita Popov [Thu, 7 Nov 2019 10:48:02 +0000 (11:48 +0100)]
Add UPGRADING note about default object from empty value

Fixes bug #75921.

[ci skip]

5 years agoMerge branch 'PHP-7.3' into PHP-7.4
Nikita Popov [Thu, 7 Nov 2019 10:17:14 +0000 (11:17 +0100)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fixed bug #78759

5 years agoMerge branch 'PHP-7.2' into PHP-7.3
Nikita Popov [Thu, 7 Nov 2019 10:16:03 +0000 (11:16 +0100)]
Merge branch 'PHP-7.2' into PHP-7.3

* PHP-7.2:
  Fixed bug #78759

5 years agoFixed bug #78759
Nikita Popov [Thu, 7 Nov 2019 10:15:29 +0000 (11:15 +0100)]
Fixed bug #78759

Handle INDIRECT values in array.

5 years agoFix #78788: ./configure generates invalid php_version.h
max [Thu, 7 Nov 2019 06:45:55 +0000 (07:45 +0100)]
Fix #78788: ./configure generates invalid php_version.h

Change $SED to "${SED}" such that the IFS is not used to split the
output of that variable.

5 years agoRemove bogus skipifs in get_browser tests
Nikita Popov [Wed, 6 Nov 2019 16:48:16 +0000 (17:48 +0100)]
Remove bogus skipifs in get_browser tests

We provide this file, it should be readable.

These checks no longer work, since --INI-- values are no longer
passed to --SKIPIF--.

5 years agoMerge branch 'PHP-7.3' into PHP-7.4
Nikita Popov [Wed, 6 Nov 2019 11:53:21 +0000 (12:53 +0100)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fixed bug #78787

5 years agoFixed bug #78787
Nikita Popov [Wed, 6 Nov 2019 11:51:25 +0000 (12:51 +0100)]
Fixed bug #78787

Not the first time inheritance of shadow properties causes an issue,
thankfully this whole concept is gone in PHP 7.4.

5 years agoMerge branch 'PHP-7.3' into PHP-7.4
Christoph M. Becker [Tue, 5 Nov 2019 17:25:10 +0000 (18:25 +0100)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  7.3.13 is next

5 years ago7.3.13 is next
Christoph M. Becker [Tue, 5 Nov 2019 17:17:04 +0000 (18:17 +0100)]
7.3.13 is next

5 years agoMerge branch 'PHP-7.3' into PHP-7.4
Sara Golemon [Tue, 5 Nov 2019 15:58:59 +0000 (10:58 -0500)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Bump for 7.2.26-dev

5 years agoMerge branch 'PHP-7.2' into PHP-7.3
Sara Golemon [Tue, 5 Nov 2019 15:58:35 +0000 (10:58 -0500)]
Merge branch 'PHP-7.2' into PHP-7.3

* PHP-7.2:
  Bump for 7.2.26-dev

5 years agoBump for 7.2.26-dev
Sara Golemon [Tue, 5 Nov 2019 15:56:19 +0000 (10:56 -0500)]
Bump for 7.2.26-dev

5 years agoMerge branch 'PHP-7.3' into PHP-7.4
Nikita Popov [Tue, 5 Nov 2019 11:15:49 +0000 (12:15 +0100)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fixed bug #78775

5 years agoMerge branch 'PHP-7.2' into PHP-7.3
Nikita Popov [Tue, 5 Nov 2019 11:14:53 +0000 (12:14 +0100)]
Merge branch 'PHP-7.2' into PHP-7.3

* PHP-7.2:
  Fixed bug #78775

5 years agoFixed bug #78775
Nikita Popov [Tue, 5 Nov 2019 11:13:46 +0000 (12:13 +0100)]
Fixed bug #78775

Clear the OpenSSL error queue before performing SSL stream operations.
As we don't control all code that could possibly be using OpenSSL,
we can't rely on the error queue being empty.

5 years agoMerge branch 'PHP-7.3' into PHP-7.4
Christoph M. Becker [Tue, 5 Nov 2019 09:17:50 +0000 (10:17 +0100)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Remove obsolete oniguruma.patch

5 years agoRemove obsolete oniguruma.patch
Christoph M. Becker [Tue, 5 Nov 2019 09:16:22 +0000 (10:16 +0100)]
Remove obsolete oniguruma.patch

The proper `SIZEOF_SIZE_T` definitions are available as of Oniguruma
6.9.1; no more need to patch.

5 years agoRemove dead code `ext/mysqlnd/mysqlnd_net.c`.
Adam Saponara [Mon, 4 Nov 2019 19:07:29 +0000 (14:07 -0500)]
Remove dead code `ext/mysqlnd/mysqlnd_net.c`.

I believe this code has been dead since 05c5e05 (2015) now replaced
by `ext/mysqlnd/mysqlnd_vio.c`.

Closes GH-4888.

5 years agoAdd a test for ReflectionClass:getInterfaceNames()
Fabien Villepinte [Mon, 4 Nov 2019 12:51:40 +0000 (13:51 +0100)]
Add a test for ReflectionClass:getInterfaceNames()

The method was not tested against a class without interface.

5 years agoMake test more robust
Christoph M. Becker [Mon, 4 Nov 2019 11:16:05 +0000 (12:16 +0100)]
Make test more robust

Time flies, so obviously the reported uptime may differ a bit (as
already occasionally noticed on CI); we cater to that by allowing a
delay of up to one second.

5 years agoRevert "Remove configure checks for supported instruction sets"
Nikita Popov [Mon, 4 Nov 2019 10:32:46 +0000 (11:32 +0100)]
Revert "Remove configure checks for supported instruction sets"

This reverts commit edccf32f7f36a8bc759b9482737e0c3efcb3a005.

This was reported to cause issues for as yet unknown reasons in
bug #78769. As this was intended as code cleanup, revert this from
7.4 at least. May reapply it to master later.

5 years agoFixed bug #78774
Nikita Popov [Mon, 4 Nov 2019 10:01:56 +0000 (11:01 +0100)]
Fixed bug #78774

The string held by the zend_type may be released if the property
type gets resolved to a CE. I initially wanted to fix this by
storing a zend_type* instead (so the property type resolution
propagates to the ReflectionType), but decided against this in
light of upcoming union types support, where we also need to
represent parts of the union, and will not have a single zend_type*
we can reference.

5 years agoPrint Client Library Version in phpinfo
Simonov Denis [Thu, 31 Oct 2019 17:40:15 +0000 (18:40 +0100)]
Print Client Library Version in phpinfo

5 years agoExplicitly specify ubuntu versions on azure pipelines
Nikita Popov [Sat, 2 Nov 2019 09:12:03 +0000 (10:12 +0100)]
Explicitly specify ubuntu versions on azure pipelines

Use the new 18.04 for the ones where the build succeeded and the
previous 16.04 where it didn't.

5 years agoFixed bug #78768
Nikita Popov [Fri, 1 Nov 2019 16:04:15 +0000 (17:04 +0100)]
Fixed bug #78768

Remove the typedef from zend_types.h, use explicit struct prefix
instead.

5 years agoFix conflicts between tests with obscure filenames
Fabien Villepinte [Fri, 1 Nov 2019 11:33:36 +0000 (12:33 +0100)]
Fix conflicts between tests with obscure filenames

For non-windows tests

5 years agoFix conflicts between tests with obscure filenames
Fabien Villepinte [Fri, 1 Nov 2019 11:24:38 +0000 (12:24 +0100)]
Fix conflicts between tests with obscure filenames

5 years agoMerge branch 'PHP-7.3' into PHP-7.4
Christoph M. Becker [Thu, 31 Oct 2019 15:09:38 +0000 (16:09 +0100)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fix test cases for libxml2 2.9.10

5 years agoMerge branch 'PHP-7.2' into PHP-7.3
Christoph M. Becker [Thu, 31 Oct 2019 15:08:38 +0000 (16:08 +0100)]
Merge branch 'PHP-7.2' into PHP-7.3

* PHP-7.2:
  Fix test cases for libxml2 2.9.10

5 years agoFix test cases for libxml2 2.9.10
Christoph M. Becker [Thu, 31 Oct 2019 15:02:05 +0000 (16:02 +0100)]
Fix test cases for libxml2 2.9.10

Since the error reporting has been slightly changed, we have to adapt
the two affected test cases.

5 years agoRemove configure checks for supported instruction sets
Nikita Popov [Thu, 31 Oct 2019 10:27:53 +0000 (11:27 +0100)]
Remove configure checks for supported instruction sets

These were checking whether the instruction set is supported by
the host CPU, however they were only used to condition on whether
this instruction set is targeted at all. It would still use dynamic
dispatch (e.g. based on ifunc resolvers) to select the actual
implementation. Whether the target is guaranteed to support the
instruction set without dispatch is determined based on pre-defined
macros like __SSE2__.

This removes the configure-time builtin cpu checks to remove
confusion. Additionally this allows targeting an architecture that
is newer than the host architecture.

5 years agoFix bug #77930: Remove mmap limit
Nikita Popov [Wed, 30 Oct 2019 12:15:05 +0000 (13:15 +0100)]
Fix bug #77930: Remove mmap limit

First, the limitation already doesn't trigger if you copy the whole
file (i.e. use copy() or stream_copy_to_stream() and don't specify
a length). This happens because length will be 0 at the time of the
check and only later calculated based on the file size. This means
that we're already completely blowing the length limit for what is
likely the most common case, and it doesn't seem like anyone complained
about that.

Second, the premise of the code comment ("to avoid runaway swapping")
seems incorrect to me. Because this performs a file-backed non-private
mmap, no swap backing is needed for the mapping. Concerns over "memory
usage" are also misplaced, as this is a virtual mapping.

5 years agoFix #78761: Zend memory heap corruption with preload and casting
Christoph M. Becker [Wed, 30 Oct 2019 17:05:10 +0000 (18:05 +0100)]
Fix #78761: Zend memory heap corruption with preload and casting

We have to reset `FFI_G(persistent)` back to zero when preloading has
finished.

5 years agoFix #78762: Failing FFI::cast() may leak memory
Christoph M. Becker [Wed, 30 Oct 2019 16:16:56 +0000 (17:16 +0100)]
Fix #78762: Failing FFI::cast() may leak memory

We have to release objects when we're done with them.

5 years agoAdd UPGRADING note for stream_read() change
Nikita Popov [Wed, 30 Oct 2019 10:31:28 +0000 (11:31 +0100)]
Add UPGRADING note for stream_read() change

Ref bug #78575.

[ci skip]

5 years agoOptimize creation of empty arrays in json_decode
Tyson Andre [Fri, 25 Oct 2019 23:57:39 +0000 (19:57 -0400)]
Optimize creation of empty arrays in json_decode

Use the shared empty array from ZVAL_EMPTY_ARRAY

For code that created an 10 arrays of 100000 empty arrays
(has the same result with `$assoc=true` and `{}`)

- This is the worst-case comparison, but I'd expect 0-length arrays to be fairly
  common in regular data for json_decode
- The parser implementation was using function pointers so that third party
  extension developers could reuse the json parser for their own
  data structures, etc. (I think).

  This PR is meant to let those third party extensions continue working
  without changes.

Before this patch: In 0.126 seconds: added 97.99 MiB
After this patch:  In 0.096 seconds: added 41.99 MiB

```php
<?php
$json = '[' . str_repeat('[],', 100000) . "null]";
$start_memory = memory_get_usage();
$start_time = microtime(true);
$result = [];
for ($i = 0; $i < 10; $i++) {
    $result[] = json_decode($json);
}
$end_memory = memory_get_usage();
$end_time = microtime(true);
// Before this patch: In 0.126 seconds: added 97.99 MiB
// After this patch:  In 0.096 seconds: added 41.99 MiB
printf("In %.3f seconds: added %.2f MiB\n", $end_time - $start_time, ($end_memory - $start_memory)/1000000);

// For objects
$json = '[' . str_repeat('{},', 100000) . "null]";
$start_memory = memory_get_usage();
$start_time = microtime(true);
for ($i = 0; $i < 10; $i++) {
    $result[] = json_decode($json, true);
}
$end_memory = memory_get_usage();
$end_time = microtime(true);
// Before this patch: In 0.126 seconds: added 97.99 MiB
// After this patch:  In 0.096 seconds: added 41.99 MiB
printf("In %.3f seconds: added %.2f MiB (objects decoded as arrays) \n", $end_time - $start_time, ($end_memory - $start_memory)/1000000);
```

Closes GH-4861.

5 years agoMerge branch 'PHP-7.3' into PHP-7.4
Nikita Popov [Wed, 30 Oct 2019 08:23:06 +0000 (09:23 +0100)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Add missing refcount increment

5 years agoMerge branch 'PHP-7.2' into PHP-7.3
Nikita Popov [Wed, 30 Oct 2019 08:22:37 +0000 (09:22 +0100)]
Merge branch 'PHP-7.2' into PHP-7.3

* PHP-7.2:
  Add missing refcount increment

5 years agoAdd missing refcount increment
Nikita Popov [Wed, 30 Oct 2019 08:22:20 +0000 (09:22 +0100)]
Add missing refcount increment

5 years agoMerge branch 'PHP-7.3' into PHP-7.4
Nikita Popov [Tue, 29 Oct 2019 14:07:28 +0000 (15:07 +0100)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fixed bug #78689

5 years agoMerge branch 'PHP-7.2' into PHP-7.3
Nikita Popov [Tue, 29 Oct 2019 14:06:28 +0000 (15:06 +0100)]
Merge branch 'PHP-7.2' into PHP-7.3

* PHP-7.2:
  Fixed bug #78689

5 years agoFixed bug #78689
Nikita Popov [Tue, 29 Oct 2019 14:05:59 +0000 (15:05 +0100)]
Fixed bug #78689