Skip to content

gh-67413: Fix segfaults and multiple leaks in the lzma and bz2 modules #7822

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

Merged
merged 4 commits into from
Feb 23, 2023

Conversation

ZackerySpytz
Copy link
Contributor

@ZackerySpytz ZackerySpytz commented Jun 20, 2018

lzma.LZMADecompressor and bz2.BZ2Decompressor objects caused
segfaults when their __init__() methods were not called.

lzma.LZMADecompressor, lzma.LZMACompressor, bz2.BZ2Compressor,
and bz2.BZ2Decompressor objects would leak locks and internal buffers
when their __init__() methods were called multiple times.

https://bugs.python.org/issue23224

Automerge-Triggered-By: GH:erlend-aasland

lzma.LZMADecompressor and bz2.BZ2Decompressor objects caused
segfaults when their __init__() methods were not called.

lzma.LZMADecompressor, lzma.LZMACompressor, bz2.BZ2Compressor, and
bz2.BZ2Decompressor objects would leak locks and internal buffers when
their __init__() methods were called multiple times.
@ZackerySpytz ZackerySpytz force-pushed the bpo-23224-lzma-bz2-segfault branch from a6f21a0 to 5152303 Compare June 20, 2018 15:16
@ZackerySpytz
Copy link
Contributor Author

ZackerySpytz commented Jun 20, 2018

It seems that this PR will also fix the issue described in bpo-33916 (gh-78097)1

Footnotes

  1. gh link added for convenience by @erlend-aasland

@vstinner
Copy link
Member

Hello @ZackerySpytz, since I merged my PR #7843, would you mind to rebase your change please? (merge master into your PR)

@ZackerySpytz
Copy link
Contributor Author

@vstinner Done.

@csabella
Copy link
Contributor

@ZackerySpytz, please rebase to resolve conflicts. Also, please address @izbyshev's review. Thanks!

@csabella
Copy link
Contributor

@ZackerySpytz ping

@gpshead
Copy link
Member

gpshead commented Mar 22, 2022

could this PR be updated?

Copy link
Contributor

@kumaraditya303 kumaraditya303 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are merge conflicts.

@erlend-aasland
Copy link
Contributor

There are merge conflicts.

I took the liberty to fix those; this looks like a PR worth landing, IMO.

@erlend-aasland erlend-aasland removed the request for review from vstinner February 23, 2023 08:19
@erlend-aasland
Copy link
Contributor

(Removed Victor from the review list, as he's off CPython these days.)

@erlend-aasland erlend-aasland added the 🔨 test-with-refleak-buildbots Test PR w/ refleak buildbots; report in status section label Feb 23, 2023
@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by @erlend-aasland for commit c9f1273 🤖

If you want to schedule another build, you need to add the 🔨 test-with-refleak-buildbots label again.

@bedevere-bot bedevere-bot removed the 🔨 test-with-refleak-buildbots Test PR w/ refleak buildbots; report in status section label Feb 23, 2023
@erlend-aasland
Copy link
Contributor

@kumaraditya303: thanks for the review. I did a small PEP-7 change to the added code in aad76e9. Will land when the CI is green.

@erlend-aasland
Copy link
Contributor

erlend-aasland commented Feb 23, 2023

Oh, Miss Islington was faster than GitHub; aad76e9 is now in limbo :)

No, my bad: I pushed to my fork instead of to this PR. Darn.

@erlend-aasland erlend-aasland changed the title bpo-23224: Fix segfaults and multiple leaks in the lzma and bz2 modules gh-67413: Fix segfaults and multiple leaks in the lzma and bz2 modules Feb 23, 2023
@kumaraditya303
Copy link
Contributor

Oh, Miss Islington was faster than GitHub; aad76e9 is now in limbo :)

"The missing piece of puzzle all come together when you least expect it." :)

@vstinner
Copy link
Member

vstinner commented Apr 5, 2023

Better late than never! Thanks @ZackerySpytz for the initial fix and @erlend-aasland for the updates.

JelleZijlstra pushed a commit to JelleZijlstra/cpython that referenced this pull request Sep 10, 2024
…es (pythonGH-7822)

lzma.LZMADecompressor and bz2.BZ2Decompressor objects caused
segfaults when their `__init__()` methods were not called.

lzma.LZMADecompressor, lzma.LZMACompressor, bz2.BZ2Compressor,
and bz2.BZ2Decompressor objects would leak locks and internal buffers
when their `__init__()` methods were called multiple times.


https://bugs.python.org/issue23224
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.