Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34k
gh-105375: Explicitly initialise all{Pickler,Unpickler}Object fields#105686
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 our terms of service and privacy 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
erlend-aasland commented Jun 12, 2023 • edited by bedevere-bot
Loading Uh oh!
There was an error while loading. Please reload this page.
edited by bedevere-bot
Uh oh!
There was an error while loading. Please reload this page.
…fields PyObject_GC_New() only initialises the object header. All other fields must be explicitly initialised to prevent manipulation of uninitialised fields in dealloc. Align initialisation order with the layout of the object structs.
- Prepare memory allocations and new objects before calling PyObject_GC_New() - Initialise all fields at once using a series of assignments only - Use error labels for clarity
serhiy-storchaka left a comment
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.
I think that it is enough to set output_buffer = NULL.
erlend-aasland commented Jun 12, 2023
You also need to adjust |
miss-islington commented Jun 12, 2023
Thanks @erlend-aasland for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12. |
miss-islington commented Jun 12, 2023
Sorry, @erlend-aasland, I could not cleanly backport this to |
bedevere-bot commented Jun 12, 2023
GH-105710 is a backport of this pull request to the 3.12 branch. |
…fields (pythonGH-105686) All fields must be explicitly initialised to prevent manipulation of uninitialised fields in dealloc. Align initialisation order with the layout of the object structs. (cherry picked from commit ca3cc4b) Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
…Object fields (python#105686) All fields must be explicitly initialised to prevent manipulation of uninitialised fields in dealloc. Align initialisation order with the layout of the object structs. (cherry picked from commit ca3cc4b) Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
bedevere-bot commented Jun 12, 2023
GH-105711 is a backport of this pull request to the 3.11 branch. |
erlend-aasland commented Jun 12, 2023
Thanks for the review! |
… fields (GH-105686) (#105710) All fields must be explicitly initialised to prevent manipulation of uninitialised fields in dealloc. Align initialisation order with the layout of the object structs. (cherry picked from commit ca3cc4b) Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
* main: pythongh-105540: Fix code generator tests (python#105707) pythongh-105375: Explicitly initialise all{Pickler,Unpickler}Object fields (python#105686) pythongh-105331: Change `asyncio.sleep` to raise ``ValueError` for nan (python#105641) Remove support for legacy bytecode instructions (python#105705)
… fields (#105686) (#105711) * [3.11] gh-105375: Explicitly initialise all{Pickler,Unpickler}Object fields (#105686) All fields must be explicitly initialised to prevent manipulation of uninitialised fields in dealloc. Align initialisation order with the layout of the object structs. (cherry picked from commit ca3cc4b) Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
PyObject_GC_New() only initialises the object header. All other fields
must be explicitly initialised to prevent manipulation of uninitialised
fields in dealloc.
Align initialisation order with the layout of the object structs.