Commit Graph

14953 Commits

Author SHA1 Message Date
David Carlier
d65c80031a Fix GH-12190: stream_context_create with address and port at 0.
Prior to the 8.1 rewrite, inet_aton was used for ipv4 addresses
therefore addresses like `0` passed.
For the bindto's case where both ip and port are set as such, we discard
the address binding.

Close GH-12195
2023-09-24 15:17:53 +01:00
Thomas Hurst
66a33dbdce Fix GH-12273 - configure __builtin_cpu_init() check
__builtin_cpu_init() is documented as having a void return type.  It happens to
return int on gcc, but is void on clang.

Close GH-122274
2023-09-24 08:08:08 +01:00
David Carlier
5df291e835 Merge branch 'PHP-8.1' into PHP-8.2 2023-09-24 08:04:30 +01:00
Thomas Hurst
d93800ec0f Fix GH-12273 - configure __builtin_cpu_init() check
__builtin_cpu_init() is documented as having a void return type.  It happens to
return int on gcc, but is void on clang.

Close GH-122274
2023-09-24 08:04:02 +01:00
David Carlier
d9e72bcdab Merge branch 'PHP-8.2' into PHP-8.3 2023-09-23 20:12:56 +01:00
David Carlier
36f78862c8 Merge branch 'PHP-8.1' into PHP-8.2 2023-09-23 20:12:41 +01:00
David Carlier
a80db7b52a Fix GH-12282: IntlDateFormatter::construct should throw an exception is the locale field has an invalid value.
Close GH-12282
2023-09-23 20:12:13 +01:00
Niels Dossche
5d68d61943 Implement #53655: Improve speed of DOMNode::C14N() on large XML documents
The XPath query is in accordance to spec [1]. However, we can do it in a
simpler way. We can use a custom callback function instead of a linear
search in XPath to check if a node is visible. Note that comment nodes
are handled internally by libxml2 already, so we do not need to
differentiate between node types. The callback will do an upwards
traversal of the tree until the root of the canonicalization is reached.
In practice this will speed up the application a lot.

[1] https://www.w3.org/TR/2001/REC-xml-c14n-20010315 section 2.1

