Skip to content

review object management #161

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

Closed
wants to merge 5 commits into from
Closed

Conversation

remicollet
Copy link
Contributor

@remicollet remicollet commented Oct 21, 2020

This fix segfault on some arches, see #159

Sctach build with PHP 7.4 on Fedora Rawhide on i686, armv7hl, ppc64le, x86_64, aarch64 and s390x
https://koji.fedoraproject.org/koji/taskinfo?taskID=53905129

@remicollet
Copy link
Contributor Author

Sctach build with PHP 7.3 on Fedora 31 on armv7hl, x86_64, i686, aarch64, ppc64le and s390x
https://koji.fedoraproject.org/koji/taskinfo?taskID=53906459

P.S. the build includes the run of the test suite.

@remicollet
Copy link
Contributor Author

Local test on i686 and x86_64 with PHP 7.2 and 8.0, everything also OK.

@rtheunissen
Copy link
Member

Thank you for working on this. I would like to know why having std as the first member was causing a problem on some environments when none of these classes support properties and are final. I support this change, just want to make sure I understand what's happening.

@rtheunissen
Copy link
Member

Do you think it's possible that some of the peripheral changes fixed the issue, rather than the object management itself?

@remicollet
Copy link
Contributor Author

remicollet commented Oct 24, 2020

Do you think it's possible that some of the peripheral changes fixed the issue, rather than the object management itself?

Yes, probably, but was not able to find which one.
Also segfault occurs differently across version (7.3, 7.4, 8.0)... and arch.

BTW, in all case, pointer cast are evil ;)

@cmb69
Copy link
Contributor

cmb69 commented Oct 24, 2020

It seems to the missing return statements in php_common_handlers.c are a serious issue.

@rtheunissen
Copy link
Member

Yes, probably, but was not able to find which one.

I think we std was first and xtoffset is 0, with the object accessors using casting we would know whether the peripheral changes fixed the issue or not. I do intend to merge this though, I agree that following the convention is wise, I'm just aware of how this then impacts ext-decimal and designs for ext-ds 2.0 heavily relying on struct hacks to reduce indirection.

BTW, in all case, pointer cast are evil ;)

Why is that?

@remicollet
Copy link
Contributor Author

BTW, in all case, pointer cast are evil ;)

Why is that?

Different types have different memory layout, content, size, ...
So, generally, casting a pointer is bad, with very few exceptions
So in all cases must be considered careffully, and avoid as much as possible.

@rtheunissen
Copy link
Member

@remicollet I'm not set up to test on the environments where this was failing before, and I would like to understand what these changes are fixing exactly. Could we maybe increasingly reduce the scope of the changes until a minimal patch is available? I would like to know if it definitely is the object management that was tripping up.

@remicollet
Copy link
Contributor Author

The minimall patch is the php_common_handlers part (missing return)

@remicollet
Copy link
Contributor Author

Replaced by pr #165

@remicollet remicollet closed this Nov 3, 2020
@remicollet remicollet deleted the issue-wip branch November 3, 2020 09:39
@rtheunissen
Copy link
Member

The minimall patch is the php_common_handlers part (missing return)
Thank you for compiling that.

How is #165 different to this / why close?

@remicollet
Copy link
Contributor Author

#165 is the same
This one appears corrupt.... (git mystery)

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

Successfully merging this pull request may close these issues.

3 participants