- Notifications
You must be signed in to change notification settings - Fork750
Fix exception refcnt#1402
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
Fix exception refcnt#1402
Uh oh!
There was an error while loading.Please reload this page.
Conversation
As seen in exceptions.c (from cpython), derived exception classes mustalso clean the ExceptionBase members. If we don't, we leak the Pythonand C# objects set as the __cause__/Inner (amongstothers) of thrown C# exceptions.This does not address the serializability of the PythonException class.Also fix various PythonException (ab)uses.
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Mostly NITs, but Clear and Normalize must be rechecked.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
@BadSingleton can you investigate timeout in Ubuntu Py 3.6 tests? |
Huh.. that's weird. I'll take a look into it. |
I'm blocked due to#1412, this seems like an issue with garbage collection. This does raise the question of "How much do we care about Python 3.6?" There's less than a year before it's EOL:https://www.python.org/dev/peps/pep-0494/#lifespan . |
mjmvisser commentedSep 2, 2021 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@BadSingleton is this still blocked? (Benedikt says "this needs a rebase") |
@mjmvisser@BadSingleton AFAIK you should now be able to use a debug build of Python. |
Apologies for the late reply, was on vacations. Yes this needs a rebase. I hadn't had the time to take a look at it in a while, but we're planning on resuming work on this Soon ™️ |
@BadSingleton can you please see if the issue is still present in |
BadSingleton commentedJan 20, 2022 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Looks likecb4bb9a which re-enabled the test |
Originally from PRpythonnet#1402. The underlying bug is now fixed, but the testsare atill applicable.
Closing. Superseded by#1679 |
Originally from PR#1402. The underlying bug is now fixed, but the testsare atill applicable.
Uh oh!
There was an error while loading.Please reload this page.
What does this implement/fix? Explain your changes.
Adds a tp_dealloc function to ExceptionClassObject, so we clean the BaseException members the same way as other the derived exceptions in the cpython code does.
Does this close any currently open issues?
Fixes issue#1371.
Any other comments?
Fixes a bug where C# Exceptions set as the Inner of another C# Exception, then converted into a Python exception object (and thus having
__cause__
set to a valid object) would leak theInner
/__cause__
objects.Simplified diagram :
In this case, where the AggregateException would be thrown from C# and caught in Python, the AggregateException and PyAggregateException would be freed, but not the ArgumentException set as the cause.
Checklist
Check all those that are applicable and complete.
AUTHORS
CHANGELOG