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

Fixed segfault in ClassDerived.tp_dealloc#1330

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

Merged
filmor merged 4 commits intopythonnet:masterfromlosttech:bugs/1327
Dec 18, 2020

Conversation

lostmsu
Copy link
Member

@lostmsulostmsu commentedDec 17, 2020
edited
Loading

What caused the problem + fixes

  1. All reflected .NET types storedGCHandle pointing to their implementations past the last byte ofPyTypeObject. By addingIntPtr.Size to the size ofPyTypeObject for CLR metatype we ensure, that the necessary space is allocated without relying on Python never writing immediately aftertype instances.

  2. InClassDerivedObjecttp_dealloc tried to usetpHandle which was previously NULLed intp_clear. Fortunately,tpHandle inClassDerivedObject is merely a duplicate ofPyObject_TYPE(pyHandle), so could be read from there.

Does this close any currently open issues?

#1327

Because tp_clear sets tpHandle to NULL, it can't be used.Fortunately, we can simply read object's type from pyHandle.
@lostmsulostmsu changed the titleWIP on bug #1327Fixed segfault in ClassDerived.tp_deallocDec 18, 2020
@lostmsulostmsu marked this pull request as ready for reviewDecember 18, 2020 07:05
@lostmsulostmsu requested a review fromfilmorDecember 18, 2020 07:05
@filmorfilmor merged commit7e73b0d intopythonnet:masterDec 18, 2020
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@filmorfilmorfilmor approved these changes

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

Successfully merging this pull request may close these issues.

2 participants
@lostmsu@filmor

[8]ページ先頭

©2009-2025 Movatter.jp