-
-
Notifications
You must be signed in to change notification settings - Fork 30.9k
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
Unittest: self-referencing explicit exception cause results in infinite loop #98458
Labels
type-bug
An unexpected behavior, bug, or error
Comments
gpshead
pushed a commit
that referenced
this issue
Dec 4, 2022
…xceptions that contain cycles (#98459) * Bugfix addressing infinite loop while handling self-referencing chained exception in TestResult._clean_tracebacks() * Bugfix extended to properly handle exception cycles in _clean_tracebacks. The "seen" set follows the approach used in the TracebackException class (thank you @iritkatriel for pointing it out) * adds a test for a single chained exception that holds a self-loop in its __cause__ and __context__ attributes
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this issue
Dec 4, 2022
…ined exceptions that contain cycles (pythonGH-98459) * Bugfix addressing infinite loop while handling self-referencing chained exception in TestResult._clean_tracebacks() * Bugfix extended to properly handle exception cycles in _clean_tracebacks. The "seen" set follows the approach used in the TracebackException class (thank you @iritkatriel for pointing it out) * adds a test for a single chained exception that holds a self-loop in its __cause__ and __context__ attributes (cherry picked from commit 72ec518) Co-authored-by: AlexTate <0xalextate@gmail.com>
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this issue
Dec 4, 2022
…ined exceptions that contain cycles (pythonGH-98459) * Bugfix addressing infinite loop while handling self-referencing chained exception in TestResult._clean_tracebacks() * Bugfix extended to properly handle exception cycles in _clean_tracebacks. The "seen" set follows the approach used in the TracebackException class (thank you @iritkatriel for pointing it out) * adds a test for a single chained exception that holds a self-loop in its __cause__ and __context__ attributes (cherry picked from commit 72ec518) Co-authored-by: AlexTate <0xalextate@gmail.com>
Thanks! A bit of an unusual issue but no doubt a pain to debug when something winds up with this happening. |
miss-islington
added a commit
that referenced
this issue
Dec 4, 2022
…xceptions that contain cycles (GH-98459) * Bugfix addressing infinite loop while handling self-referencing chained exception in TestResult._clean_tracebacks() * Bugfix extended to properly handle exception cycles in _clean_tracebacks. The "seen" set follows the approach used in the TracebackException class (thank you @iritkatriel for pointing it out) * adds a test for a single chained exception that holds a self-loop in its __cause__ and __context__ attributes (cherry picked from commit 72ec518) Co-authored-by: AlexTate <0xalextate@gmail.com>
miss-islington
added a commit
that referenced
this issue
Dec 4, 2022
…xceptions that contain cycles (GH-98459) * Bugfix addressing infinite loop while handling self-referencing chained exception in TestResult._clean_tracebacks() * Bugfix extended to properly handle exception cycles in _clean_tracebacks. The "seen" set follows the approach used in the TracebackException class (thank you @iritkatriel for pointing it out) * adds a test for a single chained exception that holds a self-loop in its __cause__ and __context__ attributes (cherry picked from commit 72ec518) Co-authored-by: AlexTate <0xalextate@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bug report
If an exception is raised with a self-referencing __cause__ or __context__ then TestResult._clean_tracebacks() in result.py enters an infinite loop.
Minimal example 1:
Minimal example 2:
Identified Cause
Self-references are not checked while unwinding the chained exception on line 216 of result.py
Your environment
Linked PRs
The text was updated successfully, but these errors were encountered: