Skip to content
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

Call gc_collect_cycles() always twice, fixed in PHP 8.1, required for PHP 8.0 and earlier #124

Merged
merged 1 commit into from
Jun 22, 2021

Conversation

mvorisek
Copy link
Contributor

@mvorisek mvorisek commented Jun 10, 2021

fixes #90

related with php/php-src#5581

@Ocramius
Copy link
Member

Ocramius commented Jun 10, 2021 via email

@mvorisek
Copy link
Contributor Author

mvorisek commented Jun 11, 2021

here is a simple script to reproduce:

https://3v4l.org/snnb3

basically any scenario which has a cyclic reference (otherwise GC is not needed) with at least one object with __destructor method

@Ocramius
Copy link
Member

Ocramius commented Jun 11, 2021 via email

@mvorisek
Copy link
Contributor Author

mvorisek commented Jun 17, 2021

test added, when the fix (1st commit) is reverted, false positive leak is detected - see 0d71b6c

lock file also removed, https://github.com/Roave/no-leaks/pulls?q=is%3Apr+author%3Aapp%2Fdependabot-preview PRs are completely unusefull as when installed as composer library/dep, lock file is not used

@mvorisek
Copy link
Contributor Author

mvorisek commented Jun 17, 2021

please look at https://github.com/Roave/no-leaks/pull/124/checks?check_run_id=2853673697 failing test, it is failing randomly and it seems unrelated with this PR

.github/workflows/coding-standards.yml Outdated Show resolved Hide resolved
.github/workflows/mutation-tests.yml Outdated Show resolved Hide resolved
.github/workflows/phpunit.yml Outdated Show resolved Hide resolved
.github/workflows/psalm.yml Outdated Show resolved Hide resolved
.gitignore Outdated Show resolved Hide resolved
@mvorisek
Copy link
Contributor Author

please look at https://github.com/Roave/no-leaks/pull/124/checks?check_run_id=2853673697 failing test, it is failing randomly and it seems unrelated with this PR

did you read it?

@Ocramius
Copy link
Member

@mvorisek I see no failures there?

Are we talking different things perhaps?

My initial question around this patch was a lack of testing around the added gc_collect_cycles() call: tests seem to have been added.

After that, a number of unrelated changes that remove composer.lock were introduced, and those need to be reverted (or composer.lock updated to a state that leads to green tests).

@mvorisek
Copy link
Contributor Author

mvorisek commented Jun 18, 2021

@mvorisek I see no failures there?

Are we talking different things perhaps?

see https://github.com/Roave/no-leaks/runs/2853673697?check_suite_focus=true for example, testing is unstable, about every 3/4th push did not pass testing, even if another push with unchanged files passes.

@Ocramius
Copy link
Member

Is that the previous state, or the current state?

As for why that happens, I am not able to identify a root cause at the moment.

@mvorisek
Copy link
Contributor Author

Is that the previous state, or the current state?

As for why that happens, I am not able to identify a root cause at the moment.

happend with 1dae150 (sha obtained from https://github.com/Roave/no-leaks/runs/2853673697?check_suite_focus=true#step:2:150 )

I noticed that at least 2 times. I belive with enough pushes it must be reproducible with the latest PR update and probably also with the default repo branch.

@mvorisek mvorisek requested a review from Ocramius June 19, 2021 17:03
@mvorisek
Copy link
Contributor Author

@Ocramius any more feedback except the discovered but unrelated CI unstability?

src/CollectTestExecutionMemoryFootprints.php Outdated Show resolved Hide resolved
src/CollectTestExecutionMemoryFootprints.php Outdated Show resolved Hide resolved
@Ocramius
Copy link
Member

@Ocramius any more feedback except the discovered but unrelated CI unstability?

The instability is worrisome, but unsure how to tackle it.

Overall, I think the patch is fine (see just the last comments)

@mvorisek
Copy link
Contributor Author

feedback fixed and changes squashed to one commit

@Ocramius Ocramius added the bug Something isn't working label Jun 22, 2021
@Ocramius Ocramius self-assigned this Jun 22, 2021
@Ocramius Ocramius added this to the 1.3.0 milestone Jun 22, 2021
@Ocramius Ocramius added the enhancement New feature or request label Jun 22, 2021
@Ocramius
Copy link
Member

Thanks! Cutting a release now :-)

@Ocramius Ocramius changed the title Call gc_collect_cycles() always twice, fixed in PHP 8.1 Call gc_collect_cycles() always twice, fixed in PHP 8.1, required for PHP 8.0 and earlier Jun 22, 2021
@Ocramius Ocramius merged commit 1373c4f into Roave:1.3.x Jun 22, 2021
@mvorisek mvorisek deleted the patch-1 branch June 22, 2021 09:31
@mvorisek
Copy link
Contributor Author

Thank too, just a small discovery:

something is wrong with escaping in the rel. notes:

image

@Ocramius
Copy link
Member

Yep, that's known - it's potentially an issue with https://github.com/jwage/changelog-generator

sad270 added a commit to sad270/no-leaks that referenced this pull request Aug 2, 2023
Since Roave#162 we only support PHP 8.1 and PHP 8.2
This code added in Roave#124  is only for PHP 8.0 and PHP 7.4
sad270 added a commit to sad270/no-leaks that referenced this pull request Aug 2, 2023
Since Roave#162 we only support PHP 8.1 and PHP 8.2
This code added in Roave#124  is only for PHP 8.0 and PHP 7.4
sad270 added a commit to sad270/no-leaks that referenced this pull request Aug 2, 2023
Since Roave#162 we only support PHP 8.1 and PHP 8.2
This code added in Roave#124  is only for PHP 8.0 and PHP 7.4
sad270 added a commit to sad270/no-leaks that referenced this pull request Aug 2, 2023
Since Roave#162 we only support PHP 8.1 and PHP 8.2
This code added in Roave#124  is only for PHP 8.0 and PHP 7.4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Single call to gc_collect_cycles don't collect all GC
2 participants