Fix pointer increment issue in _md_shrink causing memory corruption#1222
Fix pointer increment issue in _md_shrink causing memory corruption#1222bdraco merged 4 commits intoaio-libs:masterfrom
Conversation
CodSpeed Performance ReportMerging #1222 will not alter performanceComparing Summary
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1222 +/- ##
=======================================
Coverage 98.38% 98.39%
=======================================
Files 27 27
Lines 3973 3988 +15
Branches 730 735 +5
=======================================
+ Hits 3909 3924 +15
Misses 17 17
Partials 47 47
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
asvetlov
left a comment
There was a problem hiding this comment.
Looks good, thank you for the quick PR.
As you see, @webknjaz and I decided that even people with write access shouldn't push new branches in this repo but create forks instead.
The release process is still pretty similar: merge a PR with version bump and towncrier build applied, then switch to master, pull the latest changes, make a tag and push it.
If you have any problems, I could do release myself in the evening.
|
I'll yank 6.6.0 and 6.6.1 and do a release. Will ping if I have any issues |
|
Pushing tags in the upstream (aio-libs:multidict) is allowed, only new branches and direct commits to the master are forbidden. |
What do these changes do?
This PR addresses a subtle pointer arithmetic issue in the
_md_shrinkfunction that was part of the memory optimization improvements in PR #1200 (version 6.6.0).The
_md_shrinkfunction optimizes memory usage by compacting the internal hash table in-place when there are deleted entries. However, there was an edge case where the pointer increment logic didn't account for whennew_ep == old_ep(which occurs for the first non-deleted entry after deletions).This PR adjusts the pointer increment to happen for all non-deleted entries, ensuring the compaction process maintains data integrity throughout the operation.
Are there changes in behavior for the user?
No API or functionality changes. This fix ensures the memory optimization continues to work as intended while maintaining data integrity. Users who experienced stability issues with 6.6.0 should see those resolved.
Related issue number
Fixes #1221
Checklist