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 GH-11389
Closes GH-13460
- 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)
- 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
- 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
mainly for scenarios when pcntl_fork/pcntl_exec are involved so when
the latter is executed, we avoid unwarranted effects with the file
descriptors, instead the socket will be closed on success.
close GH-14606
- All arguments quoted
- PHP_VERSION, PHP_VERSION_ID, PHP_LDFLAGS are used only in templates
with @...@ placeholders
- These are not used in generated Makefile neither in templates:
abs_builddir, abs_srcdir, DEBUG_CFLAGS
- These are used only in generated Makefile: EXTRA_LDFLAGS,
EXTRA_LDFLAGS_PROGRAM, ZEND_EXTRA_LIBS, INCLUDES, EXTRA_INCLUDES,
INSTALL_IT, NATIVE_RPATHS
When Valgrind is enabled and not found on the system, default error can
be thrown by PKG_CHECK_MODULES instead of writing a manual error step.
- This uses less redundant variables and has synced CS.
- AS_VAR_IF used instead of raw shell ifs
- Added some basic help descriptions for macro definitions
You cannot return or yield a reference to a nullsafe chain. This was
checked already in zend_compile_return but not yet in
zend_compile_yield.
Closes GH-14716.