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

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

Conversation

BadSingleton
Copy link
Contributor

@BadSingletonBadSingleton commentedMar 1, 2021
edited by filmor
Loading

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 :

AggregateException.Inner        -> ArgumentException(...)      ^                                    ^      |                                    |PyAggregateException.__cause__  -> PyArgumentException

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.

  • Make sure to include one or more tests for your change
  • If an enhancement PR, please create docs and at best an example
  • Add yourself toAUTHORS
  • Updated theCHANGELOG

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.
Copy link
Member

@lostmsulostmsu left a 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.

@lostmsu
Copy link
Member

@BadSingleton can you investigate timeout in Ubuntu Py 3.6 tests?

@BadSingleton
Copy link
ContributorAuthor

Huh.. that's weird. I'll take a look into it.

@BadSingleton
Copy link
ContributorAuthor

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
Copy link
Contributor

mjmvisser commentedSep 2, 2021
edited
Loading

@BadSingleton is this still blocked? (Benedikt says "this needs a rebase")

@lostmsu
Copy link
Member

@mjmvisser@BadSingleton AFAIK you should now be able to use a debug build of Python.

@BadSingleton
Copy link
ContributorAuthor

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 ™️

@lostmsu
Copy link
Member

@BadSingleton can you please see if the issue is still present inmaster, and if it is not, I would suggest to open a new PR with regression tests (you seem to have added a few here).

@BadSingleton
Copy link
ContributorAuthor

BadSingleton commentedJan 20, 2022
edited
Loading

Looks likecb4bb9a which re-enabled the testtest_method_parameters_change supersedes this PR. I'll see if the other test cases are still applicable

BadSingleton added a commit to Unity-Technologies/pythonnet that referenced this pull requestJan 24, 2022
Originally from PRpythonnet#1402. The underlying bug is now fixed, but the testsare atill applicable.
@BadSingletonBadSingleton mentioned this pull requestJan 24, 2022
5 tasks
@BadSingleton
Copy link
ContributorAuthor

Closing. Superseded by#1679

lostmsu pushed a commit that referenced this pull requestJan 25, 2022
Originally from PR#1402. The underlying bug is now fixed, but the testsare atill applicable.
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@filmorfilmorfilmor left review comments

@siebenmannsiebenmannsiebenmann left review comments

@lostmsulostmsulostmsu requested changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

5 participants
@BadSingleton@lostmsu@mjmvisser@filmor@siebenmann

[8]ページ先頭

©2009-2025 Movatter.jp