https://github.com/matomo-org/matomo/pull/16943 - Mouve

Site d'origine

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

Prevent memory error when using PHP8 and a session error happens #16943

Merged
merged 1 commit into from Dec 13, 2020

Conversation

@tsteur
Copy link
Member

@tsteur tsteur commented Dec 13, 2020

Description:

Noticed it exceeded 512MB, then 2GB, ...

It was running in an endless loop because

PHP Fatal error: Uncaught ArgumentCountError: Too few arguments to function Zend_Session_Exception::handleSessionStartError(), 4 passed and exactly 5 expected i

See https://www.php.net/manual/en/function.set-error-handler.php

Since PHP 8: errcontext was removed, and will no longer be passed to user callbacks.

There might be also other places where we maybe use error handler

Review

  • Functional review done
  • Usability review done (is anything maybe unclear or think about anything that would cause people to reach out to support)
  • Security review done see checklist
  • Code review done
  • Tests were added if useful/possible
  • Reviewed for breaking changes
  • Developer changelog updated if needed
  • Documentation added if needed
  • Existing documentation updated if needed
Noticed it exceeded 512MB, then 2GB, ...

It was running in an endless loop because 

> PHP Fatal error:  Uncaught ArgumentCountError: Too few arguments to function Zend_Session_Exception::handleSessionStartError(), 4 passed and exactly 5 expected i

See https://www.php.net/manual/en/function.set-error-handler.php

> Since PHP 8: errcontext was removed, and will no longer be passed to user callbacks.

There might be also other places where we maybe use error handler
@tsteur tsteur added this to the 4.0.x milestone Dec 13, 2020
@sgiehl
sgiehl approved these changes Dec 13, 2020
Copy link
Member

@sgiehl sgiehl left a comment

already had a similar fix in #16897. can confirm that works

@tsteur tsteur merged commit 5b48e4f into 4.x-dev Dec 13, 2020
0 of 2 checks passed
0 of 2 checks passed
Travis CI - Branch Build Failed
Details
Travis CI - Pull Request Build Failed
Details
@sgiehl sgiehl deleted the errorhandler4args branch Dec 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants

Raccourcis

Commandes

Fermer