Commit Graph

2501 Commits

Author SHA1 Message Date
Christoph M. Becker
237f07ea9d Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix brittle test
2019-07-01 16:44:54 +02:00
Christoph M. Becker
d714be0f57 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix brittle test
2019-07-01 16:43:47 +02:00
Christoph M. Becker
be559e6c37 Fix brittle test
This test is easily tripped by former test runs with other PHP
versions.  To avoid such false positives, we check that there is at
least one respective OPcache file, and that all found OPcache user ID
folders have exactly 32 hexadecimal digits.
2019-07-01 16:42:55 +02:00
Nikita Popov
8fc58a1a1d Merge branch 'PHP-7.4' 2019-07-01 11:14:54 +02:00
Nikita Popov
da06f7f383 Msan: Unpoison buffer written by file cache
It would be great if this were fully initialized, but it's not
really a problem either (as long as we don't care about reproducible
file cache), so ignore this for now.
2019-07-01 11:14:28 +02:00
Nikita Popov
c8af6a7fa7 Don't use fast_memcpy under msan 2019-07-01 11:14:23 +02:00
Nikita Popov
4a8fe02c7c Undef opline result on mod/shift error in jit 2019-07-01 10:15:06 +02:00
Nikita Popov
b7ed20662e Fix out of bounds read in jit_fetch_obj_read 2019-07-01 09:54:21 +02:00
Peter Kokot
98d0892dd8 Merge branch 'PHP-7.4'
* PHP-7.4:
  Sync functions checks
2019-06-30 23:59:47 +02:00
Peter Kokot
9a3c8e51e3 Sync functions checks
Removed unused checks:
- mbsinit check removed, HAVE_MBSINIT removed (not used in php-src)
- mempcpy check removed, HAVE_MEMPCPY removed (not used in php-src anymore since
  560ed89bfb which uses PHP's own implementation)
- strpncpy check removed, added via a8c9e893b6 and
  not used.
- setpgid check removed since HAVE_SETPGID is not used

Moved to a central configure.ac:
- fpclass
- mbrlen moved to configure.ac (since the HAVE_MBRLEN is used accross the php-src)
- sigprocmask
- getcwd
- getwd
- glob
- strfmon
- nice

Duplicated checks removed:
- gethostname
- getlogin
- getpwuid_r
- socketpair

- mprotect check simplified
2019-06-30 23:57:54 +02:00
Nikita Popov
b98c148f78 Merge branch 'PHP-7.4' 2019-06-28 15:05:00 +02:00
Nikita Popov
54dd762f59 Set up asan+ubsan scheduled build on azure
Also adds an --asan flag to run-tests.php to setup all the necessary
environment variables. Some tests are marked as skipped because they
are incompatible with asan or too slow.

I'm basing this on the DEBUG_ZTS build, which seems to give us the
most mileage.
2019-06-28 15:00:54 +02:00
Nikita Popov
0a0ca984f0 Merge branch 'PHP-7.4' 2019-06-28 14:48:08 +02:00
Nikita Popov
ca6f41aa5a Fix out of bounds read in sccp 2019-06-28 14:47:49 +02:00
Nikita Popov
aa8d70f309 Merge branch 'PHP-7.4' 2019-06-28 09:19:49 +02:00
Nikita Popov
a78adce5cb Free ZTS lock in opcache
For some reason this only shows up as a leak when using phpdbg.
2019-06-28 09:18:14 +02:00
Peter Kokot
7f994990ea Merge branch 'PHP-7.4'
* PHP-7.4:
  Remove HAVE_STRCOLL check
2019-06-28 00:13:25 +02:00
Peter Kokot
638c21765c Remove HAVE_STRCOLL check
The strcoll function is defined in the C89 standard and should be
on today's systems always available via the <string.h> header.

https://port70.net/~nsz/c/c89/c89-draft.html#4.11.4.3

- Remove also SKIPIF strcoll check in test
2019-06-28 00:05:55 +02:00
Nikita Popov
e31936205b Merge branch 'PHP-7.4' 2019-06-27 16:16:57 +02:00
Nikita Popov
40d6147dd0 Fix opcache blacklist leak
Don't recompute (and leak) the regex for every glob element, only
do this once at the end.
2019-06-27 16:11:58 +02:00
Peter Kokot
6bfa6bff0b Merge branch 'PHP-7.4'
* PHP-7.4:
  Clean headers checks
2019-06-27 02:45:31 +02:00
Peter Kokot
2079b09854 Clean headers checks
Some headers were checked multiple times in the main configure.ac file
and in the bundled extensions or SAPIs themselves. Also many of these
checks are then used accross other extensions or SAPIs so a central
configure.ac makes most sense for these checks.
2019-06-27 02:45:09 +02:00
Christoph M. Becker
d1141ff24b Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix #78202: Opcache stats for cache hits are capped at 32bit NUM
2019-06-25 13:07:00 +02:00
Christoph M. Becker
ead40e31e9 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #78202: Opcache stats for cache hits are capped at 32bit NUM
2019-06-25 13:06:20 +02:00
Christoph M. Becker
18bba63f39 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #78202: Opcache stats for cache hits are capped at 32bit NUM
2019-06-25 13:04:28 +02:00
Christoph M. Becker
4366f22dfc Fix #78202: Opcache stats for cache hits are capped at 32bit NUM
We use the proper format specifiers now.
2019-06-25 13:00:28 +02:00
Dmitry Stogov
ca22c456ca Merge branch 'PHP-7.4'
* PHP-7.4:
  Keep lowercased parent class name as second argument of DECLARE_CLASS to avoid extra work at run-time
2019-06-25 11:32:03 +03:00
Dmitry Stogov
759f4ecd8b Keep lowercased parent class name as second argument of DECLARE_CLASS to avoid extra work at run-time 2019-06-25 11:30:58 +03:00
Dmitry Stogov
e18c60cd8d Merge branch 'PHP-7.4'
* PHP-7.4:
  Fixed bug 78175 (Preloading must store default values of static variables and properties)
2019-06-24 20:34:05 +03:00
Dmitry Stogov
0f29fb5cd8 Fixed bug 78175 (Preloading must store default values of static variables and properties) 2019-06-24 20:32:27 +03:00
Nikita Popov
38909b7526 Merge branch 'PHP-7.4' 2019-06-21 10:25:17 +02:00
Nikita Popov
7a1ca07a60 Don't try to exclude zreg_none
zreg_none has no representation in the regset, so this operation
doesn't make sense.
2019-06-21 10:24:58 +02:00
Nikita Popov
8227e0f747 Avoid ub in shift overflow check
Also fix an off-by-one error. While 1 << 63 overflows, -1 << 63 does
not.
2019-06-21 10:24:27 +02:00
Nikita Popov
291eb19419 Dasm: Perform unaligned stores through unaligned pointers 2019-06-21 09:47:25 +02:00
Dmitry Stogov
1707f6645a Additional fix for bug #78185 (File cache no longer works) 2019-06-21 10:06:35 +03:00
Christoph M. Becker
360b58e43b Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix #78189: file cache strips last character of uname hash
2019-06-20 18:02:01 +02:00
Christoph M. Becker
2b4fc9eb9c Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #78189: file cache strips last character of uname hash
2019-06-20 18:01:02 +02:00
Christoph M. Becker
a85254b898 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #78189: file cache strips last character of uname hash
2019-06-20 17:59:59 +02:00
Christoph M. Becker
fcd6f2de60 Fix #78189: file cache strips last character of uname hash
We must not forget to increase `len` by one to cater to the directory
separator.
2019-06-20 17:58:32 +02:00
Nikita Popov
42f3ed480d Avoid shift ub for regsets 2019-06-20 17:24:32 +02:00
Christoph M. Becker
9147d06f7d Merge branch 'PHP-7.4'
* PHP-7.4:
  Rename test file to reflect the appropriate ticket number
2019-06-20 16:55:22 +02:00
Christoph M. Becker
ecae9100dc Rename test file to reflect the appropriate ticket number 2019-06-20 16:54:17 +02:00
Remi Collet
50978128f5 Merge branch 'PHP-7.4'
* PHP-7.4:
  fix test for Windows and for parallel run
2019-06-20 11:59:21 +02:00
Remi Collet
961935fde2 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  fix test for Windows and for parallel run
2019-06-20 11:59:04 +02:00
Remi Collet
676b564f43 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  fix test for Windows and for parallel run
2019-06-20 11:58:49 +02:00
Remi Collet
d8202bf917 fix test for Windows and for parallel run 2019-06-20 11:58:32 +02:00
Remi Collet
714cd7ff3e Merge branch 'PHP-7.4'
* PHP-7.4:
  improve test clean section
  move NEWS entry
2019-06-20 11:52:54 +02:00
Remi Collet
522cf62906 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  improve test clean section
  move NEWS entry
2019-06-20 11:52:25 +02:00
Remi Collet
d7597f73cc Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  improve test clean section
2019-06-20 11:51:51 +02:00
Remi Collet
b3cfeda3c7 improve test clean section 2019-06-20 11:51:18 +02:00
Nikita Popov
a2d0899e74 Merge branch 'PHP-7.4' 2019-06-20 10:35:38 +02:00
Nikita Popov
e162a1c02e Fix maybe uninit warning 2019-06-20 10:35:22 +02:00
Remi Collet
477f4fec6d Merge branch 'PHP-7.4'
* PHP-7.4:
  add test for #78185
2019-06-20 10:28:46 +02:00
Remi Collet
fa70aedf03 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  add test for #78185
2019-06-20 10:28:26 +02:00
Remi Collet
a197dc72c3 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  add test for #78185
2019-06-20 10:28:00 +02:00
Remi Collet
63f2d88088 add test for #78185 2019-06-20 10:27:33 +02:00
Nikita Popov
681136212f Merge branch 'PHP-7.4' 2019-06-20 10:16:31 +02:00
Nikita Popov
117c7b3f65 Avoid overflow in mul range calculation
By using ZEND_SIGNED_MULTIPLY_LONG, which already implemented
efficient overflow checking logic.
2019-06-20 09:57:55 +02:00
Nikita Popov
3a97b8b4f9 Backport "Avoid UB in overflow checks"
Cherry-pick of bb940d9969 without
the JIT parts.
2019-06-20 09:51:05 +02:00
Nikita Popov
ccfe6c862a Avoid memset/memcpy null ub in block pass
The arena allocator has no problem with zero-size allocations (and
will just return the same pointer for each in this case), so just
do that to avoid null pointers.
2019-06-20 09:49:07 +02:00
Dmitry Stogov
e177791df1 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fixed bug #78185 (File cache no longer works)
2019-06-20 09:08:09 +03:00
Dmitry Stogov
05c8f1ff2e Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fixed bug #78185 (File cache no longer works)
2019-06-20 09:07:39 +03:00
Dmitry Stogov
35acda856a Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fixed bug #78185 (File cache no longer works)
2019-06-20 09:05:50 +03:00
Dmitry Stogov
cd6a6e4cf2 Fixed bug #78185 (File cache no longer works) 2019-06-20 09:04:14 +03:00
Nikita Popov
bb940d9969 Avoid UB in overflow checks
Some of the overflow checks in zend_may_overflow were optimized
away by clang, causing JIT failures on release macos.
2019-06-19 12:02:42 +02:00
Dmitry Stogov
c8d27777d6 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fixed bug #78175 (Preloading segfaults at preload time and at runtime)
2019-06-18 17:19:19 +03:00
Dmitry Stogov
148eb20226 Fixed bug #78175 (Preloading segfaults at preload time and at runtime) 2019-06-18 17:18:49 +03:00
Dmitry Stogov
22b2d9d088 Fixed JIT failure, on ZTS build without global register vatriables 2019-06-18 13:52:52 +03:00
Joe Watkins
41067a22e9
Merge branch 'PHP-7.4'
* PHP-7.4:
  Turn system_id into a true global
2019-06-18 10:27:50 +02:00
Christoph M. Becker
04a6aac59b
Turn system_id into a true global
The system_id is identical for all threads and can be computed during
module startup, so there is no need to calculate and store it for each
thread.
2019-06-18 10:27:35 +02:00
Dmitry Stogov
7a236b6761 Attempt to fix JIT on Mac OSX ZTS build 2019-06-17 17:08:58 +03:00
Tyson Andre
38c0f6056b zend_func_info: Remove null from methods with non-null return type
Detected by parsing the strings in zend_func_info.c, looping over them
and checking for inconsistencies with Reflection.

(new ReflectionFunction('str_shuffle')->getReturnType()) would be
a non-null 'string', for example.
- e.g. that change was made in 7393777da9
  for php 8.0

Closes GH-4269.
2019-06-17 12:36:30 +02:00
Nikita Popov
4d90848d68 Don't verify arginfo types for internal functions
To avoid duplicate type checks. In debug builds arginfo is still
checked and will generate an assertions if the function doesn't
subsequently throw an exception.

Some test results change due to differences in zpp and arginfo
error messages.
2019-06-17 11:46:28 +02:00
Tyson Andre
74589cf676 Make opcache zend_func_info consistent with Reflection for ctype
This follows up with php 8.0 adding a real return type
(non-null bool) in 1409a3b153
2019-06-16 11:28:18 +02:00
Dmitry Stogov
96a6f7f7f5 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Backport 96a12578c1
2019-06-14 13:29:30 +03:00
Dmitry Stogov
28808ca96d Backport 96a12578c1 2019-06-14 13:29:13 +03:00
Dmitry Stogov
a5b39abd86 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Backport 91a6cdbff5
2019-06-14 13:25:06 +03:00
Dmitry Stogov
40f463b560 Backport 91a6cdbff5 2019-06-14 13:24:47 +03:00
Dmitry Stogov
29902e0e46 Merge branch 'PHP-7.4'
* PHP-7.4:
  More edge case fixes that may cause bug #78106
2019-06-14 13:10:39 +03:00
Dmitry Stogov
96a12578c1 More edge case fixes that may cause bug #78106 2019-06-14 13:10:02 +03:00
Dmitry Stogov
ca486893ba Merge branch 'PHP-7.4'
* PHP-7.4:
  Attempt to fix edge conditions that may cause bug #78106
2019-06-14 12:48:00 +03:00
Dmitry Stogov
91a6cdbff5 Attempt to fix edge conditions that may cause bug #78106 2019-06-14 12:47:22 +03:00
Dmitry Stogov
5883dbcb18 Fixed incorect register allocation in ZTS build 2019-06-14 00:29:22 +03:00
Nikita Popov
026023bd71 Merge branch 'PHP-7.4' 2019-06-13 12:54:17 +02:00
Nikita Popov
e5be58f57c Merge branch 'PHP-7.3' into PHP-7.4 2019-06-13 12:54:10 +02:00
Nikita Popov
bada2049ca Merge branch 'PHP-7.2' into PHP-7.3 2019-06-13 12:52:32 +02:00
Nikita Popov
f1a8138055 Fixed bug #78106
When disabling opcache during the request via opcache.enable ini
setting, make sure we also disable ZCG(accelerator_enabled).
2019-06-13 12:51:35 +02:00
Nikita Popov
b2b9c4785f Merge branch 'PHP-7.4' 2019-06-13 12:41:14 +02:00
Nikita Popov
da275e6214 Merge branch 'PHP-7.3' into PHP-7.4 2019-06-13 12:41:01 +02:00
Nikita Popov
ee137a7033 Merge branch 'PHP-7.2' into PHP-7.3 2019-06-13 12:38:57 +02:00
Nikita Popov
f8a68fd935 Add test for bug #78106
Also add PHP_TEST_EXTRA_ARGS environment variable, which allows
to pass on -c, -d etc flags provided by run-tests.php. Otherwise
we won't get the built-in server to run with opcache.
2019-06-13 12:35:29 +02:00
Nikita Popov
3b27689d46 Fix helper call on 32-bit
This is using the fast-call calling convention. Use FCARG1a and
same code for 32-bit and 64-bit.
2019-06-13 12:11:23 +02:00
Nikita Popov
792e38d863 Fix bug #78154 with JIT 2019-06-13 11:53:31 +02:00
Nikita Popov
51d82da6b0 Suppress -Wtautological-compare in dasc file 2019-06-13 09:59:42 +02:00
Nikita Popov
39034dbc67 Determine thread ID on macos
Also initialize the variable to 0 -- I don't think we really care
if this is not determine on some platform, but it should at least
not be uninitialized.
2019-06-13 09:59:42 +02:00
Nikita Popov
ff8002fc7c Mark label as potentially unused 2019-06-12 16:47:48 +02:00
Nikita Popov
180b29a493 Merge branch 'PHP-7.4' 2019-06-11 15:41:13 +02:00
Nikita Popov
83e0bfb50c Merge branch 'PHP-7.3' into PHP-7.4 2019-06-11 15:41:05 +02:00
Tyson Andre
5d3e3a62a2 Be more precise about possible types for mysqli methods
mysqli has an uncommon approach to 64-bit compatibility:
it will convert numbers that can't be represented on 32-bit
platforms to a string.
This is documented at
https://www.php.net/manual/en/mysqli-stmt.affected-rows.php#refsect1-mysqli-stmt.affected-rows-returnvalues

So if there's a query to a remote mysqli server that affects
more than 2.2 billion rows, then the opcache inference might be
incorrect.

(It's possible to add a MAY_BE_STRING_ON_32_BIT_PLATFORM bitflag macro to
account for this, but I don't think there's a need or want to?)

Patches 3162285b86

This is based on the list of php 7.4 functions using
MYSQLI_RETURN_LONG_INT in mysqli_api.c
2019-06-11 15:40:33 +02:00
Tyson Andre
07c63c6fdf Fix opcache signatures for mysqli_stat
See mysqli_api.c and https://www.php.net/manual/en/mysqli.stat.php
2019-06-11 15:39:59 +02:00