Skip to content

Commit c9b6451

Browse files
committed
Merge tag 'php-8.2.21' into was-8.2.x
Tag for php-8.2.21
2 parents 1ad4a92 + 482ca6c commit c9b6451

File tree

78 files changed

+1231
-225
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+1231
-225
lines changed

.github/CODEOWNERS

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -38,25 +38,24 @@
3838
/ext/xsl @nielsdos
3939
/main @bukka
4040
/sapi/fpm @bukka
41-
/Zend @iluuu1994
42-
/Zend/Optimizer @dstogov
41+
/Zend/Optimizer @dstogov @iluuu1994
4342
/Zend/zend.* @dstogov
4443
/Zend/zend_alloc.* @dstogov
45-
/Zend/zend_API.* @dstogov
44+
/Zend/zend_API.* @dstogov @iluuu1994
4645
/Zend/zend_call_stack.* @arnaud-lb
4746
/Zend/zend_closures.* @dstogov
48-
/Zend/zend_execute.* @dstogov
49-
/Zend/zend_execute_API.c @dstogov
47+
/Zend/zend_execute.* @dstogov @iluuu1994
48+
/Zend/zend_execute_API.c @dstogov @iluuu1994
5049
/Zend/zend_gc.* @dstogov @arnaud-lb
5150
/Zend/zend_hash.* @dstogov
52-
/Zend/zend_inheritance.* @dstogov
51+
/Zend/zend_inheritance.* @dstogov @iluuu1994
5352
/Zend/zend_max_execution_timer.* @arnaud-lb
54-
/Zend/zend_object_handlers.* @dstogov
55-
/Zend/zend_objects.* @dstogov
56-
/Zend/zend_objects_API.* @dstogov
57-
/Zend/zend_opcode.* @dstogov
53+
/Zend/zend_object_handlers.* @dstogov @iluuu1994
54+
/Zend/zend_objects.* @dstogov @iluuu1994
55+
/Zend/zend_objects_API.* @dstogov @iluuu1994
56+
/Zend/zend_opcode.* @dstogov @iluuu1994
5857
/Zend/zend_string.* @dstogov
59-
/Zend/zend_type*.h @dstogov
58+
/Zend/zend_type*.h @dstogov @iluuu1994
6059
/Zend/zend_variables.* @dstogov
61-
/Zend/zend_vm* @dstogov
60+
/Zend/zend_vm* @dstogov @iluuu1994
6261
*.stub.php @kocsismate

.github/actions/test-linux/action.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
name: Test
22
inputs:
3-
testArtifacts:
4-
default: null
5-
required: false
63
runTestsParameters:
74
default: ''
85
required: false
@@ -35,7 +32,6 @@ runs:
3532
export PDO_OCI_TEST_PASS="pass"
3633
export PDO_OCI_TEST_DSN="oci:dbname=localhost/XEPDB1;charset=AL32UTF8"
3734
export SKIP_IO_CAPTURE_TESTS=1
38-
export TEST_PHP_JUNIT=junit.out.xml
3935
sapi/cli/php run-tests.php -P -q ${{ inputs.runTestsParameters }} \
4036
-d opcache.jit=${{ inputs.jitType }} \
4137
-d opcache.jit_buffer_size=16M \
@@ -46,9 +42,3 @@ runs:
4642
--show-diff \
4743
--show-slow 1000 \
4844
--set-timeout 120
49-
- uses: actions/upload-artifact@v4
50-
if: always() && inputs.testArtifacts != null
51-
with:
52-
name: ${{ github.job }}_${{ inputs.testArtifacts }}
53-
path: ${{ github.workspace }}/junit.out.xml
54-
retention-days: 5
Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
name: Test
22
inputs:
3-
testArtifacts:
4-
default: null
5-
required: false
63
runTestsParameters:
74
default: ''
85
required: false
@@ -17,7 +14,6 @@ runs:
1714
set -x
1815
export SKIP_IO_CAPTURE_TESTS=1
1916
export CI_NO_IPV6=1
20-
export TEST_PHP_JUNIT=junit.out.xml
2117
sapi/cli/php run-tests.php -P -q ${{ inputs.runTestsParameters }} \
2218
-d opcache.jit=${{ inputs.jitType }} \
2319
-d opcache.jit_buffer_size=16M \
@@ -28,9 +24,3 @@ runs:
2824
--show-diff \
2925
--show-slow 1000 \
3026
--set-timeout 120
31-
- uses: actions/upload-artifact@v4
32-
if: always() && inputs.testArtifacts != null
33-
with:
34-
name: ${{ github.job }}_${{ inputs.testArtifacts }}
35-
path: ${{ github.workspace }}/junit.out.xml
36-
retention-days: 5

