Commit graph

6108 commits

Author SHA1 Message Date
Levi Morrison
7843ef7ad5
Merge branch 'PHP-8.3' 2023-11-21 18:33:14 -07:00
Levi Morrison
c524dc6565
test: allow other zend extensions to not fail the test 2023-11-21 18:32:50 -07:00
Peter Kokot
5c523edffe
Remove obsolete IRIX checks (#12737)
IRIX is a discontinued and closed-source OS with last release in 2006.
2023-11-21 02:56:53 +00:00
Dmitry Stogov
b46ed399c6 Fix php.ini (add missing "\n") 2023-11-20 11:59:47 +03:00
Niels Dossche
d882c5d580 Merge branch 'PHP-8.3'
* PHP-8.3:
  Use __DIR__-relative path in tests
  Fix GH-12675: MEMORY_LEAK in phpdbg_prompt.c
2023-11-15 22:01:05 +01:00
Niels Dossche
c83632a503 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Use __DIR__-relative path in tests
  Fix GH-12675: MEMORY_LEAK in phpdbg_prompt.c
2023-11-15 22:00:44 +01:00
Niels Dossche
4f1103ef3b Fix GH-12675: MEMORY_LEAK in phpdbg_prompt.c
Have to use file_put_contents() instead of --FILE-- because we have to
actually load it using the exec command, *and* have to make multiple
files, and note that we can only load files relative from the current
directory, so we can't rely on files being in the sapi/phpdbg/tests
folder.

Closes GH-12680.
2023-11-15 21:59:55 +01:00
Daniil Gentili
df286a1b98
Improve JIT config in fuzzer SAPI (#12519)
* Improve JIT config in fuzzer SAPI

* Fix

* Fix

* Update
2023-11-14 21:26:24 +03:00
David CARLIER
cc2bf11951
zend: introducing ZEND_ELEMENT_COUNT for struct's dynamic arrays. (#12650)
zend: introducing ZEND_ELEMENT_COUNT for struct's dynamic and flexible arrays.

It is mostly for ubsan and helping array bound checking.
2023-11-13 12:42:45 +00:00
Niels Dossche
299a234eb7 Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix GH-12621: browscap segmentation fault when configured in the vhost
2023-11-11 18:36:41 +01:00
Niels Dossche
1fb73463d3 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-12621: browscap segmentation fault when configured in the vhost
2023-11-11 18:36:32 +01:00
Niels Dossche
7353c7ce17 Fix GH-12621: browscap segmentation fault when configured in the vhost
The temporary HashTable has a destructor that releases the string held
by the entry's value. However, browscap_intern_str(_ci) only incremented
the refcount for the reference created by the return value. As the
HashTable is only used during parsing, we don't need to manage the
reference count of the value anyway, so get rid of the destructor.

This is triggerable in two cases:
 - When using php_admin_value to set the ini at the activation stage
 - When running out of space for the opcache-interned strings

Closes GH-12634.
2023-11-11 18:35:57 +01:00
Jakub Zelenka
311cae03e7
Merge branch 'PHP-8.3' 2023-11-10 09:46:25 +00:00
Jakub Zelenka
d02a8f4e87
Separate setting of SO_KEEPALIVE in FPM tests
Closes GH-12640
2023-11-10 09:45:19 +00:00
Peter Kokot
d0056d63da
[skip ci] Use GitHub issue tracker link for reporting bugs (#12612) 2023-11-06 12:45:12 +00:00
Jakub Zelenka
f288d9c4b0
Merge branch 'PHP-8.3' 2023-11-03 17:18:40 +00:00
Jakub Zelenka
52b13f6ddb
Merge branch 'PHP-8.2' into PHP-8.3 2023-11-03 17:17:52 +00:00
Jakub Zelenka
882cc4f804
Merge branch 'PHP-8.1' into PHP-8.2 2023-11-03 17:17:23 +00:00
Jakub Zelenka
a8c6c6165b
Fix GH-9921: Loading ext in FPM config does not register module handlers
Closes GH-12377
2023-11-03 16:53:09 +00:00
Jakub Zelenka
a66c926b68
Merge branch 'PHP-8.3' 2023-11-03 14:08:39 +00:00
Jakub Zelenka
e43438544e
Merge branch 'PHP-8.2' into PHP-8.3 2023-11-03 14:07:36 +00:00
Jakub Zelenka
e3d1beb0f1
Fix bug #76922: FastCGI terminates conn after FCGI_GET_VALUES
Closes GH-12387
2023-11-03 14:06:36 +00:00
Michael Voříšek
cc8c24ab8f
Fix unused variable in phpdbg_cmd.c (#12575) 2023-10-31 08:28:16 +01:00
Ilija Tovilo
f39b5c4c25
Close PHP tags in tests
Closes GH-12422
2023-10-18 17:34:10 +02:00
Jakub Zelenka
14404ac1fa
Merge branch 'PHP-8.3' 2023-10-14 18:45:31 +01:00
Jakub Zelenka
2913447653
Merge branch 'PHP-8.2' into PHP-8.3 2023-10-14 18:44:26 +01:00
Jakub Zelenka
c776f79578
Merge branch 'PHP-8.1' into PHP-8.2 2023-10-14 18:41:48 +01:00
Jakub Zelenka
0217be4d5b
Fix GH-12232: FPM: segfault dynamically loading extension without opcache
Also fixes incorrect assertion in ini init that php_dl is always
temporary.

Closes GH-12277
2023-10-14 18:38:21 +01:00
Niels Dossche
5cc6979210 Merge branch 'PHP-8.3'
* PHP-8.3:
  php_cli_server: ensure single date header is present
2023-10-06 17:54:03 +02:00
Niels Dossche
7c41509e26 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  php_cli_server: ensure single date header is present
2023-10-06 17:51:38 +02:00
Niels Dossche
a1845944ce Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  php_cli_server: ensure single date header is present
2023-10-06 17:50:13 +02:00
coppolafab
f6ac08c6a3 php_cli_server: ensure single date header is present
Currently the PHP Development Server appends a Date header in the
response, despite already set from user code.

Added a check condition before append the header, and a test file.

Closes GH-12363.
2023-10-06 17:49:30 +02:00
Niels Dossche
cb0d04e9f4 Merge branch 'PHP-8.3'
* PHP-8.3:
  Ignore optional warning output in test
2023-10-02 22:55:54 +02:00
Niels Dossche
af15ed94bf Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Ignore optional warning output in test
2023-10-02 22:55:44 +02:00
Niels Dossche
6aa20956fb Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Ignore optional warning output in test
2023-10-02 22:55:28 +02:00
Niels Dossche
6cf76d552e Ignore optional warning output in test
Due to the greedy behaviour of regex, we can't seem to use %A?
Use a for loop with a marker instead to ignore module startup warnings.
2023-10-02 22:53:39 +02:00
Niels Dossche
c24478fb12 Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix test under older CI configurations
2023-10-02 21:53:09 +02:00
Niels Dossche
98e2ff44bc Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix test under older CI configurations
2023-10-02 21:53:03 +02:00
Niels Dossche
87cd401aaf Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix test under older CI configurations
2023-10-02 21:52:52 +02:00
Niels Dossche
b140f6e9f8 Fix test under older CI configurations 2023-10-02 21:52:44 +02:00
Niels Dossche
e2c50f6bcb Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix #80092: ZTS + preload = segfault on shutdown
2023-10-02 19:42:45 +02:00
Niels Dossche
0427e26729 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix #80092: ZTS + preload = segfault on shutdown
2023-10-02 19:42:10 +02:00
Niels Dossche
28a909d40a Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix #80092: ZTS + preload = segfault on shutdown
2023-10-02 19:37:09 +02:00
Niels Dossche
bdc87b0f66 Fix #80092: ZTS + preload = segfault on shutdown
After preloading has executed, the executor globals for class_table and
function_table are still referring to the values during preloading.
If no request happens after that then these values will remain dangling
pointers. If then the -v option on CLI or -h option (and possibly
others) on CGI is provided, there is a double free.
Fix it by nulling the pointers explicitly after preloading has finished
to fix it for all SAPIs.

Closes GH-12311.
2023-10-02 19:33:41 +02:00
Niels Dossche
9b6afd88fb
Make sure core module has number 0 (#12272)
* Make sure core module has number 0

Some places, possibly also outside PHP, assume the core extension has
module number 0. After 8a812c3fda this wasn't the case anymore as
reported in [1]. Fix it by changing how the next module ID is computed.

[1] https://github.com/php/php-src/pull/12246#issuecomment-1731432377

* Add assertion

* Add test
2023-09-25 17:36:13 +02:00
Niels Dossche
8a812c3fda Fix GH-12215: Module entry being overwritten causes type errors in ext/dom (PHP 8.4)
When we try to load an extension multiple times, we still overwrite the
type, module number, and handle. If the module number is used to
indicate module boundaries (e.g. in reflection and in dom, see e.g.
dom_objects_set_class_ex), then all sorts of errors can happen.

In the case of ext/dom, OP's error happens because the following
happens:
- The property handler is set up incorrectly in
  dom_objects_set_class_ex() because the wrong module number is
  specified. The class highest in the hierarchy is DOMNode, so the
  property handler is incorrectly set to that of DOMNode instead of
  DOMDocument.
- The documentElement property doesn't exist on DOMNode, it only exists
  on DOMDocument, so it tries to read using zend_std_read_property().
  As there is no user property called documentElement, that read
  operation returns an undef value.
  However, the type is still checked, resulting in the strange exception.

Solve this by changing the API such that the data is only overwritten if
it's owned data.

Closes GH-12246.
2023-09-20 21:02:51 +02:00
Peter Kokot
186a07f044
Fix too many arguments in FPM ACL compile check (#12242)
The AC_COMPILE_IFELSE takes 3 arguments unlike AC_RUN_IFELSE which needs
the 4th argument for cross-compilation.
2023-09-19 18:52:34 +01:00
Christian Clauss
886bf820c9
[skip ci] Fix typos discovered by codespell (#12228) 2023-09-18 11:07:17 +01:00
Jakub Zelenka
fe30c5098f
Fix GH-12077: Check lsof functionality in socket on close test
Closes GH-12084
2023-08-30 14:28:17 +01:00
Jakub Zelenka
ea87501aee
Fix FPM UDS test for very long name check by extending its length
It did not correctly produce error message if run in in a short src path
2023-08-30 12:57:15 +01:00