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

123127 Commits

Author SHA1 Message Date
Dmitry Stogov
fa14eedbea Optimized object serialization without rebulding properties HashTable 2021-03-01 16:10:56 +03:00
Dmitry Stogov
56afe2f230 Incomplete class may have only single "MAGIC_MEMBER" 2021-03-01 14:53:30 +03:00
Dmitry Stogov
b0c7ea4919 Change the order of properties used in foreach(), var_dump(), serialize(), comparison, etc. Now properties are ordered according to their layout in zend_object structure. 2021-03-01 13:43:22 +03:00
Dmitry Stogov
c9a9362c78 Added UPGRADING note. 2021-03-01 13:42:34 +03:00
Nikita Popov
47a2e5c785 Reference dynamic functions through dynamic_defs
Currently, dynamically declared functions and closures are inserted
into the function table under a runtime definition key, and then later
possibly renamed. When opcache is not used and a file containing a
closure is repeatedly included, this leads to a very large memory leak,
as the no longer needed closure declarations will never be freed
(https://bugs.php.net/bug.php?id=76982).

With this patch, dynamic functions are instead stored in a
dynamic_func_defs member on the op_array, which opcodes reference
by index. When the parent op_array is destroyed, the dynamic_func_defs
it contains are also destroyed (unless they are stilled used elsewhere,
e.g. because they have been bound, or are used by a live closure). This
resolves the fundamental part of the leak, though doesn't completely
fix it yet due to some arena allocations.

The main non-obvious change here is to static variable handling:
We can't destroy static_variables_ptr in destroy_op_array, as e.g.
that would clear the static variables in a dynamic function when
the op_array containing it is destroyed. Static variable destruction
is separated out for this reason (we already do static variable
destruction separately for normal functions, so we only need to
handle main scripts).

Closes GH-5595.
2021-03-01 11:35:54 +01:00
Dmitry Stogov
72c3ededed Change the order of properties used for var_dump(), serialize(), comparison, etc.
Now properties are ordered according to their layout in zend_object structure.
2021-03-01 13:29:49 +03:00
Max Semenik
b86dfb0e74 Fix E_DEPRECATED in zend_vm_gen.php
explode(): Passing null to parameter #2 ($string) of type string is
deprecated

Closes GH-6698.
2021-03-01 11:22:18 +01:00
Max Semenik
bdd7c48764 run-tests: drop support for ancient Valgrind versions
Valgrind 3.3.0 was released in 2007, not even RHEL has crap older than
this. It could be argued that 3.8.0, released in 2012, could be a safe
cutoff too.

Closes GH-6728.
2021-03-01 11:21:30 +01:00
Nikita Popov
1ec7cc96dc Clarify types in XmlReader property handling
Make it clearer that the specified type is really the only type
that can be returned.
2021-03-01 09:54:24 +01:00
Patrick Allaert
6f38a53940 Remove useless conditional #ifdef
Closes GH-6737

Signed-off-by: George Peter Banyard <girgias@php.net>
2021-02-27 13:23:00 +00:00
George Peter Banyard
bfd3fda0f4 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix Bug #80800 imap_open() fails when the flags parameter includes CL_EXPUNGE
2021-02-27 13:14:23 +00:00
George Peter Banyard
1ee6aad248 Fix Bug #80800 imap_open() fails when the flags parameter includes CL_EXPUNGE
This also affected imap_reopen().
Add a supplementary test that the CL_EXPUNGE flag does have
the intended effect.

Closes GH-6732
2021-02-27 13:12:22 +00:00
Dmitry Stogov
6c5942f835 serialize() optimization 2021-02-26 13:30:19 +03:00
Dmitry Stogov
17ad94df12 Optimize out zend_strpprintf() usage for simple concationaton 2021-02-26 10:34:30 +03:00
Dmitry Stogov
13e4ce386b Improve SPL directory and stat() cache using zend_srting* instead of char* 2021-02-26 02:28:46 +03:00
Felipe Pena
5e8ae15c3d Merge branch 'PHP-8.0' 2021-02-25 20:57:30 +00:00
Felipe Pena
8813f2e0c3 Merge branch 'PHP-7.4' into PHP-8.0 2021-02-25 20:54:24 +00:00
Felipe Pena
988c3f9659 Fix memleak on ReflectionFunction and ReflectionGenerator classes when calling __construct after instantiation 2021-02-25 20:53:14 +00:00
George Peter Banyard
3a4b89661e Remove quicktester
This is barely used and more of a hinderence than anything else

Closes GH-6712
2021-02-25 17:39:31 +00:00
Remi Collet
8c206ba5ac Merge branch 'PHP-8.0'
* PHP-8.0:
  skip test with openssl < 1.1.0
2021-02-25 13:54:34 +01:00
Remi Collet
18071aaa08 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  skip test with openssl < 1.1.0
2021-02-25 13:54:19 +01:00
Remi Collet
ae0585c98e skip test with openssl < 1.1.0
The test fails, but without any crash
(this test is designed to catch a crash)
2021-02-25 13:52:35 +01:00
Christoph M. Becker
51914610ab Merge branch 'PHP-8.0'
* PHP-8.0:
  Capture Microsoft-defined HRESULT exit codes exit codes
2021-02-25 12:05:27 +01:00
Christoph M. Becker
fb683030bf Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Capture Microsoft-defined HRESULT exit codes exit codes
2021-02-25 12:03:43 +01:00
Dylan K. Taylor
a480bf8093 Capture Microsoft-defined HRESULT exit codes exit codes
The lack of such a check leads to false-passes of tests on Windows
which expect no output, but produce a segfault or similar issue. I
discovered this a while ago due to bad tests in an extension I maintain.

Closes GH-6722.
2021-02-25 12:01:04 +01:00
Nikita Popov
362116c80b Merge branch 'PHP-8.0'
* PHP-8.0:
  crc32 module, clang spurious warning removal.
2021-02-25 10:19:06 +01:00
David CARLIER
ddea5c0816 crc32 module, clang spurious warning removal.
Closes GH-6725.
2021-02-25 10:17:21 +01:00
Dmitry Stogov
0f6c00200b Speed up __sleep() and __wakeup() calls 2021-02-25 12:16:22 +03:00
Nikita Popov
7920c9dd44 Merge branch 'PHP-8.0'
* PHP-8.0:
  mysqlnd pam fix test error message
2021-02-25 09:52:18 +01:00
Nikita Popov
f06efce387 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  mysqlnd pam fix test error message
2021-02-25 09:52:07 +01:00
Daniel Black
8309c04464 mysqlnd pam fix test error message
Closes GH-6727.
2021-02-25 09:51:51 +01:00
Nikita Popov
4a8b93425d Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix potential file collision in dom tests
  Fix bug #80757 (Exit code is 0 when could not open file)
  Update NEWS
2021-02-24 21:31:03 +01:00
Nikita Popov
44ef32ff2c Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix potential file collision in dom tests
2021-02-24 21:30:44 +01:00
Nikita Popov
766f827e26 Fix potential file collision in dom tests 2021-02-24 21:30:20 +01:00
Felipe Pena
aaea81de7c Merge branch 'PHP-7.4' into PHP-8.0 2021-02-24 19:07:22 +00:00
Felipe Pena
3ec37a74a2 Fix bug #80757 (Exit code is 0 when could not open file) 2021-02-24 18:50:27 +00:00
Felipe Pena
78b0a85de6 Update NEWS 2021-02-24 18:40:32 +00:00
Dmitry Stogov
5caf29a01e Switch few functions useful in Symphony apps to new ZPP API. 2021-02-24 19:13:11 +03:00
Dmitry Stogov
99d0f502dc Fixed error message 2021-02-24 19:12:32 +03:00
Nikita Popov
23afc62080 Allow pointer to end of memory in IS_UNSERIALIZED()
We already use <= for IS_SERIALIZED(), but the same general
problem can also occur for IS_UNSERIALIZED(). We don't seem to
hit this in practice prior to GH-5595 though.
2021-02-24 11:46:35 +01:00
Dmitry Stogov
ae2ea348dd Merge branch 'PHP-8.0'
* PHP-8.0:
  Fixed bug #80782 (DASM_S_RANGE_VREG on PHP_INT_MIN-1)
2021-02-24 12:20:49 +03:00
Dmitry Stogov
b7fa5268e4 Fixed bug #80782 (DASM_S_RANGE_VREG on PHP_INT_MIN-1) 2021-02-24 12:20:20 +03:00
Dylan T
e5551d50e7 zend_compile.c: fix typo
Don't mind me, I just happened to be browsing this code. 🙃

Closes GH-6721.

[ci skip]
2021-02-24 10:10:19 +01:00
Max Semenik
dda0cea5cd run-tests: add skip cache
Currently every --SKIPIF-- section in every test file results in 1
extra execution of PHP, every --EXTENSIONS-- section - in 2 executions.
This is quite wasteful, as skip checking code is extremely repetitive
and extensions are fixed for every binary/ini/command parameters
combination.

This patch adds caching to all such checks.

On my machine, the gains are quite noticeable: 36s instead of 43s
with -j16, 292s instead of 337s without concurrency. Cache stats are
3780 hits, 1247 misses in the latter case. In the future, tests could
be adjusted to have more uniform skip checks to improve performance even
more.

Closes GH-6681.
2021-02-23 15:05:49 +01:00
Christoph M. Becker
b84e3b1ced Merge branch 'PHP-8.0'
* PHP-8.0:
  run-tests: fixed exit code not being set on BORKED tests
2021-02-23 13:23:22 +01:00
Christoph M. Becker
8162c3d1fd Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  run-tests: fixed exit code not being set on BORKED tests
2021-02-23 13:22:50 +01:00
Christoph M. Becker
67bb06cc9b Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  run-tests: fixed exit code not being set on BORKED tests
2021-02-23 13:15:30 +01:00
Dylan K. Taylor
729cd8bacd run-tests: fixed exit code not being set on BORKED tests
When no test paths are specified this shows up when 'make test' is used on a PECL extension without specifying tests to run (or in php-src too, I guess...)

Closes GH-6717.
2021-02-23 12:50:03 +01:00
Nikita Popov
fc1a012c49 Fix Windows build
Don't add to a void pointer.
2021-02-23 12:23:08 +01:00
Christoph M. Becker
062c09e198 Merge branch 'PHP-8.0'
* PHP-8.0:
  Update php_version.h to proper version number
2021-02-23 12:18:03 +01:00