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

fix: Fix infinite recursion in Debug::fmt method #569

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

0xkazak
Copy link

@0xkazak 0xkazak commented Mar 9, 2025

Description

I noticed an issue where the Debug::fmt method was calling itself, causing infinite recursion. To resolve this, I replaced the recursive call with one that properly formats the error details. Now, instead of calling Debug::fmt(self, f), it correctly calls self.detail.fmt(f) to print the error details.

This should prevent any stack overflow issues and ensure that errors are printed correctly.


PR author checklist:

  • Added changelog entry, using unclog.
  • Added tests: integration (for Hermes) or unit/mock tests (for modules).
  • Linked to GitHub issue.
  • Updated code comments and documentation (e.g., docs/).
  • Tagged one reviewer who will be the one responsible for shepherding this PR.

Reviewer checklist:

  • Reviewed Files changed in the GitHub PR explorer.
  • Manually tested (in case integration/unit/mock tests are absent).

@0xkazak
Copy link
Author

0xkazak commented Mar 9, 2025

ljoss17, pls check it.

@ljoss17
Copy link
Contributor

ljoss17 commented Mar 13, 2025

Hey @0xkazak do you have a way of reproducing the infinite recursion?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants