-
Notifications
You must be signed in to change notification settings - Fork 7.9k
zend_call_stack sort of GH-13358 follow-up. #13368
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
Conversation
@petk if you have a moment would it be possible to test if it builds for you on your solaris machines and passing the tests (including stack_limit_010.phpt which needs STACK_LIMIT_DEFAULTS_CHECK env var) ? thanks in advance. |
This test fails specifically. Actually it failed also before, I just didn't notice it. With the patch from the pull request it does look better a bit: Zend/tests/stack_limit/stack_limit_010.diff:
Zend/tests/stack_limit/stack_limit_010.out: array(4) {
["base"]=>
string(14) "0x7fffc0000000"
["max_size"]=>
string(8) "0x800000"
["position"]=>
string(14) "0x7fffbfffc120"
["EG(stack_limit)"]=>
string(14) "0x7fffbf80c000"
}
Expected max_size: 0xa00000
Actual max_size: 0x800000 Without patch (as is the current master branch) - Zend/tests/stack_limit/stack_limit_010.out: array(4) {
["base"]=>
string(14) "0x7fffc0000000"
["max_size"]=>
string(8) "0x800000"
["position"]=>
string(14) "0x7fffbfffc120"
["EG(stack_limit)"]=>
string(14) "0x7fffbf80c000"
}
Fatal error: Uncaught UnhandledMatchError: Unhandled match case 'SunOS' in .../php-src/Zend/tests/stack_limit/stack_limit_010.php:7
Stack trace:
#0 {main}
thrown in .../php-src/Zend/tests/stack_limit/stack_limit_010.php on line 7 I'm not sure if we should bother too much about Solaris 11.4 here. On Solaris there will be no more upgrades with new features. Only backwards compatibility and maintenance patches of existing applications until 2037. I think nobody will adjust new software for Solaris 11.4 specifically anymore because that would mean a dead end for the software itself. If there are patches possible, sure. I think looking forward to Oracle Linux and Solaris-alike illumos systems is the way forward here. Realistically, I'm not sure PHP 8.2 version will be available at all on Solaris at any point in the future, let alone 8.4. Regarding the patch in the PR, I think we can add it and go from there. P.S.: All other Zend tests pass, otherwise. |
ah the stack is smaller on solaris. |
Is Oracle Solaris a supported platform? |
Not a top supported platform, more like a lower tier one ; couple of other major oss projects still support it too. As I mentioned above at least one person cared enough to report a build issue for solaris 10. |
Zend/zend_call_stack.c
Outdated
stack->max_size = s.ss_size; | ||
stack->base = (char *)s.ss_sp - stack->max_size; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
stack->base
should be the high address of the stack (see the diagram in zend_call_stack_get_linux_proc_maps
), and ss_sp
is the high address already according to the manpage so I think we shouldn't subtract stack->max_size
from it here.
Note that in tests, zend_call_stack_get_solaris
will use zend_call_stack_get_solaris_proc_maps
and not zend_call_stack_get_solaris_pthread
because we are the main thread.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
stack->base
should be the high address of the stack
ah true I forgot.
for threaded context, it solely uses a new api only available on illumos. Here using a common older api to get the stack info for the current thread. while at it, completing stack_limit_010 test for these platforms.
a054542
to
21c653e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
for threaded context, it solely uses a new api only available on illumos.
Here using a common older api to get the stack info for the current thread.
while at it, completing stack_limit_010 test for these platforms.