.github/scripts/windows/test_task.bat

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,6 @@ set TEST_PHPDBG_EXECUTABLE=%PHP_BUILD_DIR%\phpdbg.exe
133133

134134
mkdir c:\tests_tmp
135135

136-
set TEST_PHP_JUNIT=c:\junit.out.xml
137-
138136
nmake test TESTS="%OPCACHE_OPTS% -g FAIL,BORK,LEAK,XLEAK --no-progress -q --offline --show-diff --show-slow 1000 --set-timeout 120 --temp-source c:\tests_tmp --temp-target c:\tests_tmp --bless %PARALLEL%"
139137

140138
set EXIT_CODE=%errorlevel%

.github/workflows/nightly.yml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -79,14 +79,12 @@ jobs:
7979
- name: Test
8080
uses: ./.github/actions/test-linux
8181
with:
82-
testArtifacts: ${{ matrix.branch.name }}_${{ matrix.name }}_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}
8382
runTestsParameters: >-
8483
${{ matrix.run_tests_parameters }}
8584
idleCpu: ${{ matrix.asan && 'true' || 'false' }}
8685
- name: Test Tracing JIT
8786
uses: ./.github/actions/test-linux
8887
with:
89-
testArtifacts: ${{ matrix.branch.name }}_${{ matrix.name }}_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }} Tracing JIT
9088
jitType: tracing
9189
runTestsParameters: >-
9290
${{ matrix.run_tests_parameters }}
@@ -95,7 +93,6 @@ jobs:
9593
- name: Test OpCache
9694
uses: ./.github/actions/test-linux
9795
with:
98-
testArtifacts: ${{ matrix.branch.name }}_${{ matrix.name }}_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }} OpCache
9996
runTestsParameters: >-
10097
${{ matrix.run_tests_parameters }}
10198
-d zend_extension=opcache.so
@@ -106,7 +103,6 @@ jobs:
106103
if: matrix.test_function_jit
107104
uses: ./.github/actions/test-linux
108105
with:
109-
testArtifacts: ${{ matrix.branch.name }}_${{ matrix.name }}_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }} Function JIT
110106
jitType: function
111107
runTestsParameters: >-
112108
${{ matrix.run_tests_parameters }}
@@ -226,12 +222,9 @@ jobs:
226222
run: sudo make install
227223
- name: Test
228224
uses: ./.github/actions/test-macos
229-
with:
230-
testArtifacts: ${{ matrix.branch.name }}_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}
231225
- name: Test Tracing JIT
232226
uses: ./.github/actions/test-macos
233227
with:
234-
testArtifacts: ${{ matrix.branch.name }}_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }} Tracing JIT
235228
jitType: tracing
236229
runTestsParameters: >-
237230
-d zend_extension=opcache.so
@@ -240,15 +233,13 @@ jobs:
240233
- name: Test OpCache
241234
uses: ./.github/actions/test-macos
242235
with:
243-
testArtifacts: ${{ matrix.branch.name }}_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }} OpCache
244236
runTestsParameters: >-
245237
-d zend_extension=opcache.so
246238
-d opcache.enable_cli=1
247239
-d opcache.protect_memory=1
248240
- name: Test Function JIT
249241
uses: ./.github/actions/test-macos
250242
with:
251-
testArtifacts: ${{ matrix.branch.name }}_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }} Function JIT
252243
jitType: function
253244
runTestsParameters: >-
254245
-d zend_extension=opcache.so

.github/workflows/push.yml

