| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
…le from failed future captured in its exception’s traceback
|
only failing for Ubuntu (free-threading) / build and test (ubuntu-24.04-arm) and I cannot reproduce on my ubuntu arm VM Edit: actually I did reproduce it after a couple attempts |
Sorry, something went wrong.
|
@ebonnal thanks for the test! Your first test was good, and it found a bug https://github.com/python/cpython/actions/runs/14048391667/job/39333996238?pr=131701#step:22:632 I've pushed a commit to revert to the original style of test - which includes the references in the error message, and fixed the bug. |
Sorry, something went wrong.
… to an Exception or a failed Future
Thanks @graingert !
Nice, I have cleaned up this exc_wrapper and added an additional test that goes through the error's traceback frames and search for any reference to an Exception. (I have renamed the PR to show that we have extended its scope) |
Sorry, something went wrong.
|
ok I can't repeat it locally, even disabling the GC - sorry for hijacking your PR but I think I need to test it in CI to repeat |
Sorry, something went wrong.
|
Hey @graingert, update from my investigations with a free-threading build on an Ubuntu ARM machine: |
Sorry, something went wrong.
|
I don't think it's a gc race condition as the problem still happens with the GC disabled. I think the problem is that the main thread is resumed before the background thread can delete the future. I'm happy for you to revert back to 03f8ab4 |
Sorry, something went wrong.
|
Clear, thanks for the help @graingert, I appreciate it! Merging this test will definitely help prevent future regressions (e.g. in #131467). Should we open a follow up issue summarizing the behavior we have found with free-threading builds on some platforms? Happy to do it! |
Sorry, something went wrong.
|
ready for your final review fyi @graingert 🙏🏻 |
Sorry, something went wrong.
| self.assertEqual(i.__next__(), (0, 1)) | ||
| self.assertEqual(i.__next__(), (0, 1)) | ||
| with self.assertRaises(ZeroDivisionError): | ||
|
|
There was a problem hiding this comment.
This test looks fragile to me, +1 to remove test altogether, the fix is straightforward enough
Sorry, something went wrong.
|
This PR is stale because it has been open for 30 days with no activity. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
A failed future stores the raised exception in its ._exception attribute. We get a reference cycle if this exception's __traceback__ refers back to the future.
A particular care has been taken to avoid that (e.g. by @graingert in #95169)
This PR tests this behavior.
(follows up discussion in #131467)
Edit:
We extend this PR to ensure that no reference to an Exception is captured in the error's traceback frames.