-
Notifications
You must be signed in to change notification settings - Fork 78
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
Odd behaviour resulting in SIGSEGV #129
Comments
I created a Dockerfile which has a repo of this issue.
Where test.php is <?php
$some_bool = false;
if ($some_bool === true)
{
$test = new stdClass();
}
meminfo_dump(fopen('/tmp/my_dump_file.json', 'w'));
echo time(); Can be built with
Can be ran with
You can dig deeper into it by running (at least on macOS, for other OS you may need to change $PWD)
By modifying the php version installed I was able to confirm this test fails on php8.0 was able to confirm the test fails with the following php versions
Modifying docker image from the
This is the php5 Dockerfile for testing.
For some reason there is no php7.4 to test with 🤷♂️ EDIT:
Updating to php8.2 to build from the test also passes. Which means there is something wrong/missing with the php from AWS. |
I have the same problem, I'll try to fix it
|
Добрый день.
Буду находиться в отпуске с 5.02 по 13.02.
Настроена пересылка писем Татьяне Кубаревой ***@***.***, если вопрос срочный, она ответит Вам.
На менее срочные письма я отвечу после возвращения.
|
TL;DR; Weird thing happens with php8+ when using Amazon Linux 2. Using docker images from php for php8+ the same test pasts. Issue appears to be related to the specific packages installed not php as a whole. BUT it does also show some odd things happening by moving code about.
I'm not sure how to debug php-meminfo itself, but I have a really odd one that I was able to replicate down to a small test. The test consists of
TestClass
in which I want to use the staticCurrent()
method to get a single instance of the class.This will result in SIGSEGV which will result in apache giving a 503 response. But things get really odd really quick.
If you change
to
then the code will work. Maybe something about having a reference to the variable? But it's odd because the code will never execute as
$some_bool
is false.Another oddity is if you move the declaration outside of the if then it will also work as expected.
EDIT: I also just found it has nothing to do with the static variable. The new minimum test case is
I should have also included specs. This is running on a Amazon Linux 2 EC2 instance. php version is
As for php-meminfo, I built it from the current master source.
EDIT 2:
This can be replicated without the TestClass
EDIT 3:
Looks like maybe it has something to do with code being removed when executed or something.
This works
This does not
But in saying that this works and it shouldn't according to the above example
But then this also works
You can also get this to fail with primatives.
The text was updated successfully, but these errors were encountered: