Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[ErrorHandler] Avoid calling xdebug_get_function_stack() in xdebug >= 3.0 when not in develop mode#40787

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

@ralphschindler
Copy link

@ralphschindlerralphschindler commentedApr 12, 2021
edited
Loading

QA
Branch?5.2
Bug fix?yes
New feature?no
Deprecations?no
Tickets#40679
LicenseMIT
Doc PRnone

When the application is already dealing with a FatalError, we should avoid callingxdebug_get_function_stack() in situations we know will produce another php_error from within xdebug itself.

https://github.com/xdebug/xdebug/blob/90fa09d230603f3d972dd00cf02440cf3d35d2ee/src/develop/stack.c#L1003-L1007

xdebug_get_function_stack() can be called in xdebug < 3.0 (ie:ini_get('xdebug.mode') will return false since it doesn't not exist

OR

xdebug_get_function_stack() can be called in xdebug >= 3.0 whenini_get('xdebug.mode') returnsdevelop.

@carsonbot
Copy link

Hey!

I see that this is your first PR. That is great! Welcome!

Symfony has acontribution guide which I suggest you to read.

In short:

  • Always add tests
  • Keep backward compatibility (seehttps://symfony.com/bc).
  • Bug fixes must be submitted against the lowest maintained branch where they apply (seehttps://symfony.com/releases)
  • Features and deprecations must be submitted against the 5.x branch.

Review the GitHub status checks of your pull request and try to solve the reported issues. If some tests are failing, try to see if they are failing because of this change.

When two Symfony core team members approve this change, it will be merged and you will become an official Symfony contributor!
If this PR is merged in a lower version branch, it will be merged up to all maintained branches within a few days.

I am going to sit back now and wait for the reviews.

Cheers!

Carsonbot

@ralphschindlerralphschindler changed the title[Debug][ErrorHandler] Avoid calling xdebug_get_function_stack() in xdebug >= 3.0 when not in develop mode[ErrorHandler] Avoid calling xdebug_get_function_stack() in xdebug >= 3.0 when not in develop modeApr 12, 2021
@nicolas-grekas
Copy link
Member

nicolas-grekas commentedApr 12, 2021
edited
Loading

I think the current code already handles the situation. It's just not released yet.
Please have a look at#40679

@ralphschindler
Copy link
Author

It attempts to handle it yes. In an ideal world, we could avoid the call and avoid using the at-suppression/shut operator (a good php practice is if you can avoid @-suppression, you should).

In the current unreleased codebase, the function is still called, and if a custom error handler is currently registered, it too will be triggered (I am seeing this behavior):

https://www.php.net/manual/en/language.operators.errorcontrol.php

If a custom error handler function is set with set_error_handler(), it will still be called even though the diagnostic has been suppressed ...

@nicolas-grekas
Copy link
Member

As explained in xdebug's doc, the php.ini setting can be overriden by an env var. This means this check won't work all the time. You're right about the silencing operator. Maybe we could set a temporary "null" error handler instead of using it. Would you mind giving it a try in this PR?

@ralphschindler
Copy link
Author

You make a great point, ... I am inclined to just close this PR as I don't see any clean way of detecting the mode, and introducing another error handler to the stack doesn't feel like the right path.

The @-supression is probably a good enough stopgap until proper mode detection is built-in to xdebug:

xdebug/xdebug#733
https://bugs.xdebug.org/view.php?id=1898

Hopefully we can get this current fix with the @-suppression released soon? 😁

@derickr
Copy link

xdebug/xdebug#737 us the new PR

xabbuh, derrabus, and yceruto reacted with heart emoji

@xabbuh
Copy link
Member

This looks great! ❤️ Thank you very much, Derick!

nicolas-grekas added a commit that referenced this pull requestMay 15, 2024
…h xdebug >= 3.0 when not in develop mode (fmata)This PR was merged into the 5.4 branch.Discussion----------[ErrorHandler] Do not call xdebug_get_function_stack() with xdebug >= 3.0 when not in develop mode| Q             | A| ------------- | ---| Branch?       | 5.4| Bug fix?      | yes| New feature?  | no| Deprecations? | no| Issues        |Fix#40677| License       | MITThe PR#40787 was rejected because of env var handling in xdebug_mode.xdebug/xdebug#737 allow us to get xdebug_mode in all cases so I think we can merge this PR safely.Tested on my setup successfully, I have no more warning.Thanks `@ralphschindler` :)Commits-------a8114fe [ErrorHandler] Do not call xdebug_get_function_stack() with xdebug >= 3.0 when not in develop mode
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@ycerutoycerutoAwaiting requested review from ycerutoyceruto is a code owner

Assignees

No one assigned

Projects

None yet

Milestone

5.2

Development

Successfully merging this pull request may close these issues.

5 participants

@ralphschindler@carsonbot@nicolas-grekas@derickr@xabbuh

[8]ページ先頭

©2009-2025 Movatter.jp