Closes GH-12278.
2023-09-23 20:56:16 +02:00
Tim Düsterhus
3d857d5b81
round(): Validate the rounding mode (#12252) 2023-09-22 17:32:09 +02:00
David Carlier
f6fae19a10 ext/intl: expose dateformat UDAT_PATTERN constant.
Close GH-12258
2023-09-22 12:32:22 +01:00
Niels Dossche
5b62df1d85 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  [ci skip] NEWS
2023-09-21 20:04:24 +02:00
Niels Dossche
ca5f9e812a [ci skip] NEWS
Remove redundant whitespace
2023-09-21 20:03:59 +02:00
Niels Dossche
2bbe4fda75 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix memory leak when calling xml_parse_into_struct() twice
  Fix return type of stub of xml_parse_into_struct()
2023-09-21 19:52:21 +02:00
Niels Dossche
2aea9be3ea Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix memory leak when calling xml_parse_into_struct() twice
  Fix return type of stub of xml_parse_into_struct()
2023-09-21 19:51:14 +02:00
Niels Dossche
30f26b587a Fix memory leak when calling xml_parse_into_struct() twice
Closes GH-12254.
2023-09-21 19:49:46 +02:00
Niels Dossche
b1d9a8d321 Fix return type of stub of xml_parse_into_struct()
Closes GH-12253.
2023-09-21 19:48:40 +02:00
David Carlier
35a502f168 Merge branch 'PHP-8.2' into PHP-8.3 2023-09-21 05:35:48 +01:00
David Carlier
63150dc2b1 Merge branch 'PHP-8.1' into PHP-8.2 2023-09-21 05:35:04 +01:00
David Carlier
84c4336aa3 Fix GH-12243, segfault on IntlDateFormatter::construct with dateType set to UDAT_PATTERN but not timeType.
udat_open expects its timeStyle's argument to be set to UDAT_PATTERN
 when dateStyle is, regardless if there an actual pattern or not.

Close GH-12245
2023-09-21 05:34:49 +01:00
Niels Dossche
b08802d160 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-12215: Module entry being overwritten causes type errors in ext/dom (<= PHP 8.3)
  Fix bug #55098: SimpleXML iteration produces infinite loop
2023-09-20 20:59:22 +02:00
Niels Dossche
84fae4a160 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix GH-12215: Module entry being overwritten causes type errors in ext/dom (<= PHP 8.3)
  Fix bug #55098: SimpleXML iteration produces infinite loop
2023-09-20 20:58:08 +02:00
Niels Dossche
da6097ffc8 Fix GH-12215: Module entry being overwritten causes type errors in ext/dom (<= PHP 8.3)
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 error 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.

Closes GH-12219.
2023-09-20 20:57:04 +02:00
Niels Dossche
1a4e401bf0 Fix bug #55098: SimpleXML iteration produces infinite loop
Closes GH-12247.
2023-09-20 20:54:53 +02:00
Tim Düsterhus
9652889b43
Reimplement php_round_helper() using modf() (#12220)
This change makes the implementation much easier to understand, by explicitly
handling the various cases.

It fixes rounding for `0.49999999999999994`, because no loss of precision
happens by adding / subtracing `0.5` before turning the result into an integral
float. Instead the fractional parts are explicitly compared.

see GH-12143 (this fixes one of the reported cases)
Closes GH-12159 which was an alternative attempt to fix the rounding issue for
`0.49999999999999994`
2023-09-19 18:05:05 +02:00
Niels Dossche
15bbae7bc9 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix GH-11956: PCRE regular expressions with JIT enabled gives different result
2023-09-18 20:13:45 +02:00
Niels Dossche
d61efdfe97 Fix GH-11956: PCRE regular expressions with JIT enabled gives different result
The code in the attached test used to work correctly in PHP 8.0, but not
in 8.1+. This is because PHP 8.1+ uses a more modern version of pcre2
than PHP 8.0, and that pcre2 versions has a regression.

While upgrading pcre2lib seems to be only done for the master branch, it
is possible to backport upstream fixes to stable branches. This has been
already done in the past in for JIT regressions [1], so it is not
unprecedented.

We backport the upstream pcre2 fix [2].

[1] https://github.com/php/php-src/commit/788a701e222
[2] https://github.com/PCRE2Project/pcre2/pull/135

Closes GH-12108.
2023-09-18 20:11:56 +02:00
David Carlier
639bcb4078 Merge branch 'PHP-8.2' into PHP-8.3 2023-09-18 17:46:28 +01:00
David Carlier
c39d4481c5 Merge branch 'PHP-8.1' into PHP-8.2 2023-09-18 17:46:11 +01:00
Florian Sowade
910f579f14 Fix GH-12207 memory leak of doc blocks of static properties
When declaring the same static property with a doc block in a class and in a trait,
the doc block of the property in the class is leaked. While at it, possibly fix doc
 comment for internal classes.

Close GH-12238
2023-09-18 17:44:47 +01:00
George Peter Banyard
0b614a6c2b
Fixed oss-fuzz #62294: Unsetting variable after ++/-- on string variable warning
Closes GH-12202
2023-09-17 15:49:46 +01:00
Niels Dossche
673babed24 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-12208: SimpleXML infinite loop when a cast is used inside a foreach
2023-09-17 16:35:11 +02:00
Niels Dossche
f4f34b6e5a Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix GH-12208: SimpleXML infinite loop when a cast is used inside a foreach
2023-09-17 16:34:38 +02:00
Niels Dossche
486276f0f9 Fix GH-12208: SimpleXML infinite loop when a cast is used inside a foreach
Closes GH-12229.
2023-09-17 16:33:32 +02:00
Niels Dossche
4bb27e2d9b Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-12223: Entity reference produces infinite loop in var_dump/print_r
  Fix GH-12192: SimpleXML infinite loop when getName() is called within foreach
  Fix GH-12186: segfault copying/cloning a finalized HashContext
2023-09-16 21:28:24 +02:00
Niels Dossche
5df473d2c7 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix GH-12223: Entity reference produces infinite loop in var_dump/print_r
  Fix GH-12192: SimpleXML infinite loop when getName() is called within foreach
  Fix GH-12186: segfault copying/cloning a finalized HashContext
2023-09-16 21:24:20 +02:00
Niels Dossche
39a9e561f9 Fix GH-12223: Entity reference produces infinite loop in var_dump/print_r
Closes GH-12223.
2023-09-16 21:19:58 +02:00
Niels Dossche
4d888cf53f Fix GH-12192: SimpleXML infinite loop when getName() is called within foreach
This happens because getName() resets the iterator to the start because
it overwrites the iterator data.
We add a version of get_first_node that does not overwrite the iterator
data.

Closes GH-12193.
2023-09-16 21:19:28 +02:00
Max Semenik
10f5a06d3c Fix GH-12186: segfault copying/cloning a finalized HashContext
Closes GH-12186.
Closes GH-12187.
2023-09-16 21:18:27 +02:00
Tim Düsterhus
d344fe06a2
Fix #[Override] on traits overriding a parent method without a matching interface (#12205)
Fixes GH-12189

Co-authored-by: Ilija Tovilo <ilija.tovilo@me.com>
2023-09-15 14:57:10 +02:00
Niels Dossche
60b1673b20 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-12170: Can't use xpath with comments in SimpleXML
2023-09-14 18:44:39 +02:00
Niels Dossche
b3bce2328f Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix GH-12170: Can't use xpath with comments in SimpleXML
2023-09-14 18:42:47 +02:00
Niels Dossche
747335f100 Fix GH-12170: Can't use xpath with comments in SimpleXML
Closes GH-12177.
2023-09-14 18:42:16 +02:00
Tim Düsterhus
b2d244a444
Show the integer size in phpinfo() (#12201)
Resolves GH-12188
2023-09-14 14:42:10 +02:00
Ilija Tovilo
b15e9b5779
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  [skip ci] Fix NEWS entry
2023-09-14 13:17:46 +02:00
Ilija Tovilo
f6a038d16a
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  [skip ci] Fix NEWS entry
2023-09-14 13:17:26 +02:00
Ilija Tovilo
d0b76d7bdc
[skip ci] Fix NEWS entry 2023-09-14 13:16:43 +02:00
Ilija Tovilo
b169725757
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix filter_var with callback and explicit REQUIRE_SCALAR
2023-09-14 11:49:44 +02:00
Ilija Tovilo
85ceb91789
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix filter_var with callback and explicit REQUIRE_SCALAR
2023-09-14 11:49:10 +02:00
Ilija Tovilo
c2fb10d2d2
Fix filter_var with callback and explicit REQUIRE_SCALAR
For some reason, FILTER_CALLBACK disables the FILTER_REQUIRE_SCALAR flag that is
normally set by default. While surprising, this is not something we can change.

However, even specifying FILTER_REQUIRE_SCALAR explicitly does not corrently set
this flag. This is because FILTER_CALLBACK zeroes the flags after they have been
populated from the parameters.

We reverse the checks to make explicitly specifying the flag behave as expected.

Closes GH-12203
2023-09-14 11:48:40 +02:00
Ben Ramsey
c1cf0026e5
PHP-8.1 is now for PHP 8.1.25-dev 2023-09-12 16:21:51 -05:00
Sergey Panteleev
5c1f746716
PHP-8.2 is now for PHP 8.2.12-dev 2023-09-12 14:53:56 +03:00
Eric Mann
1fa3b4cd91
Update NEWS for start of RC3 2023-09-12 04:42:02 -07:00
Graham Campbell
58b8393cce
Removed incorrect news items for things already in 8.3.x or earlier
Closes GH-12160
2023-09-11 11:53:01 +02:00
Niels Dossche
2440af0f97 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix #52751: XPath processing-instruction() function is not supported.
2023-09-11 00:13:25 +02:00
Niels Dossche
d1ef22585f Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix #52751: XPath processing-instruction() function is not supported.
2023-09-11 00:12:16 +02:00
Niels Dossche
107443b311 Fix #52751: XPath processing-instruction() function is not supported.
Closes GH-12165.
2023-09-11 00:08:29 +02:00
Máté Kocsis
45c7e3b06b
Fix #12123 Make _ZEND_TYPE_PREFIX apply only for MSVC
Closes GH-12136
2023-09-10 22:40:50 +02:00
Niels Dossche
cb6fac5b8a Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-11878: SQLite3 callback functions cause a memory leak with a callable array
2023-09-09 15:35:03 +02:00
Niels Dossche
6851c7b867 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix GH-11878: SQLite3 callback functions cause a memory leak with a callable array
2023-09-09 15:34:38 +02:00
Niels Dossche
07a9d2fb32 Fix GH-11878: SQLite3 callback functions cause a memory leak with a callable array
In this test file, the free_obj handler is called with a refcount of 2,
caused by the fact we do a GC_ADDREF() to increase its refcount while
its refcount is still 1 because the Foo object hasn't been destroyed yet
(due to the cycle caused by the sqlite function callback).
Solve this by introducing a get_gc handler.

Closes GH-11881.
2023-09-09 15:33:50 +02:00
David Carlier
aef5225394 zend_call_stack_get implementation for NetBSD.
Despite being OpenBSD's predecessor, the approach is in fact
a lot closer to Linux, at least in principle. We purposely
avoid reading /proc/N/maps to be more future-proof.

Close GH-11637
2023-09-09 13:48:40 +01:00
Niels Dossche
880faa39e8
Add DOMNode::compareDocumentPosition() (#12146)
Reference: https://dom.spec.whatwg.org/#dom-node-comparedocumentposition
2023-09-09 01:14:26 +02:00
Niels Dossche
c4e8f652c5 Update bundled pcre2 to 10.42
Closes GH-12109.
2023-09-08 17:14:39 +02:00
George Peter Banyard
d68073c23b
streams: Checking if a stream is castable should not emit warnings for user defined streams
Closes GH-10435
2023-09-08 13:22:43 +01:00
Jakub Zelenka
64ebadcac5
Fix GH-12151: str_getcsv ending with escape zero segfualt
Closes GH-12152
2023-09-08 10:58:55 +01:00
Ilija Tovilo
c803402162
Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix zend_separate_if_call_and_write for FUNC_ARGs
2023-09-07 14:26:31 +02:00
Ilija Tovilo
c2bb9bc0df
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix zend_separate_if_call_and_write for FUNC_ARGs
2023-09-07 14:26:09 +02:00
Ilija Tovilo
fa9cef8b47
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix zend_separate_if_call_and_write for FUNC_ARGs
2023-09-07 14:25:43 +02:00
Ilija Tovilo
748adf18fc
Fix zend_separate_if_call_and_write for FUNC_ARGs
Fixes GH-12102
Closees GH-12140
2023-09-07 14:25:11 +02:00
George Peter Banyard
e2667f17bc Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  ODBC unit tests shouldn't override odbc.ini location
  Fix persistent procedural ODBC connections not getting closed
2023-09-06 01:58:11 +01:00
George Peter Banyard
88ed678935 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  ODBC unit tests shouldn't override odbc.ini location
  Fix persistent procedural ODBC connections not getting closed
2023-09-06 01:57:28 +01:00
Calvin Buckley
5a2b251610 Fix persistent procedural ODBC connections not getting closed
Like oci8, procedural ODBC uses an apply function on the hash list to
enumerate persistent connections and close the specific one. However,
this function take zvals, not resources. However, it was getting casted
as such, causing it to interpret the pointer incorrectly. This could
have caused other issues, but mostly manifested as failing to close the
connection even fi it matched.

The function now takes a zval and gets the resource from that. In
addition, it also removes the cast of the function pointer and moves
casting to the function body, to avoid possible confusion like this in
refactors again. It also cleans up style and uses constants in the
function body.

Closes GH-12132

Signed-off-by: George Peter Banyard <girgias@php.net>
2023-09-06 01:55:02 +01:00
George Peter Banyard
8a392eddf9 Fix OSS Fuzz #61865: Undef variable in ++/-- for declared property that is unset in error handler
Reorder when we assign the property value to NULL which is identical to
a3a3964497

Just for the declared property case instead of dynamic.

Closes GH-12114
2023-09-05 10:40:02 +01:00
George Peter Banyard
d7273c5963 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Prevents double call to internal iterator rewind handler
  adds failing test case for #12060
2023-09-05 10:36:16 +01:00
George Peter Banyard
c672a06954 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Prevents double call to internal iterator rewind handler
  adds failing test case for #12060
2023-09-05 10:27:33 +01:00
ju1ius
da7a66d647 Prevents double call to internal iterator rewind handler
Closes GH-12060

Signed-off-by: George Peter Banyard <girgias@php.net>
2023-09-05 10:26:19 +01:00
Ilija Tovilo
3f38105740
Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix freeing of incompletely initialized closures
2023-09-04 15:40:07 +02:00
Ilija Tovilo
baf74ed1a4
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix freeing of incompletely initialized closures
2023-09-04 15:39:39 +02:00
Ilija Tovilo
6850a040f3
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix freeing of incompletely initialized closures
2023-09-04 15:39:20 +02:00
Ilija Tovilo
af2110e664
Fix freeing of incompletely initialized closures
Addref to relevant fields before allocating any memory. Also only set/remove the
ZEND_ACC_HEAP_RT_CACHE flag after allocating memory.

Fixes GH-12073
Closes GH-12074
2023-09-04 15:35:39 +02:00
George Peter Banyard
b17958e7be Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fixed bug GH-12020: intl_get_error_message() broken after MessageFormatter::formatMessage() fails
2023-09-03 01:04:59 +01:00
George Peter Banyard
fa0953f49d Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fixed bug GH-12020: intl_get_error_message() broken after MessageFormatter::formatMessage() fails
2023-09-03 01:04:06 +01:00
George Peter Banyard
a579fa807c Fixed bug GH-12020: intl_get_error_message() broken after MessageFormatter::formatMessage() fails
Passing NULL as the pointer to intl_error* will use the global error stack.
This is what we need to do instead of pushing it onto the temporary format object that is released.
2023-09-03 01:02:46 +01:00
George Peter Banyard
508e70ac3c Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix memory leak with failed SQLPrepare
2023-09-02 23:03:04 +01:00
George Peter Banyard
30b550bad5 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix memory leak with failed SQLPrepare
2023-09-02 23:01:08 +01:00
Calvin Buckley
a022ec53bd Fix memory leak with failed SQLPrepare
Closes GH-12095

Signed-off-by: George Peter Banyard <girgias@php.net>
2023-09-02 23:00:06 +01:00
Niels Dossche
1cdcbc05b0 Fix GH-11972: RecursiveCallbackFilterIterator regression in 8.1.18
When you do an assignment between two zvals (no, not zval*), you copy
all fields. This includes the additional u2 data. So that means for
example the Z_NEXT index gets copied, which in some cases can therefore
cause a cycle in zend_hash lookups.
Instead of doing an assignment, we should be doing a ZVAL_COPY (or
ZVAL_COPY_VALUE for non-refcounting cases). This avoids copying u2.

Closes GH-12086.
2023-08-30 22:30:59 +02:00
Niels Dossche
dc72ceda90 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-11972: RecursiveCallbackFilterIterator regression in 8.1.18
2023-08-30 22:27:06 +02:00
Niels Dossche
262a22740c Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix GH-11972: RecursiveCallbackFilterIterator regression in 8.1.18
2023-08-30 22:26:36 +02:00
George Peter Banyard
9b28e521d1 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-11876: ini_parse_quantity() accepts invalid quantities
2023-08-30 21:23:10 +01:00
George Peter Banyard
d229a480ad Fix GH-11876: ini_parse_quantity() accepts invalid quantities
Closes GH-11910
2023-08-30 21:22:13 +01:00
Niels Dossche
ffd7018fcd Fix GH-11972: RecursiveCallbackFilterIterator regression in 8.1.18
When you do an assignment between two zvals (no, not zval*), you copy
all fields. This includes the additional u2 data. So that means for
example the Z_NEXT index gets copied, which in some cases can therefore
cause a cycle in zend_hash lookups.
Instead of doing an assignment, we should be doing a ZVAL_COPY (or
ZVAL_COPY_VALUE for non-refcounting cases). This avoids copying u2.

Closes GH-12086.
2023-08-30 22:18:33 +02:00
Jakub Zelenka
760367dd70
Remove incorrectly updated dtrace change from NEWS 2023-08-30 14:30:47 +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
46929ea92f
Merge branch 'PHP-8.3' 2023-08-30 13:41:42 +01:00
Filip Zrůst
02b3fb1f6b
Remove CPP when invoking dtrace utility
We are experiencing an issue when building PHP with DTrace enabled with
SystemTap (see GH-11847).† The issue is caused by inappropriate use C
preprocessor detected by GNU Autoconf in our “configure” script. C
preprocessor configuration found by AC_PROG_CPP macro is portable only
to run on files with “.c” extension.‡ However, statically-defined tracing
is described by D programs with “.d” extension which causes the issue.
We experience this even on typical Linux distribution with GNU Compiler
Collection (GCC) unless we override the defaults detected by our
“configure” script.

Many major Linux distributions use SystemTap to provide “dtrace”
utility. It relies on both external C preprocessor and external C
compiler. C preprocessor can be customized via CPP environment variable.
Similarly, C compiler can be customized via CC environment variable. It
also allows customization of C compiler flags via CFLAGS environment
variable. We have recently aligned both CPP and CC environment variable
with C preprocessor and C compiler we use to build regular C source code
as provided by our “configure” script (see GH-11643).* We wanted to
allow cross-compilation on Linux for which this was the only blocker. C
compiler flags from CFLAGS_CLEAN macro have already been in place since
versions 5.4.20 and 5.5.4 from 2013-09-18.

We had modified all “dtrace” invocations in the same way to make it look
consistent. However, only the C compiler (CC environment variable) is
necessary to for cross-compilation. There have never been any reported
issue with the C preprocessor. We acknowledge it would be great to allow
C preprocessor customization as well. However, the implementation would
require a lot of effort to do correctly given the limitations of
AC_PROG_CPP macro from GNU Autoconf. This would be further complicated
by the fact that all DTrace implementations, not just SystemTap, allow C
preprocessor customization but Oracle DTrace, Open DTrace, and their
forks do it differently. Nevertheless, they all default to “cpp” utility
and they all have or had been working fine. Therefore, we believe simply
removing CPP stabilizes “dtrace” invocation on Linux systems with
SystemTap and aligns it with other system configurations on other
platforms, until someone comes with complete solution with custom “m4”
and “make” macros, while our build system on Linux with SystemTap
supports cross-compilation.

Fixes GH-11847
Closes GH-12083

† https://github.com/php/php-src/issues/11847https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.71/autoconf.html#index-AC_005fPROG_005fCPP-1
* https://github.com/php/php-src/issues/11643
2023-08-30 13:40:21 +01:00
Jakub Zelenka
7deb84b7a6
Start PHP 8.4 development cycle 2023-08-29 17:19:01 +01:00
Jakub Zelenka
1371ce9539
Update NEWS for start of RC2 2023-08-29 17:14:11 +01:00
Niels Dossche
0b9702c9ed Implement GH-11934: Allow to pass CData into struct and/or union fields
Co-authored-by: KapitanOczywisty <44417092+KapitanOczywisty@users.noreply.github.com>

Closes GH-11935.
2023-08-29 17:01:10 +02:00
Niels Dossche
a3a3964497 Fix oss-fuzz #61712: assertion failure with error handler during binary op
Because the error handler is invoked after the property is updated,
the error handler has the opportunity to remove it before the property
is returned.

Switching the order around fixes this issue. The comments mention that
the current ordering prevents overwriting the EG(std_property_info)
field in the error handler. EG(std_property_info) no longer exists as it
was removed in 7471c217. Back then a global was used to store the
returned property info, but as this is no longer the case there is no
longer a need to protect against overwriting a global.

Closes GH-12062.
2023-08-28 20:00:49 +02:00