Skip to content

ext/fileinfo/tests/bug78987.phpt: increase a memory limit #13940

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 1 commit into from

Conversation

orlitzky
Copy link
Contributor

This test performs a few checks to ensure that "not too much" memory is used while fileinfo is detecting encodings. It is however platform specific, and memory usage varies across hosts and as libmagic changes.

Recently a Gentoo user reported a failure in this test at https://bugs.gentoo.org/927461 on a big-endian PPC64 machine with output,

---- EXPECTED OUTPUT
131072   => ok
262144   => ok
524288   => ok
1048576  => ok
2097152  => ok
4194304  => ok
8388608  => ok
16777216 => ok
---- ACTUAL OUTPUT
131072   => 10092544
262144   => 10092544
524288   => 12189696
1048576  => 12189696
2097152  => 14352384
4194304  => 18612224
8388608  => 24903680
16777216 => 37486592
---- FAILED

Those numbers are with 8.3.4 and therefore missing commit b7c5813c which also raises the limits. Checking the "actual" numbers above against the current values, we see that the limit for 524288 would need to be bumped to 12189696 to allow this test to pass. Since that seems reasonable, that's what this commit does.

Closes GH-13795

This test performs a few checks to ensure that "not too much" memory
is used while fileinfo is detecting encodings. It is however platform
specific, and memory usage varies across hosts and as libmagic changes.

Recently a Gentoo user reported a failure in this test at,

  https://bugs.gentoo.org/927461

on a big-endian PPC64 machine with output,

  ---- EXPECTED OUTPUT
  131072   => ok
  262144   => ok
  524288   => ok
  1048576  => ok
  2097152  => ok
  4194304  => ok
  8388608  => ok
  16777216 => ok
  ---- ACTUAL OUTPUT
  131072   => 10092544
  262144   => 10092544
  524288   => 12189696
  1048576  => 12189696
  2097152  => 14352384
  4194304  => 18612224
  8388608  => 24903680
  16777216 => 37486592
  ---- FAILED

Those numbers are with 8.3.4 and therefore missing commit b7c5813
which also raises the limits. Checking the "actual" numbers above
against the current values, we see that the limit for 524288 would
need to be bumped to 12189696 to allow this test to pass. Since that
seems reasonable, that's what this commit does.

Closes phpGH-13795
Copy link
Member

@nielsdos nielsdos left a comment

Choose a reason for hiding this comment

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

Thanks!
Just to confirm: This should be applied to 8.3 too right?

@orlitzky
Copy link
Contributor Author

I think so. The issue exists in 8.3, and the patch should apply cleanly. The issue was also observed in 8.2, but this patch alone won't fix it.

@nielsdos
Copy link
Member

I think so. The issue exists in 8.3, and the patch should apply cleanly. The issue was also observed in 8.2, but this patch alone won't fix it.

Okay, thanks. I'll cherry-pick this into PHP-8.3 and up.

@nielsdos nielsdos closed this in 4ded247 Apr 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Test failing in ext/fileinfo/tests/bug78987.phpt on big-endian PPC
2 participants