Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix GH-10571: Assertion `zval_get_type(&(*(zptr))) == 6 && "Concat sh… #111

Open
wants to merge 2,448 commits into
base: master
Choose a base branch
from

Conversation

nielsdos
Copy link
Owner

…ould return string"' failed

petk and others added 30 commits July 1, 2024 21:04
- Arguments quoted
- Redundant comments removed (some basic help info is in the
  build/php.m4)
- APXS variable as such isn't used in the generated Makefile, the path
  to the apxs tool is inserted during the configure step directly
- Argument quoted
- ODBC_INCDIR and ODBC_LIBDIR are not used in the generated Makefile
* PHP-8.3:
  Use pattern tags for NDBM ext/dba/tests (php#14755)
- Arguments quoted
- Duplicate redundant prefix variable substitution removed
This is just a sync and alignment with Autoconf documentation style
order of checks in configure.ac ("Standard configure.ac Layout"):
https://www.gnu.org/software/autoconf/manual/autoconf-2.72/autoconf.html#Autoconf-Input-Layout
The PHP_ARG_ENABLE and PHP_ARG_WITH 2nd argument is the check message in
the configure log output.
Symbol was added when PHP-8.3 JIT engine was used with the IR JIT and is
now unused and redundant.
The exact same code already exists above this.
opcode cannot be ZEND_POST_INC because of the if check above.
prop_info is NULL in this branch.
- over-quoted arguments reduced
- AS_VAR_IF used
- php_cv_var_PS_STRINGS cache variable name used instead of cli_cv_*
- Macro help text synced according to empty definition
- Synced CS: AS_VAR_IF style checks and M4 macro arguments quoted
- Error message normalized without checking other errors appended (once
  more dependencies were required and additional error messages were
  appended)
Fiber switching was disabled during destructor execution due to conflicts
with the garbage collector. This unfortunately introduces a function color
problem: destructors can not call functions that may switch Fibers.

In this change we update the GC so that Fiber switching during GC is safe. In
turn we allow Fiber switching during destrutor execution.

The GC executes destructors in a dedicated Fiber. If a destructor suspends, the
Fiber is owned by userland and a new dedicated Fiber is created to execute the
remaining destructors. Destructor suspension results in a resurection of the
object, which is handled as usual: The object is not considered garbage anymore,
but may be collected in a later run.

When the GC is executed in the main context (not in a Fiber), then destructors
are executed in the main context as well because there is no risk of conflicting
with GC in this case (main context can not suspend).

Fixes phpGH-11389
Closes phpGH-13460
SakiTakamachi and others added 25 commits July 18, 2024 08:12
This is mostly about mentioning that VLAs which are a required part of
C99 conforming implementations (although made optional in the C11
standard) *must* *not* be used in php-src.
* PHP-8.3:
  Revert "Skip bug45161.phpt on Windows"
Use our own string builder instead of using libxml's and then having to
copy over.

For the following test:
```
$dom = Dom\HTMLDocument::createEmpty();
$root = $dom->appendChild($dom->createElement('root'));
$root->append('abc', 'def', 'ghi');
$f = $root->firstChild;

for ($i = 0; $i < 1000000; $i++)
	$f->wholeText;
```

The following results were obtained on an i7-4790:
```
Benchmark 1: ./sapi/cli/php x.php
  Time (mean ± σ):      57.2 ms ±   2.3 ms    [User: 53.2 ms, System: 3.4 ms]
  Range (min … max):    54.7 ms …  69.3 ms    52 runs

Benchmark 2: ./sapi/cli/php_old x.php
  Time (mean ± σ):      89.4 ms ±   3.4 ms    [User: 85.6 ms, System: 3.0 ms]
  Range (min … max):    86.1 ms … 105.8 ms    32 runs

Summary
  ./sapi/cli/php x.php ran
    1.56 ± 0.09 times faster than ./sapi/cli/php_old x.php
```
This introduces a new helper php_dom_create_nullable_object() that does
the NULL check and puts NULL in return_value. Otherwise it runs
php_dom_create_object(). This deduplicates a bit of code.
This adds notice in the UPGRADING.INTERNALS file and removes redundant
undefinition from Windows config header.

Follow-up of phpGH-14942.
The zend_object.properties HashTable needs to be built just in time by calling
rebuild_object_properties() on the object before accessing it. Normally this is
done automatically in zend_std_get_properties(), but we do it manually in a few
places.

In this change I introduce an inline variant of zend_std_build_properties(), and
refactor these places to use it instead of calling rebuild_object_properties()
manually.

rebuild_object_properties() renamed as rebuild_object_properties_internal(), to
enforce usage of zend_std_get_properties() or zend_std_build_properties_ex().

Closes phpGH-14996
* PHP-8.3:
  Update the php-sdk-binary-tools to php-sdk-2.3.0
This makes the developer intent clear and should prevent some false
reports.
* PHP-8.3:
  Fix phpGH-15028: Memory leak in ext/phar/stream.c
  Fix phpGH-15023: Memory leak in Zend/zend_ini.c
  Fix phpGH-15020: Memory leak in Zend/Optimizer/escape_analysis.c
Quoted m4_normalize will expand and change its argument later in the
macro call when M4 is processing the *.m4 sources. Without quotes the
already normalized string is passed to the macro directly. In these
specific cases generated configure script is the same. This is more for
consistency to have this synced and not repeat the pattern too much
in the future when copy/pasting. Note, that many AC_* macros require
similar behavior already (for example, AC_CHECK_FUNCS.)
AIX 7.1 has SOCK_CONN_DGRAM, but not SOCK_DCCP; the previous change
conflated the availability between the two definitions. Add an
additional #ifdef for this.
- PHP_ADD_INCLUDE
- PHP_EVAL_INCLINE
- PHP_EVAL_LIBLINE
@nielsdos nielsdos force-pushed the vm-2 branch 2 times, most recently from 301b556 to dc1130b Compare July 21, 2024 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.