Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32k
bpo-18060: Updating _fields_ of a derived struct type yields a bad cif#13374
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
Uh oh!
There was an error while loading.Please reload this page.
Conversation
the base class when computing the length of the derived class.
class of a Srtructure or Union derived subclass when cloning ormodifying the _fields_ array. The old behavior of using the numberof elements in the parent class can cause the array to be truncatedwhen it is copied, especially when there are multiple layers ofsubclassing. Tests are included.
I think there is a misunderstanding from your side. |
Now StgDictObject.length of Structure and Union is the number of allfields, including fields of superclases.
bedevere-bot commentedDec 26, 2023
🤖 New build scheduled with the buildbot fleet by@serhiy-storchaka for commite294757 🤖 If you want to schedule another build, you need to add the🔨 test-with-buildbots label again. |
bedevere-bot commentedDec 28, 2023
🤖 New build scheduled with the buildbot fleet by@serhiy-storchaka for commitcedea96 🤖 If you want to schedule another build, you need to add the🔨 test-with-buildbots label again. |
Thanks@websurfer5 for the PR, and@serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11. |
Thanks@websurfer5 for the PR, and@serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.12. |
Sorry,@websurfer5 and@serhiy-storchaka, I could not cleanly backport this to
|
Sorry,@websurfer5 and@serhiy-storchaka, I could not cleanly backport this to
|
… layers (pythonGH-13374)The length field of StgDictObject for Structure class contains nowthe total number of items in ffi_type_pointer.elements (excludingthe trailing null).The old behavior of using the number of elements in the parent class cancause the array to be truncated when it is copied, especially when thereare multiple layers of subclassing.(cherry picked from commit5f3cc90)Co-authored-by: Jeffrey Kintscher <49998481+websurfer5@users.noreply.github.com>Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
GH-113623 is a backport of this pull request to the3.12 branch. |
… layers (pythonGH-13374)The length field of StgDictObject for Structure class contains nowthe total number of items in ffi_type_pointer.elements (excludingthe trailing null).The old behavior of using the number of elements in the parent class cancause the array to be truncated when it is copied, especially when thereare multiple layers of subclassing.(cherry picked from commit5f3cc90)Co-authored-by: Jeffrey Kintscher <49998481+websurfer5@users.noreply.github.com>Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
GH-113624 is a backport of this pull request to the3.11 branch. |
GH-13374) (GH-113624)The length field of StgDictObject for Structure class contains nowthe total number of items in ffi_type_pointer.elements (excludingthe trailing null).The old behavior of using the number of elements in the parent class cancause the array to be truncated when it is copied, especially when thereare multiple layers of subclassing.(cherry picked from commit5f3cc90)Co-authored-by: Jeffrey Kintscher <49998481+websurfer5@users.noreply.github.com>
GH-13374) (GH-113623)The length field of StgDictObject for Structure class contains nowthe total number of items in ffi_type_pointer.elements (excludingthe trailing null).The old behavior of using the number of elements in the parent class cancause the array to be truncated when it is copied, especially when thereare multiple layers of subclassing.(cherry picked from commit5f3cc90)Co-authored-by: Jeffrey Kintscher <49998481+websurfer5@users.noreply.github.com>
…pythonGH-13374)The length field of StgDictObject for Structure class contains nowthe total number of items in ffi_type_pointer.elements (excludingthe trailing null).The old behavior of using the number of elements in the parent class cancause the array to be truncated when it is copied, especially when thereare multiple layers of subclassing.Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
…pythonGH-13374)The length field of StgDictObject for Structure class contains nowthe total number of items in ffi_type_pointer.elements (excludingthe trailing null).The old behavior of using the number of elements in the parent class cancause the array to be truncated when it is copied, especially when thereare multiple layers of subclassing.Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
…pythonGH-13374)The length field of StgDictObject for Structure class contains nowthe total number of items in ffi_type_pointer.elements (excludingthe trailing null).The old behavior of using the number of elements in the parent class cancause the array to be truncated when it is copied, especially when thereare multiple layers of subclassing.Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
… layers (pythonGH-13374) (pythonGH-113624)The length field of StgDictObject for Structure class contains nowthe total number of items in ffi_type_pointer.elements (excludingthe trailing null).The old behavior of using the number of elements in the parent class cancause the array to be truncated when it is copied, especially when thereare multiple layers of subclassing.(cherry picked from commit5f3cc90)Co-authored-by: Jeffrey Kintscher <49998481+websurfer5@users.noreply.github.com>Signed-off-by: Michał Górny <mgorny@gentoo.org>
… layers (pythonGH-13374) (pythonGH-113624)The length field of StgDictObject for Structure class contains nowthe total number of items in ffi_type_pointer.elements (excludingthe trailing null).The old behavior of using the number of elements in the parent class cancause the array to be truncated when it is copied, especially when thereare multiple layers of subclassing.(cherry picked from commit5f3cc90)Co-authored-by: Jeffrey Kintscher <49998481+websurfer5@users.noreply.github.com>Signed-off-by: Michał Górny <mgorny@gentoo.org>
… layers (pythonGH-13374) (pythonGH-113624)The length field of StgDictObject for Structure class contains nowthe total number of items in ffi_type_pointer.elements (excludingthe trailing null).The old behavior of using the number of elements in the parent class cancause the array to be truncated when it is copied, especially when thereare multiple layers of subclassing.(cherry picked from commit5f3cc90)Co-authored-by: Jeffrey Kintscher <49998481+websurfer5@users.noreply.github.com>Signed-off-by: Michał Górny <mgorny@gentoo.org>
Uh oh!
There was an error while loading.Please reload this page.
Use the size of thefields elements array in the parent class of a Srtructure or Union derived subclass when cloning or modifying thefields array. The old behavior of using the number of elements in the parent class can cause the array to be truncated when it is copied, especially when there are multiple layers of subclassing, which can result in segfaults or exceptions. Tests are included.
https://bugs.python.org/issue18060