Skip to content

Commit 3fc0d7d

Browse files
committed
Merge tag 'php-8.1.23' into was-8.1.x
Tag for php-8.1.23
2 parents 24dbf3a + aa98dbe commit 3fc0d7d

File tree

84 files changed

+2039
-487
lines changed

Some content is hidden

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

84 files changed

+2039
-487
lines changed

.cirrus.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ env:
44
freebsd_task:
55
name: FREEBSD_DEBUG_NTS
66
freebsd_instance:
7-
image_family: freebsd-13-0
7+
image_family: freebsd-13-2
88
env:
99
ARCH: amd64
1010
install_script:
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Setup
2+
runs:
3+
using: composite
4+
steps:
5+
- name: Setup MySQL
6+
shell: pwsh
7+
run: |
8+
choco install mysql -y --no-progress --params="/port:3306"
9+
mysql.exe --port=3306 --user=root --password="" -e "ALTER USER 'root'@'localhost' IDENTIFIED BY 'Password12!'; FLUSH PRIVILEGES;"
10+
- name: Setup MSSQL
11+
shell: pwsh
12+
run: |
13+
choco install sql-server-express -y --no-progress --install-arguments="/SECURITYMODE=SQL /SAPWD=Password12!"
14+
- name: Setup PostgreSQL
15+
shell: pwsh
16+
run: |
17+
Set-Service -Name "postgresql-x64-14" -StartupType manual -Status Running
18+
pwsh -Command { $env:PGPASSWORD="root"; & "$env:PGBIN\psql" -U postgres -c "ALTER USER postgres WITH PASSWORD 'Password12!';" }

.github/nightly_matrix.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,25 @@ function get_matrix_include(array $branches) {
7878
return $jobs;
7979
}
8080

81+
function get_windows_matrix_include(array $branches) {
82+
$jobs = [];
83+
foreach ($branches as $branch) {
84+
$jobs[] = [
85+
'branch' => $branch,
86+
'x64' => true,
87+
'zts' => true,
88+
'opcache' => true,
89+
];
90+
$jobs[] = [
91+
'branch' => $branch,
92+
'x64' => false,
93+
'zts' => false,
94+
'opcache' => false,
95+
];
96+
}
97+
return $jobs;
98+
}
99+
81100
$trigger = $argv[1] ?? 'schedule';
82101
$attempt = (int) ($argv[2] ?? 1);
83102
$discard_cache = ($trigger === 'schedule' && $attempt !== 1) || $trigger === 'workflow_dispatch';
@@ -87,6 +106,8 @@ function get_matrix_include(array $branches) {
87106

88107
$branches = get_branches();
89108
$matrix_include = get_matrix_include($branches);
109+
$windows_matrix_include = get_windows_matrix_include($branches);
90110

91111
echo '::set-output name=branches::' . json_encode($branches, JSON_UNESCAPED_SLASHES) . "\n";
92112
echo '::set-output name=matrix-include::' . json_encode($matrix_include, JSON_UNESCAPED_SLASHES) . "\n";
113+
echo '::set-output name=windows-matrix-include::' . json_encode($windows_matrix_include, JSON_UNESCAPED_SLASHES) . "\n";

.github/workflows/nightly.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ jobs:
1111
outputs:
1212
branches: ${{ steps.set-matrix.outputs.branches }}
1313
matrix-include: ${{ steps.set-matrix.outputs.matrix-include }}
14+
windows-matrix-include: ${{ steps.set-matrix.outputs.windows-matrix-include }}
1415
steps:
1516
- uses: actions/checkout@v3
1617
with:
@@ -645,3 +646,36 @@ jobs:
645646
uses: ./.github/actions/notify-slack
646647
with:
647648
token: ${{ secrets.ACTION_MONITORING_SLACK }}
649+
WINDOWS:
650+
needs: GENERATE_MATRIX
651+
if: ${{ needs.GENERATE_MATRIX.outputs.branches != '[]' }}
652+
strategy:
653+
fail-fast: false
654+
matrix:
655+
include: ${{ fromJson(needs.GENERATE_MATRIX.outputs.windows-matrix-include) }}
656+
name: "${{ matrix.branch.name }}_WINDOWS_${{ matrix.x64 && 'X64' || 'X86' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}"
657+
runs-on: windows-2019
658+
env:
659+
PHP_BUILD_CACHE_BASE_DIR: C:\build-cache
660+
PHP_BUILD_OBJ_DIR: C:\obj
661+
PHP_BUILD_CACHE_SDK_DIR: C:\build-cache\sdk
662+
PHP_BUILD_SDK_BRANCH: php-sdk-2.2.0
663+
PHP_BUILD_CRT: vs16
664+
PLATFORM: ${{ matrix.x64 && 'x64' || 'x86' }}
665+
THREAD_SAFE: "${{ matrix.zts && '1' || '0' }}"
666+
INTRINSICS: "${{ matrix.zts && 'AVX2' || '' }}"
667+
PARALLEL: -j2
668+
OPCACHE: "${{ matrix.opcache && '1' || '0' }}"
669+
steps:
670+
- name: git config
671+
run: git config --global core.autocrlf false && git config --global core.eol lf
672+
- name: git checkout
673+
uses: actions/checkout@v3
674+
with:
675+
ref: ${{ matrix.branch.ref }}
676+
- name: Setup
677+
uses: ./.github/actions/setup-windows
678+
- name: Build
679+
run: .github/scripts/windows/build.bat
680+
- name: Test
681+
run: .github/scripts/windows/test.bat

.github/workflows/push.yml

Lines changed: 7 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -77,52 +77,6 @@ jobs:
7777
-d opcache.jit_buffer_size=16M
7878
- name: Verify generated files are up to date
7979
uses: ./.github/actions/verify-generated-files
80-
LINUX_X32:
81-
name: LINUX_X32_DEBUG_ZTS
82-
runs-on: ubuntu-latest
83-
container:
84-
image: ubuntu:20.04
85-
env:
86-
MYSQL_TEST_HOST: mysql
87-
PDO_MYSQL_TEST_DSN: mysql:host=mysql;dbname=test
88-
PDO_MYSQL_TEST_HOST: mysql
89-
services:
90-
mysql:
91-
image: mysql:8
92-
ports:
93-
- 3306:3306
94-
env:
95-
MYSQL_DATABASE: test
96-
MYSQL_ROOT_PASSWORD: root
97-
steps:
98-
- name: git checkout
99-
uses: actions/checkout@v3
100-
- name: apt
101-
uses: ./.github/actions/apt-x32
102-
- name: ccache
103-
uses: hendrikmuhs/[email protected]
104-
with:
105-
key: "${{github.job}}-${{hashFiles('main/php_version.h')}}"
106-
append-timestamp: false
107-
- name: ./configure
108-
uses: ./.github/actions/configure-x32
109-
with:
110-
configurationParameters: >-
111-
--enable-debug
112-
--enable-zts
113-
- name: make
114-
run: make -j$(/usr/bin/nproc) >/dev/null
115-
- name: make install
116-
uses: ./.github/actions/install-linux-x32
117-
- name: Test
118-
uses: ./.github/actions/test-linux
119-
- name: Test Tracing JIT
120-
uses: ./.github/actions/test-linux
121-
with:
122-
runTestsParameters: >-
123-
-d zend_extension=opcache.so
124-
-d opcache.enable_cli=1
125-
-d opcache.jit_buffer_size=16M
12680
MACOS_DEBUG_NTS:
12781
runs-on: macos-11
12882
steps:
@@ -145,8 +99,6 @@ jobs:
14599
make -j$(sysctl -n hw.logicalcpu) >/dev/null
146100
- name: make install
147101
run: sudo make install
148-
- name: Test
149-
uses: ./.github/actions/test-macos
150102
- name: Test Tracing JIT
151103
uses: ./.github/actions/test-macos
152104
with:
@@ -158,45 +110,26 @@ jobs:
158110
- name: Verify generated files are up to date
159111
uses: ./.github/actions/verify-generated-files
160112
WINDOWS:
161-
strategy:
162-
fail-fast: false
163-
matrix:
164-
include:
165-
- x64: true
166-
zts: false
167-
opcache: true
168-
- x64: false
169-
zts: true
170-
opcache: false
171-
name: "WINDOWS_${{ matrix.x64 && 'X64' || 'X86' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}"
113+
name: WINDOWS_X64_ZTS
172114
runs-on: windows-2019
173115
env:
174116
PHP_BUILD_CACHE_BASE_DIR: C:\build-cache
175117
PHP_BUILD_OBJ_DIR: C:\obj
176118
PHP_BUILD_CACHE_SDK_DIR: C:\build-cache\sdk
177119
PHP_BUILD_SDK_BRANCH: php-sdk-2.2.0
178120
PHP_BUILD_CRT: vs16
179-
PLATFORM: ${{ matrix.x64 && 'x64' || 'x86' }}
180-
THREAD_SAFE: "${{ matrix.zts && '1' || '0' }}"
181-
INTRINSICS: "${{ matrix.zts && 'AVX2' || '' }}"
121+
PLATFORM: x64
122+
THREAD_SAFE: "1"
123+
INTRINSICS: AVX2
182124
PARALLEL: -j2
183-
OPCACHE: "${{ matrix.opcache && '1' || '0' }}"
125+
OPCACHE: "1"
184126
steps:
185127
- name: git config
186128
run: git config --global core.autocrlf false && git config --global core.eol lf
187129
- name: git checkout
188130
uses: actions/checkout@v3
189-
- name: Setup MySQL
190-
run: |
191-
choco install mysql -y --no-progress --params="/port:3306"
192-
mysql.exe --port=3306 --user=root --password="" -e "ALTER USER 'root'@'localhost' IDENTIFIED BY 'Password12!'; FLUSH PRIVILEGES;"
193-
- name: Setup MSSQL
194-
run: |
195-
choco install sql-server-express -y --no-progress --install-arguments="/SECURITYMODE=SQL /SAPWD=Password12!"
196-
- name: Setup PostgreSQL
197-
run: |
198-
Set-Service -Name "postgresql-x64-14" -StartupType manual -Status Running
199-
pwsh -Command { $env:PGPASSWORD="root"; & "$env:PGBIN\psql" -U postgres -c "ALTER USER postgres WITH PASSWORD 'Password12!';" }
131+
- name: Setup
132+
uses: ./.github/actions/setup-windows
200133
- name: Build
201134
run: .github/scripts/windows/build.bat
202135
- name: Test

NEWS

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,69 @@
11
PHP NEWS
22
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
3+
31 Aug 2023, PHP 8.1.23
4+
5+
- CLI:
6+
. Fixed bug GH-11716 (cli server crashes on SIGINT when compiled with
7+
ZEND_RC_DEBUG=1). (nielsdos)
8+
. Fixed bug GH-10964 (Improve man page about the built-in server).
9+
(Alexandre Daubois)
10+
11+
- Core:
12+
. Fixed strerror_r detection at configuration time. (Kévin Dunglas)
13+
14+
- Date:
15+
. Fixed bug GH-11416: Crash with DatePeriod when uninitialised objects
16+
are passed in. (Derick)
17+
18+
- DOM:
19+
. Fix DOMEntity field getter bugs. (nielsdos)
20+
. Fix incorrect attribute existence check in DOMElement::setAttributeNodeNS.
21+
(nielsdos)
22+
. Fix DOMCharacterData::replaceWith() with itself. (nielsdos)
23+
. Fix empty argument cases for DOMParentNode methods. (nielsdos)
24+
. Fixed bug GH-11791 (Wrong default value of DOMDocument::xmlStandalone).
25+
(nielsdos)
26+
. Fix json_encode result on DOMDocument. (nielsdos)
27+
. Fix manually calling __construct() on DOM classes. (nielsdos)
28+
. Fixed bug GH-11830 (ParentNode methods should perform their checks
29+
upfront). (nielsdos)
30+
. Fix segfault when DOMParentNode::prepend() is called when the child
31+
disappears. (nielsdos)
32+
33+
- FFI:
34+
. Fix leaking definitions when using FFI::cdef()->new(...). (ilutov)
35+
36+
- MySQLnd:
37+
. Fixed bug GH-11440 (authentication to a sha256_password account fails over
38+
SSL). (nielsdos)
39+
. Fixed bug GH-11438 (mysqlnd fails to authenticate with sha256_password
40+
accounts using passwords longer than 19 characters).
41+
(nielsdos, Kamil Tekiela)
42+
. Fixed bug GH-11550 (MySQL Statement has a empty query result when
43+
the response field has changed, also Segmentation fault).
44+
(Yurunsoft)
45+
. Fixed invalid error message "Malformed packet" when connection is dropped.
46+
(Kamil Tekiela)
47+
48+
- Opcache:
49+
. Fixed bug GH-11715 (opcache.interned_strings_buffer either has no effect or
50+
opcache_get_status() / phpinfo() is wrong). (nielsdos)
51+
. Avoid adding an unnecessary read-lock when loading script from shm if
52+
restart is in progress. (mikhainin)
53+
54+
- PCNTL:
55+
. Revert behaviour of receiving SIGCHLD signals back to the behaviour
56+
before 8.1.22. (nielsdos)
57+
58+
- SPL:
59+
. Fixed bug #81992 (SplFixedArray::setSize() causes use-after-free).
60+
(nielsdos)
61+
62+
- Standard:
63+
. Prevent int overflow on $decimals in number_format. (Marc Bennewitz)
64+
. Fixed bug GH-11870 (Fix off-by-one bug when truncating tempnam prefix)
65+
(athos-ribeiro)
66+
367
03 Aug 2023, PHP 8.1.22
468

569
- Build:

Zend/Optimizer/block_pass.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,11 @@ static void zend_optimize_block(zend_basic_block *block, zend_op_array *op_array
174174
&& opline->opcode != ZEND_MATCH
175175
&& zend_optimizer_update_op1_const(op_array, opline, &c)) {
176176
VAR_SOURCE(op1) = NULL;
177-
literal_dtor(&ZEND_OP1_LITERAL(src));
178-
MAKE_NOP(src);
177+
if (opline->opcode != ZEND_JMP_NULL
178+
&& !zend_bitset_in(used_ext, VAR_NUM(src->result.var))) {
179+
literal_dtor(&ZEND_OP1_LITERAL(src));
180+
MAKE_NOP(src);
181+
}
179182
++(*opt_count);
180183
} else {
181184
zval_ptr_dtor_nogc(&c);
@@ -197,8 +200,10 @@ static void zend_optimize_block(zend_basic_block *block, zend_op_array *op_array
197200
ZVAL_COPY(&c, &ZEND_OP1_LITERAL(src));
198201
if (zend_optimizer_update_op2_const(op_array, opline, &c)) {
199202
VAR_SOURCE(op2) = NULL;
200-
literal_dtor(&ZEND_OP1_LITERAL(src));
201-
MAKE_NOP(src);
203+
if (!zend_bitset_in(used_ext, VAR_NUM(src->result.var))) {
204+
literal_dtor(&ZEND_OP1_LITERAL(src));
205+
MAKE_NOP(src);
206+
}
202207
++(*opt_count);
203208
} else {
204209
zval_ptr_dtor_nogc(&c);

Zend/zend.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1649,9 +1649,15 @@ ZEND_API ZEND_COLD ZEND_NORETURN void zend_error_noreturn(int type, const char *
16491649

16501650
ZEND_API ZEND_COLD ZEND_NORETURN void zend_strerror_noreturn(int type, int errn, const char *message)
16511651
{
1652-
#ifdef HAVE_STR_ERROR_R
1653-
char buf[1024];
1654-
strerror_r(errn, buf, sizeof(buf));
1652+
#ifdef HAVE_STRERROR_R
1653+
char b[1024];
1654+
1655+
# ifdef STRERROR_R_CHAR_P
1656+
char *buf = strerror_r(errn, b, sizeof(b));
1657+
# else
1658+
strerror_r(errn, b, sizeof(b));
1659+
char *buf = b;
1660+
# endif
16551661
#else
16561662
char *buf = strerror(errn);
16571663
#endif

Zend/zend.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#ifndef ZEND_H
2121
#define ZEND_H
2222

23-
#define ZEND_VERSION "4.1.22"
23+
#define ZEND_VERSION "4.1.23"
2424

2525
#define ZEND_ENGINE_3
2626

Zend/zend_alloc.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2416,6 +2416,13 @@ ZEND_API bool is_zend_ptr(const void *ptr)
24162416
{
24172417
#if ZEND_MM_CUSTOM
24182418
if (AG(mm_heap)->use_custom_heap) {
2419+
if (AG(mm_heap)->custom_heap.std._malloc == tracked_malloc) {
2420+
zend_ulong h = ((uintptr_t) ptr) >> ZEND_MM_ALIGNMENT_LOG2;
2421+
zval *size_zv = zend_hash_index_find(AG(mm_heap)->tracked_allocs, h);
2422+
if (size_zv) {
2423+
return 1;
2424+
}
2425+
}
24192426
return 0;
24202427
}
24212428
#endif

0 commit comments

Comments
 (0)