-
Notifications
You must be signed in to change notification settings - Fork 7.8k
Fix tests on 32-bit Windows OS #8448
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
@@ -1,18 +0,0 @@ | |||
--TEST-- | |||
Bug #77269 (Potential unsigned underflow in gdImageScale) |
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.
duplicate of ext/gd/tests/bug77272.phpt
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.
Well, not exactly (this test is supposed to work with pretty old GD, but the other only for somewhat recent versions), but I think it's okay to drop bug77269.phpt now, but for "master" only.
sapi/phpdbg/tests/watch_001.phpt
Outdated
@@ -2,9 +2,6 @@ | |||
Test simple recursive watchpoint | |||
--SKIPIF-- | |||
<?php | |||
if (PHP_INT_SIZE == 4) { |
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.
Probably fixed, tests pass:
Test simple recursive watchpoint [D:\a\php-src\php-src\sapi\phpdbg\tests\watch_001.phpt] (warn: XFAIL section but test passes)
Test simple array watchpoint with replace [D:\a\php-src\php-src\sapi\phpdbg\tests\watch_002.phpt] (warn: XFAIL section but test passes)
Test simple watchpoint with replace [D:\a\php-src\php-src\sapi\phpdbg\tests\watch_003.phpt] (warn: XFAIL section but test passes)
Test detection of inline string manipulations on zval watch [D:\a\php-src\php-src\sapi\phpdbg\tests\watch_004.phpt] (warn: XFAIL section but test passes)
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.
The issues may be solved, but I'd only remove that skipif clause for "master".
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.
if it passes for PHP-8.0, why do not fix this good behaviour for PHP-8.0 too?
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.
It may pass, but would it pass in all enviroments? I mean the skip reason is "There may be flaws in the implementation of watchpoints that cause failures". This may not have been resolved generally. Maybe @krakjoe can comment on this?
7106c77
to
a06e8d8
Compare
@@ -1,18 +0,0 @@ | |||
--TEST-- | |||
Bug #77269 (Potential unsigned underflow in gdImageScale) |
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.
Well, not exactly (this test is supposed to work with pretty old GD, but the other only for somewhat recent versions), but I think it's okay to drop bug77269.phpt now, but for "master" only.
@@ -5,6 +5,7 @@ memory_limit=-1 | |||
--SKIPIF-- | |||
<?php | |||
if (!extension_loaded('gd')) die('skip gd extension not available'); | |||
if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only"); |
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.
Doesn't this test succeed on 32bit Linux?
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.
2**28
is still within the 32-bit integer range, I need to investigate further
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.
That is correct, but there are additional allocations, and I think that the scaling uses a truecolor image which requires 4 byte for each pixel. So we're at 2^30 (plus), what usually doesn't work on Windows (usually max. 2 GiB per process), while Linux may allow more.
sapi/phpdbg/tests/watch_001.phpt
Outdated
@@ -2,9 +2,6 @@ | |||
Test simple recursive watchpoint | |||
--SKIPIF-- | |||
<?php | |||
if (PHP_INT_SIZE == 4) { |
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.
The issues may be solved, but I'd only remove that skipif clause for "master".
a06e8d8
to
6b2dbb8
Compare
Please wait for #8392 to be merged before working on this, also CI enabling of x86 testing for Windows should be either part of this PR or a follow-up instead of polluting the other one which should just be a change from Appveyor to GitHub |
6ed2373
to
cf3f55d
Compare
cf3f55d
to
978f214
Compare
@cmb69 can you please review the test changes? I tested them on Windows x64 with 32 bit php, but I have no access to 32 bit linux nor 32 bit Windows machines. |
@cmb69 I propose all changes made, it fixes 32b build on Win x64 and I have no access to 32b machines. I propose to merge as is, if there is any issue with rate 32b OS combination, then we can add XFAIL/SKIP back, but I belive the issues were already skipped and better to assert no issues in CI if there are no issues known |
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.
I'm fine with merging the changes to the phpdbg tests into master, and also dropping bug77269.phpt there. I don't think we shouldn't touch bug77272.phpt without closer investigation. The changes to bug72858.phpt defeat the purpose of that test.
|
bug77272.phpt should run regardless of the architecture, unless it is clear, that it never can pass under 32bit OS (I still believe it passes on Linux). bug72858.phpt is supposed to run under 32bit only, to trigger |
it does not pass /w 32b build for Windows, can you reproduce?
on 32b build, there is no warning, if the test is failing on native 32b architecture/host, how to fix it? |
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.
bug72858.phpt is supposed to run under 32bit only, to trigger shm_attach() failure. I have yet to see that test failing on any 32bit architecture.
So why did you delete that test?
@cmb69 because #8448 (comment) |
Nikita wrote "If this test no longer works on 32-bit,", but for me it works every single time I run it. I still have yet to see a single case where it fails. |
for me, the original expected warning is not present when I compile PHP for x86/32b (and for x64/64b, the test is skipped) (all tests done on 64 bit host OS) |
Okay, thanks. https://github.com/cmb69/php-ftw/actions/runs/2396415661 confirms that. I'll have a closer look. |
I still think that the test is useful, but the actual
Task failed successfully! ;) |
This reverts commit 91dca4f.
updated, but are you sure it will fail on systems with free memory much larger than |
21bc6ad
to
80f22ab
Compare
you are right, the test should pass, there is some detection in gd do you have any idea how to fix the gd lib? Bug #77269 (Potential unsigned underflow in gdImageScale) [D:\a\php-src\php-src\ext\gd\tests\bug77269.phpt] tests are failing consistently on x86 build |
Ugh, what a mess! The implementation in gd_security.c is used for bundled libgd; the implementation in gd_compat.c might be used for external libgd, although we require libgd >= 2.1.0, which always should have the implementation in gd_security.c. I guess gd_compat.c is superfluous for years. I'm gonna check this out.
Like I said above, this test should be removed for "master".
I suggest to skip this test on 32bit Windows. |
Unfortunately, |
discovered during GH-8392 devel
see comments for the decisions