Lines changed: 44 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,18 +87,59 @@ jobs:
8787
uses: ./.github/actions/setup-x64
8888
- name: Test
8989
uses: ./.github/actions/test-linux
90-
with:
91-
testArtifacts: ${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}
9290
- name: Test Tracing JIT
9391
uses: ./.github/actions/test-linux
9492
with:
95-
testArtifacts: ${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }} Tracing JIT
9693
jitType: tracing
9794
runTestsParameters: >-
9895
-d zend_extension=opcache.so
9996
-d opcache.enable_cli=1
10097
- name: Verify generated files are up to date
10198
uses: ./.github/actions/verify-generated-files
99+
LINUX_X32:
100+
name: LINUX_X32_DEBUG_ZTS
101+
runs-on: ubuntu-latest
102+
container:
103+
image: ubuntu:20.04
104+
env:
105+
MYSQL_TEST_HOST: mysql
106+
PDO_MYSQL_TEST_DSN: mysql:host=mysql;dbname=test
107+
PDO_MYSQL_TEST_HOST: mysql
108+
services:
109+
mysql:
110+
image: mysql:8.3
111+
ports:
112+
- 3306:3306
113+
env:
114+
MYSQL_DATABASE: test
115+
MYSQL_ROOT_PASSWORD: root
116+
steps:
117+
- name: git checkout
118+
uses: actions/checkout@v3
119+
- name: apt
120+
uses: ./.github/actions/apt-x32
121+
- name: ccache
122+
uses: hendrikmuhs/[email protected]
123+
with:
124+
key: "${{github.job}}-${{hashFiles('main/php_version.h')}}"
125+
append-timestamp: false
126+
- name: ./configure
127+
uses: ./.github/actions/configure-x32
128+
with:
129+
configurationParameters: >-
130+
--enable-debug
131+
--enable-zts
132+
- name: make
133+
run: make -j$(/usr/bin/nproc) >/dev/null
134+
- name: make install
135+
uses: ./.github/actions/install-linux-x32
136+
- name: Test Tracing JIT
137+
uses: ./.github/actions/test-linux
138+
with:
139+
jitType: tracing
140+
runTestsParameters: >-
141+
-d zend_extension=opcache.so
142+
-d opcache.enable_cli=1
102143
MACOS_DEBUG_NTS:
103144
if: github.repository == 'php/php-src' || github.event_name == 'pull_request'
104145
runs-on: macos-12
@@ -126,7 +167,6 @@ jobs:
126167
- name: Test Tracing JIT
127168
uses: ./.github/actions/test-macos
128169
with:
129-
testArtifacts: ${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }} Tracing JIT
130170
jitType: tracing
131171
runTestsParameters: >-
132172
-d zend_extension=opcache.so

NEWS

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,81 @@
11
PHP NEWS
22
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
3+
04 Jul 2024, PHP 8.2.21
4+
5+
- Core:
6+
. Fixed bug GH-14315 (Incompatible pointer type warnings). (Peter Kokot)
7+
. Fixed bug GH-12814 (max_execution_time reached too early on MacOS 14
8+
when running on Apple Silicon). (Manuel Kress)
9+
. Fixed bug GH-14387 (Crash when stack walking in destructor of yielded from
10+
values during Generator->throw()). (Bob)
11+
. Fixed bug GH-14456 (Attempting to initialize class with private constructor
12+
calls destructor). (Girgias)
13+
. Fixed bug GH-14549 (Incompatible function pointer type for fclose).
14+
(Ryan Carsten Schmidt)
15+
16+
- BCMatch:
17+
. Fixed bug (bcpowmod() with mod = -1 returns 1 when it must be 0). (Girgias)
18+
19+
- Curl:
20+
. Fixed bug GH-14307 (Test curl_basic_024 fails with curl 8.8.0). (nielsdos)
21+
22+
- DOM:
23+
. Fixed bug GH-14343 (Memory leak in xml and dom). (nielsdos)
24+
25+
- FPM:
26+
. Fixed bug GH-14037 (PHP-FPM ping.path and ping.response config vars are
27+
ignored in status pool). (Wilhansen Li, Pierrick Charron)
28+
29+
- GD:
30+
. Fix parameter numbers for imagecolorset(). (Giovanni Giacobbi)
31+
32+
- Intl:
33+
. Fix reference handling in SpoofChecker. (nielsdos)
34+
35+
- MySQLnd:
36+
. Partially fix bug GH-10599 (Apache crash on Windows when using a
37+
self-referencing anonymous function inside a class with an active
38+
mysqli connection). (nielsdos)
39+
40+
- Opcache:
41+
. Fixed bug GH-14267 (opcache.jit=off does not allow enabling JIT at runtime).
42+
(ilutov)
43+
. Fixed TLS access in JIT on FreeBSD/amd64. (Arnaud)
44+
. Fixed bug GH-11188 (Error when building TSRM in ARM64). (nielsdos)
45+
46+
- PDO ODBC:
47+
. Fixed bug GH-14367 (incompatible SDWORD type with iODBC). (Calvin Buckley)
48+
49+
- PHPDBG:
50+
. Fixed bug GH-13681 (segfault on watchpoint addition failure). (David Carlier)
51+
52+
- Soap:
53+
. Fixed bug #47925 (PHPClient can't decompress response). (nielsdos)
54+
. Fix missing error restore code. (nielsdos)
55+
. Fix memory leak if calling SoapServer::setObject() twice. (nielsdos)
56+
. Fix memory leak if calling SoapServer::setClass() twice. (nielsdos)
57+
. Fix reading zlib ini settings in ext-soap. (nielsdos)
58+
. Fix memory leaks with string function name lookups. (nielsdos)
59+
. Fixed bug #69280 (SoapClient classmap doesn't support fully qualified class
60+
name). (nielsdos)
61+
. Fixed bug #76232 (SoapClient Cookie Header Semicolon). (nielsdos)
62+
. Fixed memory leaks when calling SoapFault::__construct() twice. (Girgias)
63+
64+
- Sodium:
65+
. Fix memory leaks in ext/sodium on failure of some functions. (nielsdos)
66+
67+
- SPL:
68+
. Fixed bug GH-14290 (Member access within null pointer in extension spl).
69+
(nielsdos)
70+
71+
- Standard:
72+
. Fixed bug GH-14483 (Fixed off-by-one error in checking length of abstract
73+
namespace Unix sockets). (Derick)
74+
75+
- Streams:
76+
. Fixed bug GH-11078 (PHP Fatal error triggers pointer being freed was not
77+
allocated and malloc: double free for ptr errors). (nielsdos)
78+
379
06 Jun 2024, PHP 8.2.20
480

