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

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

Merged
serhiy-storchaka merged 12 commits intopython:mainfromwebsurfer5:fix-issue-18060
Jan 1, 2024

Conversation

websurfer5
Copy link
Contributor

@websurfer5websurfer5 commentedMay 17, 2019
edited by bedevere-bot
Loading

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

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

I think there is a misunderstanding from your side.size is not the size of theffi_type_pointer.elements array. It is the size of the structure or the union.

Now StgDictObject.length of Structure and Union is the number of allfields, including fields of superclases.
@serhiy-storchakaserhiy-storchaka added the 🔨 test-with-buildbotsTest PR w/ buildbots; report in status section labelDec 26, 2023
@bedevere-bot
Copy link

🤖 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-botbedevere-bot removed the 🔨 test-with-buildbotsTest PR w/ buildbots; report in status section labelDec 26, 2023
@serhiy-storchaka
Copy link
Member

New tests are failed on the following buildbots:
https://buildbot.python.org/all/#/builders/256/builds/1322
https://buildbot.python.org/all/#/builders/390/builds/1322
https://buildbot.python.org/all/#/builders/356/builds/1247
https://buildbot.python.org/all/#/builders/111/builds/1264
https://buildbot.python.org/all/#/builders/403/builds/1266
https://buildbot.python.org/all/#/builders/239/builds/1273
https://buildbot.python.org/all/#/builders/232/builds/1254
https://buildbot.python.org/all/#/builders/178/builds/1451
https://buildbot.python.org/all/#/builders/370/builds/1290
https://buildbot.python.org/all/#/builders/177/builds/1298
https://buildbot.python.org/all/#/builders/170/builds/1285
https://buildbot.python.org/all/#/builders/420/builds/1281
https://buildbot.python.org/all/#/builders/276/builds/1291
https://buildbot.python.org/all/#/builders/558/builds/1511
https://buildbot.python.org/all/#/builders/332/builds/1321

@serhiy-storchakaserhiy-storchaka added the 🔨 test-with-buildbotsTest PR w/ buildbots; report in status section labelDec 28, 2023
@bedevere-bot
Copy link

🤖 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.

@bedevere-botbedevere-bot removed the 🔨 test-with-buildbotsTest PR w/ buildbots; report in status section labelDec 28, 2023
@serhiy-storchakaserhiy-storchaka merged commit5f3cc90 intopython:mainJan 1, 2024
@serhiy-storchakaserhiy-storchaka added the needs backport to 3.11only security fixes labelJan 1, 2024
@serhiy-storchakaserhiy-storchaka added the needs backport to 3.12only security fixes labelJan 1, 2024
@miss-islington-app
Copy link

Thanks@websurfer5 for the PR, and@serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11.
🐍🍒⛏🤖

@miss-islington-app
Copy link

Thanks@websurfer5 for the PR, and@serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.12.
🐍🍒⛏🤖

@miss-islington-app
Copy link

Sorry,@websurfer5 and@serhiy-storchaka, I could not cleanly backport this to3.11 due to a conflict.
Please backport usingcherry_picker on command line.

cherry_picker 5f3cc90a12d6df404fd6f48a0df1334902e271f2 3.11

@miss-islington-app
Copy link

Sorry,@websurfer5 and@serhiy-storchaka, I could not cleanly backport this to3.12 due to a conflict.
Please backport usingcherry_picker on command line.

cherry_picker 5f3cc90a12d6df404fd6f48a0df1334902e271f2 3.12

serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this pull requestJan 1, 2024
… 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>
@bedevere-app
Copy link

GH-113623 is a backport of this pull request to the3.12 branch.

@bedevere-appbedevere-appbot removed the needs backport to 3.12only security fixes labelJan 1, 2024
serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this pull requestJan 1, 2024
… 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>
@bedevere-app
Copy link

GH-113624 is a backport of this pull request to the3.11 branch.

@bedevere-appbedevere-appbot removed the needs backport to 3.11only security fixes labelJan 1, 2024
serhiy-storchaka added a commit that referenced this pull requestJan 1, 2024
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>
serhiy-storchaka added a commit that referenced this pull requestJan 5, 2024
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>
kulikjak pushed a commit to kulikjak/cpython that referenced this pull requestJan 22, 2024
…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>
aisk pushed a commit to aisk/cpython that referenced this pull requestFeb 11, 2024
…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>
Glyphack pushed a commit to Glyphack/cpython that referenced this pull requestSep 2, 2024
…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>
gentoo-bot pushed a commit to gentoo/cpython that referenced this pull requestSep 19, 2024
… 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>
gentoo-bot pushed a commit to gentoo/cpython that referenced this pull requestSep 19, 2024
… 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>
gentoo-bot pushed a commit to gentoo/cpython that referenced this pull requestSep 19, 2024
… 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>
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@auvipyauvipyauvipy approved these changes

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

6 participants
@websurfer5@serhiy-storchaka@bedevere-bot@auvipy@the-knights-who-say-ni@ezio-melotti

[8]ページ先頭

©2009-2025 Movatter.jp