Skip to content

Fix GH-12643: Stack limit tests failing on ppc64le #12779

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Zend/tests/stack_limit/stack_limit_001.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ array(4) {
["EG(stack_limit)"]=>
string(%d) "0x%x"
}
Maximum call stack size of %d bytes reached. Infinite recursion?
Maximum call stack size of %d bytes reached. Infinite recursion?
Maximum call stack size of %d bytes reached. Infinite recursion?
Maximum call stack size of %d bytes reached. Infinite recursion?
Maximum call stack size of %d bytes (zend.max_allowed_stack_size-zend.reserved_stack_size) reached. Infinite recursion?
Maximum call stack size of %d bytes (zend.max_allowed_stack_size-zend.reserved_stack_size) reached. Infinite recursion?
Maximum call stack size of %d bytes (zend.max_allowed_stack_size-zend.reserved_stack_size) reached. Infinite recursion?
Maximum call stack size of %d bytes (zend.max_allowed_stack_size-zend.reserved_stack_size) reached. Infinite recursion?
8 changes: 4 additions & 4 deletions Zend/tests/stack_limit/stack_limit_002.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ array(4) {
["EG(stack_limit)"]=>
string(%d) "0x%x"
}
Maximum call stack size of %d bytes reached. Infinite recursion?
Maximum call stack size of %d bytes reached. Infinite recursion?
Maximum call stack size of %d bytes reached. Infinite recursion?
Maximum call stack size of %d bytes reached. Infinite recursion?
Maximum call stack size of %d bytes (zend.max_allowed_stack_size-zend.reserved_stack_size) reached. Infinite recursion?
Maximum call stack size of %d bytes (zend.max_allowed_stack_size-zend.reserved_stack_size) reached. Infinite recursion?
Maximum call stack size of %d bytes (zend.max_allowed_stack_size-zend.reserved_stack_size) reached. Infinite recursion?
Maximum call stack size of %d bytes (zend.max_allowed_stack_size-zend.reserved_stack_size) reached. Infinite recursion?
8 changes: 4 additions & 4 deletions Zend/tests/stack_limit/stack_limit_003.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ if (!function_exists('zend_test_zend_call_stack_get')) die("skip zend_test_zend_
--EXTENSIONS--
zend_test
--INI--
zend.max_allowed_stack_size=128K
zend.max_allowed_stack_size=256K
--FILE--
<?php

Expand Down Expand Up @@ -61,6 +61,6 @@ array(4) {
["EG(stack_limit)"]=>
string(%d) "0x%x"
}
Maximum call stack size of %d bytes reached. Infinite recursion?
Maximum call stack size of %d bytes reached. Infinite recursion?
Maximum call stack size of %d bytes reached. Infinite recursion?
Maximum call stack size of %d bytes (zend.max_allowed_stack_size-zend.reserved_stack_size) reached. Infinite recursion?
Maximum call stack size of %d bytes (zend.max_allowed_stack_size-zend.reserved_stack_size) reached. Infinite recursion?
Maximum call stack size of %d bytes (zend.max_allowed_stack_size-zend.reserved_stack_size) reached. Infinite recursion?
2 changes: 1 addition & 1 deletion Zend/tests/stack_limit/stack_limit_005.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,4 @@ $test
;

--EXPECTF--
Fatal error: Maximum call stack size of %d bytes reached during compilation. Try splitting expression in %s on line %d
Fatal error: Maximum call stack size of %d bytes (zend.max_allowed_stack_size-zend.reserved_stack_size) reached during compilation. Try splitting expression in %s on line %d
6 changes: 3 additions & 3 deletions Zend/tests/stack_limit/stack_limit_006.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,6 @@ array(4) {
["EG(stack_limit)"]=>
string(%d) "0x%x"
}
Maximum call stack size of %d bytes reached. Infinite recursion?
Maximum call stack size of %d bytes reached. Infinite recursion?
Maximum call stack size of %d bytes reached. Infinite recursion?
Maximum call stack size of %d bytes (zend.max_allowed_stack_size-zend.reserved_stack_size) reached. Infinite recursion?
Maximum call stack size of %d bytes (zend.max_allowed_stack_size-zend.reserved_stack_size) reached. Infinite recursion?
Maximum call stack size of %d bytes (zend.max_allowed_stack_size-zend.reserved_stack_size) reached. Infinite recursion?
4 changes: 2 additions & 2 deletions Zend/tests/stack_limit/stack_limit_007.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ if (!function_exists('zend_test_zend_call_stack_get')) die("skip zend_test_zend_
--EXTENSIONS--
zend_test
--INI--
zend.max_allowed_stack_size=128K
zend.max_allowed_stack_size=256K
--FILE--
<?php

Expand Down Expand Up @@ -41,5 +41,5 @@ array(4) {
["EG(stack_limit)"]=>
string(%d) "0x%x"
}
Maximum call stack size of %d bytes reached. Infinite recursion?
Maximum call stack size of %d bytes (zend.max_allowed_stack_size-zend.reserved_stack_size) reached. Infinite recursion?
Try executed: 1
4 changes: 2 additions & 2 deletions Zend/tests/stack_limit/stack_limit_008.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ if (!function_exists('zend_test_zend_call_stack_get')) die("skip zend_test_zend_
--EXTENSIONS--
zend_test
--INI--
zend.max_allowed_stack_size=128K
zend.max_allowed_stack_size=256K
--FILE--
<?php

Expand Down Expand Up @@ -55,4 +55,4 @@ array(4) {
string(%d) "0x%x"
}
Will throw:
Maximum call stack size of %d bytes reached. Infinite recursion?
Maximum call stack size of %d bytes (zend.max_allowed_stack_size-zend.reserved_stack_size) reached. Infinite recursion?
6 changes: 3 additions & 3 deletions Zend/tests/stack_limit/stack_limit_011.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ if (!function_exists('zend_test_zend_call_stack_get')) die("skip zend_test_zend_
--EXTENSIONS--
zend_test
--INI--
zend.max_allowed_stack_size=128K
zend.max_allowed_stack_size=256K
--FILE--
<?php

Expand Down Expand Up @@ -48,5 +48,5 @@ array(4) {
["EG(stack_limit)"]=>
string(%d) "0x%x"
}
Maximum call stack size of %d bytes reached. Infinite recursion?
Previous: Maximum call stack size of %d bytes reached. Infinite recursion?
Maximum call stack size of %d bytes (zend.max_allowed_stack_size-zend.reserved_stack_size) reached. Infinite recursion?
Previous: Maximum call stack size of %d bytes (zend.max_allowed_stack_size-zend.reserved_stack_size) reached. Infinite recursion?
4 changes: 2 additions & 2 deletions Zend/tests/stack_limit/stack_limit_012.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ if (!function_exists('zend_test_zend_call_stack_get')) die("skip zend_test_zend_
--EXTENSIONS--
zend_test
--INI--
zend.max_allowed_stack_size=128K
zend.max_allowed_stack_size=256K
--FILE--
<?php

Expand Down Expand Up @@ -38,4 +38,4 @@ array(4) {
string(%d) "0x%x"
}

Fatal error: Maximum call stack size of %d bytes reached during compilation. Try splitting expression in %s on line %d
Fatal error: Maximum call stack size of %d bytes (zend.max_allowed_stack_size-zend.reserved_stack_size) reached during compilation. Try splitting expression in %s on line %d
2 changes: 1 addition & 1 deletion Zend/tests/stack_limit/stack_limit_013.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -117,4 +117,4 @@ $test = [
];

--EXPECTF--
Fatal error: Maximum call stack size of %d bytes reached during compilation. Try splitting expression in %s on line %d
Fatal error: Maximum call stack size of %d bytes (zend.max_allowed_stack_size-zend.reserved_stack_size) reached during compilation. Try splitting expression in %s on line %d
2 changes: 1 addition & 1 deletion Zend/zend_compile.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ static void zend_compile_assign(znode *result, zend_ast *ast);
zend_never_inline static void zend_stack_limit_error(void)
{
zend_error_noreturn(E_COMPILE_ERROR,
"Maximum call stack size of %zu bytes reached during compilation. Try splitting expression",
"Maximum call stack size of %zu bytes (zend.max_allowed_stack_size-zend.reserved_stack_size) reached during compilation. Try splitting expression",
(size_t) ((uintptr_t) EG(stack_base) - (uintptr_t) EG(stack_limit)));
}

Expand Down
2 changes: 1 addition & 1 deletion Zend/zend_execute.c
Original file line number Diff line number Diff line change
Expand Up @@ -2311,7 +2311,7 @@ static zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_use_new_element_for_s
#ifdef ZEND_CHECK_STACK_LIMIT
static zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_call_stack_size_error(void)
{
zend_throw_error(NULL, "Maximum call stack size of %zu bytes reached. Infinite recursion?",
zend_throw_error(NULL, "Maximum call stack size of %zu bytes (zend.max_allowed_stack_size-zend.reserved_stack_size) reached. Infinite recursion?",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
zend_throw_error(NULL, "Maximum call stack size of %zu bytes (zend.max_allowed_stack_size-zend.reserved_stack_size) reached. Infinite recursion?",
zend_throw_error(NULL, "Maximum call stack size of %zu bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?",

(size_t) ((uintptr_t) EG(stack_base) - (uintptr_t) EG(stack_limit)));
}
#endif /* ZEND_CHECK_STACK_LIMIT */
Expand Down