When the JIT defers the IS_UNDEF check for FETCH_OBJ_R to the result
type guard, the deoptimization escape path dispatches to opline->handler
via the trace_escape stub. If opline->handler has been overwritten with
JIT code (e.g. a function entry trace), this creates an infinite loop.
Fix by dispatching to the original VM handler (orig_handler from the
trace extension) instead of going through the trace_escape stub. This
avoids the extra IS_UNDEF guard on every property read while correctly
handling the rare IS_UNDEF case during deoptimization.
Also set current_op_array in zend_jit_trace_exit_to_vm so that the
blacklisted exit deoptimizer can resolve orig_handler, covering the
case where side trace compilation is exhausted.
Closes GH-21368.
When stream_socket_server() fails during bind(), we're currently only showing
"Unknown error" in the error message. Properly propagate this error for better
diagnostics.
Closes GH-21328
* Fix ReflectionMethod::invoke() crash with internal closures
The closure identity check added in GH-21366 accessed op_array.opcodes
unconditionally, but internal closures (e.g. var_dump(...)) use
internal_function, not op_array. This caused undefined behavior when
comparing closures created via first-class callable syntax on internal
functions.
Check the function type first: compare op_array.opcodes for user
closures, compare the function pointer directly for internal closures.
* Fix internal closure comparison and expand test coverage
The previous comparison (orig_func == given_func) could never match for
internal closures since zend_get_closure_method_def() returns a pointer
to each closure's embedded copy. Compare function_name and scope instead.
Also handle the mixed user/internal type case explicitly.
Add tests for: userland first-class callables, cloned internal closures,
and cross-type (user vs internal) closure rejection.
* php_reflection: Simplify the Closure::__invoke() check
---------
Co-authored-by: Tim Düsterhus <tim@bastelstu.be>
Fixes to GH-14078:
* Rename ZipArchive::openBuffer() to ::openString().
* For consistency with ::open(), return int|bool, don't throw an
exception on error. Provide error information via existing properties
and accessors.
* Fix memory leak when ::openString() is called but ::close() is not
called. Add test.
* Fix memory leak when a call to ::open() is followed by a call to
::openString(). Add test.
* Let libzip own the source, don't call zip_source_keep().
* Share buffer handling with ZipArchive::addFromString().
Elsewhere:
* If there is an error from zip_close() during a call to
ZipArchive::open(), emit a warning but proceed to open the archive,
don't return early. Add test.
* When buffers are saved by ZipArchive::addFromString(), release them
in ZipArchive::close() and ::open(), don't accumulate buffers until
the free_obj handler is called.
* Factor out buffer handling and reuse it in ZipArchive::openString()
Closes GH-21205.
Closes GH-14078.
Co-authored-by: Soner Sayakci <s.sayakci@shopware.com>
Co-authored-by: Ghaith Olabi <24876890+Gaitholabi@users.noreply.github.com>
The guards reference undefined VE_PG_LO64, a misspelling of
HAVE_PG_LO64 (removed in GH-14628), making the 64-bit code paths
permanently dead. Remove the guards to unconditionally enable the
64-bit variants for PostgreSQL >= 9.3, consistent with pg_lo_seek().
Dropped from GH-21386 as not suitable for backport.
close GH-21437
openssl_pkey_new() checks private_key_bits >= 384 before generating any
key. For EC, X25519, ED25519, X448, and ED448 the size is inherent to
the curve or algorithm, so this check doesn't apply and causes failures
when default_bits is missing from openssl.cnf (which is the case in
OpenSSL 3.6's default config).
Skip the minimum-bits check for key types that don't use private_key_bits.
Closes GH-21387.