581
- CGI:

TSRM/TSRM.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -777,11 +777,20 @@ TSRM_API size_t tsrm_get_ls_cache_tcb_offset(void)
777777
asm("adrp %0, #__tsrm_ls_cache@TLVPPAGE\n\t"
778778
"ldr %0, [%0, #__tsrm_ls_cache@TLVPPAGEOFF]"
779779
: "=r" (ret));
780-
# else
780+
# elif defined(TSRM_TLS_MODEL_DEFAULT)
781+
/* Surplus Static TLS space isn't guaranteed. */
782+
ret = 0;
783+
# elif defined(TSRM_TLS_MODEL_INITIAL_EXEC)
784+
asm("adrp %0, :gottprel:_tsrm_ls_cache\n\t"
785+
"ldr %0, [%0, #:gottprel_lo12:_tsrm_ls_cache]"
786+
: "=r" (ret));
787+
# elif defined(TSRM_TLS_MODEL_LOCAL_EXEC)
781788
asm("mov %0, xzr\n\t"
782789
"add %0, %0, #:tprel_hi12:_tsrm_ls_cache, lsl #12\n\t"
783790
"add %0, %0, #:tprel_lo12_nc:_tsrm_ls_cache"
784791
: "=r" (ret));
792+
# else
793+
# error "TSRM TLS model not set"
785794
# endif
786795
return ret;
787796
#else

TSRM/TSRM.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,10 +150,13 @@ TSRM_API const char *tsrm_api_name(void);
150150

151151
#if !__has_attribute(tls_model) || defined(__FreeBSD__) || defined(__MUSL__) || defined(__HAIKU__)
152152
# define TSRM_TLS_MODEL_ATTR
153+
# define TSRM_TLS_MODEL_DEFAULT
153154
#elif __PIC__
154155
# define TSRM_TLS_MODEL_ATTR __attribute__((tls_model("initial-exec")))
156+
# define TSRM_TLS_MODEL_INITIAL_EXEC
155157
#else
156158
# define TSRM_TLS_MODEL_ATTR __attribute__((tls_model("local-exec")))
159+
# define TSRM_TLS_MODEL_LOCAL_EXEC
157160
#endif
158161

159162
#define TSRM_SHUFFLE_RSRC_ID(rsrc_id) ((rsrc_id)+1)

Zend/tests/generators/gh14387.phpt

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
--TEST--
2+
GH-14387 (Crash when stack walking in destructor of yielded from values during Generator->throw())
3+
--FILE--
4+
<?php
5+
6+
function prime(Generator $generator) {
7+
$generator->valid();
8+
}
9+
10+
$g = (function () {
11+
yield from [null, new class {
12+
function __destruct() {
13+
// Trigger a stack walk, hitting a bad frame.
14+
throw new Exception;
15+
}
16+
}];
17+
})();
18+
19+
prime($g);
20+
21+
$g->throw(new Error);
22+
23+
?>
24+
--EXPECTF--
25+
Fatal error: Uncaught Error in %s:%d
26+
Stack trace:
27+
#0 {main}
28+
29+
Next Exception in %s:%d
30+
Stack trace:
31+
#0 %s(%d): class@anonymous->__destruct()
32+
#1 [internal function]: {%s}()
33+
#2 %s(%d): Generator->throw(Object(Error))
34+
#3 {main}
35+
thrown in %s on line %d

0 commit comments

Comments
 (0)