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
Fix SegFault on serialization of objects #2
Fix SegFault on serialization of objects #2
Conversation
@SwenVanZanten I think that was already fixed in |
It did fix running in PHP 7.4, however it doesn't work for the test scenario's I've added in the PR. |
@Trainmaster hi any chance to check this PR out? |
@SwenVanZanten |
I tried your fixes, and it completes all the tests, but I'm still getting segmentation faults using PHP 7.4.3. |
With serialization & unserialization or another use case? |
Maybe @nikic can help us out at this point (php/php-src@1cfbb21). Because I would say that
was implemented by afd2ed8. |
@Trainmaster Presumably there was a reason why the object destruction was previously skipped -- most likely, it was to work around a refcounting bug somewhere else. From a quick look, I'd assume that this kind of code is the root problem: pecl-networking-gearman/php_gearman_task.c Lines 130 to 143 in a787fa0
|
Actually, just using |
Thnx @nikic ! I'll give it another go tomorrow |
Added extra test cases for GearmanTask and GearmanWorker |
If it's stable please push tag with new version |
@rlerdorf removed the |
I can confirm, this PR fixes segfaults seen with PHP 7.4. 👍🏿 |
Hi folks, when can we see all these pull requests finally merged?? |
I also confirm it's stable |
A slight refactor of PR #2 - thanks @SwenVanZanten
I've encountered a problem with upgrading a codebase to PHP 7.4 using the latest build of this extension.
In this situation we have some objects which contain a GearmanJob object. When serializing and unserializing a bunch of them you'll get a Segmentation Fault.
I'm not familiar with writing code in C and I'm not sure this is the proper solution to the problem.
So correct me if I'm wrong here! However it solves my problem and doesn't introduce any new once... according to the testsuite 😜