diff --git a/build/Makefile.gcov b/build/Makefile.gcov index 13985a93a101e..5097bfaaa2774 100644 --- a/build/Makefile.gcov +++ b/build/Makefile.gcov @@ -16,23 +16,6 @@ LCOV_EXCLUDES = \ '$(top_srcdir)/parse_date.re' \ '$(top_srcdir)/parse_iso_intervals.re' -GCOVR_EXCLUDES = \ - 'ext/bcmath/libbcmath/.*' \ - 'ext/date/lib/.*' \ - 'ext/fileinfo/libmagic/.*' \ - 'ext/gd/libgd/.*' \ - 'ext/hash/sha3/.*' \ - 'ext/lexbor/lexbor/.*' \ - 'ext/mbstring/libmbfl/.*' \ - 'ext/opcache/jit/ir/.*' \ - 'ext/pcre/pcre2lib/.*' \ - 'ext/uri/uriparser/.*' - -# These patterns have implicit ^/$ anchors. -GCOVR_EXCLUDE_LINES_BY_PATTERNS = \ - '.*\b(ZEND_PARSE_PARAMETERS_(START|END|NONE)|Z_PARAM_).*' \ - '\s*(default:\s*)?ZEND_UNREACHABLE\(\);\s*' - lcov: lcov-html php_lcov.info: @@ -56,15 +39,11 @@ gcovr-html: @echo "Generating gcovr HTML" @rm -rf gcovr_html/ @mkdir gcovr_html - gcovr -sr . -o gcovr_html/index.html --html --html-details --exclude-unreachable-branches --exclude-throw-branches \ - $(foreach pattern, $(GCOVR_EXCLUDE_LINES_BY_PATTERNS), --exclude-lines-by-pattern $(pattern)) \ - $(foreach lib, $(GCOVR_EXCLUDES), -e $(lib)) + gcovr -r . -o gcovr_html/index.html --html --html-details gcovr-xml: @echo "Generating gcovr XML" @rm -f gcovr.xml - gcovr -sr . -o gcovr.xml --xml --exclude-unreachable-branches --exclude-throw-branches \ - $(foreach pattern, $(GCOVR_EXCLUDE_LINES_BY_PATTERNS), --exclude-lines-by-pattern $(pattern)) \ - $(foreach lib, $(GCOVR_EXCLUDES), -e $(lib)) + gcovr -r . -o gcovr.xml --xml .PHONY: gcovr-html lcov-html php_lcov.info diff --git a/ext/curl/config.w32 b/ext/curl/config.w32 index a4bdce59ccb1f..c3a55652b6382 100644 --- a/ext/curl/config.w32 +++ b/ext/curl/config.w32 @@ -12,7 +12,10 @@ if (PHP_CURL != "no") { SETUP_ZLIB_LIB("curl", PHP_CURL) && (CHECK_LIB("normaliz.lib", "curl", PHP_CURL) && CHECK_LIB("libssh2.lib", "curl", PHP_CURL) && - CHECK_LIB("nghttp2.lib", "curl", PHP_CURL)) + CHECK_LIB("nghttp2.lib", "curl", PHP_CURL) && + CHECK_LIB("brotlidec.lib", "curl", PHP_CURL) && + CHECK_LIB("brotlicommon.lib", "curl", PHP_CURL) && + CHECK_LIB("libzstd.lib", "curl", PHP_CURL)) ) { EXTENSION("curl", "interface.c multi.c share.c curl_file.c"); AC_DEFINE('HAVE_CURL', 1, "Define to 1 if the PHP extension 'curl' is available."); diff --git a/ext/curl/tests/check_win_config.phpt b/ext/curl/tests/check_win_config.phpt index fc29e37281970..56ebe36312ec0 100644 --- a/ext/curl/tests/check_win_config.phpt +++ b/ext/curl/tests/check_win_config.phpt @@ -47,11 +47,11 @@ UNIX_SOCKETS => %r(Yes|No)%r PSL => No HTTPS_PROXY => Yes MULTI_SSL => %s -BROTLI => %s +BROTLI => Yes ALTSVC => Yes HTTP3 => No UNICODE => No -ZSTD => No +ZSTD => Yes HSTS => Yes GSASL => No Protocols => dict, file, ftp, ftps, gopher, %r(gophers, )?%rhttp, https, imap, imaps, ldap, ldaps, %r(mqtt, )?%rpop3, pop3s, rtsp, scp, sftp, smb, smbs, smtp, smtps, telnet, tftp%r(, ws)?(, wss)?%r diff --git a/ext/standard/type.c b/ext/standard/type.c index a228e899046f9..e23e4620da23b 100644 --- a/ext/standard/type.c +++ b/ext/standard/type.c @@ -105,7 +105,7 @@ PHP_FUNCTION(settype) convert_to_long(ptr); } else if (zend_string_equals_ci(type, ZSTR_KNOWN(ZEND_STR_FLOAT))) { convert_to_double(ptr); - } else if (zend_string_equals_ci(type, ZSTR_KNOWN(ZEND_STR_DOUBLE))) { /* deprecated */ + } else if (zend_string_equals_ci(type, ZSTR_KNOWN(ZEND_STR_DOUBLE))) { convert_to_double(ptr); } else if (zend_string_equals_ci(type, ZSTR_KNOWN(ZEND_STR_STRING))) { convert_to_string(ptr); diff --git a/ext/xmlreader/php_xmlreader.c b/ext/xmlreader/php_xmlreader.c index 27de3a2902850..da337fd6dabb1 100644 --- a/ext/xmlreader/php_xmlreader.c +++ b/ext/xmlreader/php_xmlreader.c @@ -755,7 +755,7 @@ PHP_METHOD(XMLReader, moveToAttributeNo) } /* }}} */ -/* {{{ Positions reader at attribute spcified by name and namespaceURI. +/* {{{ Positions reader at attribute specified by name and namespaceURI. Returns TRUE on success and FALSE on failure */ PHP_METHOD(XMLReader, moveToAttributeNs) { diff --git a/ext/xmlreader/tests/expand.phpt b/ext/xmlreader/tests/expand.phpt index 9d4545d168972..5244121f6502b 100644 --- a/ext/xmlreader/tests/expand.phpt +++ b/ext/xmlreader/tests/expand.phpt @@ -1,5 +1,5 @@ --TEST-- -XMLReader: Expand into existing DOM documet +XMLReader: Expand into existing DOM document --EXTENSIONS-- xmlreader dom diff --git a/ext/xmlwriter/php_xmlwriter.c b/ext/xmlwriter/php_xmlwriter.c index 0c65305c6827d..8d343aadf2637 100644 --- a/ext/xmlwriter/php_xmlwriter.c +++ b/ext/xmlwriter/php_xmlwriter.c @@ -432,7 +432,7 @@ PHP_FUNCTION(xmlwriter_write_element) } /* }}} */ -/* {{{ Write full namesapced element tag - returns FALSE on error */ +/* {{{ Write full namespaced element tag - returns FALSE on error */ PHP_FUNCTION(xmlwriter_write_element_ns) { xmlTextWriterPtr ptr; diff --git a/ext/xmlwriter/tests/bug39504.phpt b/ext/xmlwriter/tests/bug39504.phpt index 0cb509d37dd5b..eafcd375da93e 100644 --- a/ext/xmlwriter/tests/bug39504.phpt +++ b/ext/xmlwriter/tests/bug39504.phpt @@ -1,5 +1,5 @@ --TEST-- -Bug #39504 (xmlwriter_write_dtd_entity() creates Attlist tag, not enity) +Bug #39504 (xmlwriter_write_dtd_entity() creates Attlist tag, not entity) --EXTENSIONS-- xmlwriter --FILE-- diff --git a/ext/zend_test/observer.c b/ext/zend_test/observer.c index 85c7d82da0e84..e348987359b91 100644 --- a/ext/zend_test/observer.c +++ b/ext/zend_test/observer.c @@ -334,7 +334,8 @@ static ZEND_INI_MH(zend_test_observer_OnUpdateCommaList) } if (stage != PHP_INI_STAGE_STARTUP && stage != PHP_INI_STAGE_ACTIVATE && stage != PHP_INI_STAGE_DEACTIVATE && stage != PHP_INI_STAGE_SHUTDOWN) { ZEND_HASH_FOREACH_STR_KEY(*p, funcname) { - if ((func = zend_hash_find_ptr(EG(function_table), funcname))) { + if ((func = zend_hash_find_ptr(EG(function_table), funcname)) + && RUN_TIME_CACHE(&func->common)) { void *old_handler; zend_observer_remove_begin_handler(func, observer_begin, (zend_observer_fcall_begin_handler *)&old_handler); zend_observer_remove_end_handler(func, observer_end, (zend_observer_fcall_end_handler *)&old_handler); @@ -357,7 +358,11 @@ static ZEND_INI_MH(zend_test_observer_OnUpdateCommaList) zend_string_release(str); if (stage != PHP_INI_STAGE_STARTUP && stage != PHP_INI_STAGE_ACTIVATE && stage != PHP_INI_STAGE_DEACTIVATE && stage != PHP_INI_STAGE_SHUTDOWN) { ZEND_HASH_FOREACH_STR_KEY(*p, funcname) { - if ((func = zend_hash_find_ptr(EG(function_table), funcname))) { + if ((func = zend_hash_find_ptr(EG(function_table), funcname)) + && RUN_TIME_CACHE(&func->common) && *ZEND_OBSERVER_DATA(func)) { + void *old_handler; + zend_observer_remove_begin_handler(func, observer_begin, (zend_observer_fcall_begin_handler *)&old_handler); + zend_observer_remove_end_handler(func, observer_end, (zend_observer_fcall_end_handler *)&old_handler); zend_observer_add_begin_handler(func, observer_begin); zend_observer_add_end_handler(func, observer_end); } diff --git a/ext/zend_test/tests/gh16811.phpt b/ext/zend_test/tests/gh16811.phpt new file mode 100644 index 0000000000000..1b2b8ece9aa1a --- /dev/null +++ b/ext/zend_test/tests/gh16811.phpt @@ -0,0 +1,18 @@ +--TEST-- +GH-16811 (Segmentation fault in zend observer) +--EXTENSIONS-- +zend_test +--INI-- +zend_test.observer.enabled=1 +zend_test.observer.show_output=1 +zend_test.observer.observe_function_names=a,d +--FILE-- + +--EXPECTF-- + + + +string(3) "a,d" diff --git a/ext/zend_test/tests/gh16811_observe_all.phpt b/ext/zend_test/tests/gh16811_observe_all.phpt new file mode 100644 index 0000000000000..466aa0c6d4a4f --- /dev/null +++ b/ext/zend_test/tests/gh16811_observe_all.phpt @@ -0,0 +1,17 @@ +--TEST-- +GH-16811 (Assertion failure adding duplicate observer handler) +--EXTENSIONS-- +zend_test +--INI-- +zend_test.observer.enabled=1 +zend_test.observer.observe_all=1 +zend_test.observer.show_output=0 +--FILE-- + +--EXPECT-- +Done diff --git a/gcovr.cfg b/gcovr.cfg new file mode 100644 index 0000000000000..a8267cd6e0003 --- /dev/null +++ b/gcovr.cfg @@ -0,0 +1,19 @@ +print-summary = yes + +exclude-throw-branches = yes +exclude-unreachable-branches = yes + +exclude = ext/bcmath/libbcmath/.* +exclude = ext/date/lib/.* +exclude = ext/fileinfo/libmagic/.* +exclude = ext/gd/libgd/.* +exclude = ext/hash/sha3/.* +exclude = ext/lexbor/lexbor/.* +exclude = ext/mbstring/libmbfl/.* +exclude = ext/opcache/jit/ir/.* +exclude = ext/pcre/pcre2lib/.* +exclude = ext/uri/uriparser/.* + +# These patterns have implicit ^/$ anchors. +exclude-lines-by-pattern = .*\b(ZEND_PARSE_PARAMETERS_(START|END|NONE)|Z_PARAM_).* +exclude-lines-by-pattern = \s*(default:\s*)?ZEND_UNREACHABLE\(\);\s*