Skip to content
New issue

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

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

Already on GitHub? # to your account

Fix fibers tests on ppc64le #7710

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

andypost
Copy link
Contributor

@andypost andypost commented Dec 3, 2021

@andypost
Copy link
Contributor Author

andypost commented Dec 3, 2021

Filed to see possible regressions

@andypost andypost marked this pull request as draft December 3, 2021 15:48
@nikic
Copy link
Member

nikic commented Dec 3, 2021

Just to clarify, based on your comment in https://bugs.php.net/bug.php?id=81689 this does not fix the ppc64le issue yet, right?

@andypost
Copy link
Contributor Author

andypost commented Dec 3, 2021

Yes, this 2 tests still fail, but as I see other places with INI_INT using int to define variable

The whole build log could be found at https://gitlab.alpinelinux.org/alpine/aports/-/jobs/554235

@@ -443,7 +443,7 @@ static ZEND_STACK_ALIGNED void zend_fiber_execute(zend_fiber_transfer *transfer)
zend_fiber *fiber = EG(active_fiber);

/* Determine the current error_reporting ini setting. */
zend_long error_reporting = INI_INT("error_reporting");
int error_reporting = INI_INT("error_reporting");
Copy link
Member

Choose a reason for hiding this comment

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

zend_ini_long() returns zend_long, so why should we use a narrower type here?

Copy link
Member

@trowski trowski Dec 5, 2021

Choose a reason for hiding this comment

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

This value is later assigned to EG(error_reporting), an int, so I suggested this change thinking perhaps there was something unusual happening where it wasn't being cast properly on that assignment because it was stored in a long.

Thinking about it further, I'm not sure this is origin of the problem anyway. The problem appears to be with saving and restoring EG(error_reporting), which is done within zend_fiber_capture_vm_state and zend_fiber_restore_vm_state. Given the types there, I'm not seeing why this is failing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

wondering as git grep INI_INT returns mostly int so it needs separate PR to normalize

btw gonna try 5459ed4 as it the fixed looks related

Copy link
Contributor Author

Choose a reason for hiding this comment

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

but it does not help too

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As tests fixed, the remaining question is clean-up still needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Commit 492af9f adds new function for parsing ints

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Somehow it still needs to fix type or use cast

Copy link
Contributor Author

Choose a reason for hiding this comment

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

At least counters could affect all little-endian arches

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@cmb69 any suggestion to fix it?

@andypost
Copy link
Contributor Author

andypost commented Jan 4, 2022

Bug was fixed via 7773 but the PR still makes sense to fix int/long issue with INI_INT

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants