Skip to content
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

zlib sync-flush fix #33783

Closed
dbaarda mannequin opened this issue Jan 23, 2001 · 5 comments
Closed

zlib sync-flush fix #33783

dbaarda mannequin opened this issue Jan 23, 2001 · 5 comments
Assignees
Labels
extension-modules C modules in the Modules dir

Comments

@dbaarda
Copy link
Mannequin

dbaarda mannequin commented Jan 23, 2001

BPO 403373
Nosy @akuchling, @dbaarda
Files
  • None: None
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/akuchling'
    closed_at = <Date 2001-02-21.02:18:50.000>
    created_at = <Date 2001-01-23.16:15:54.000>
    labels = ['extension-modules']
    title = 'zlib sync-flush fix'
    updated_at = <Date 2001-02-21.02:18:50.000>
    user = 'https://github.com/dbaarda'

    bugs.python.org fields:

    activity = <Date 2001-02-21.02:18:50.000>
    actor = 'akuchling'
    assignee = 'akuchling'
    closed = True
    closed_date = None
    closer = None
    components = ['Extension Modules']
    creation = <Date 2001-01-23.16:15:54.000>
    creator = 'abo'
    dependencies = []
    files = ['3057']
    hgrepos = []
    issue_num = 403373
    keywords = ['patch']
    message_count = 5.0
    messages = ['35449', '35450', '35451', '35452', '35453']
    nosy_count = 3.0
    nosy_names = ['nobody', 'akuchling', 'abo']
    pr_nums = []
    priority = 'normal'
    resolution = None
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue403373'
    versions = []

    @dbaarda
    Copy link
    Mannequin Author

    dbaarda mannequin commented Jan 23, 2001

    This patch fixes the zlib decompress sync flush bug as reported in bug tracking.
    It also fixes the following minor bugs;
    avoids repeat calls to (in|de)flateEnd when destroying (de)compression objects
    raises exception when allocating unused_data fails
    fixes memory leak when allocating unused_data fails
    raises exception when allocating decompress data fails
    removes vestigial code from decompress flush now decompression returns all available data.
    tidies code so object compress/decompress/flush routines are consistant

    @dbaarda dbaarda mannequin closed this as completed Jan 23, 2001
    @dbaarda dbaarda mannequin assigned akuchling Jan 23, 2001
    @dbaarda dbaarda mannequin added the extension-modules C modules in the Modules dir label Jan 23, 2001
    @dbaarda dbaarda mannequin closed this as completed Jan 23, 2001
    @dbaarda dbaarda mannequin assigned akuchling Jan 23, 2001
    @dbaarda dbaarda mannequin added the extension-modules C modules in the Modules dir label Jan 23, 2001
    @nobody
    Copy link
    Mannequin

    nobody mannequin commented Jan 23, 2001

    Argh... my line by line fix list got munged. You'll have to apply imaginary comments to delimit each fix.

    The bug this fixes is 124981 "zlib decompress of sync-flushed data fails"

    A lot of the patch changes are simply whitespace changes to clean up the formating. The patch can probably be edited to only include the changes to the PyZlib_objdecompress routine to fix the most important bug, but this would leave the code even more inconsistant than it is. Most of the rest of the fixes are to make the other routines cleaner, though they do also fix the minor bugs mentioned.

    @akuchling
    Copy link
    Member

    Can you provide a test program that will demonstrate some of the bugs
    this patch fixes? I'd like to be able to do a before-and-after comparison.

    @dbaarda
    Copy link
    Mannequin Author

    dbaarda mannequin commented Feb 17, 2001

    There is an example program that triggers the main "sync-flush" bug attached to the bug report (I forget the id, but its fairly clearly labled in bug-tracking).

    As for the others, it's quite hard to actualy trigger some of these, and some of them are violations of the zlib interface that may or may not actualy cause problems with the current version of zlib. I'll go through them in detail now;

    Avoid repeat calls to (in|de)flateEnd: possably causes no problems with current version of zlib, but might in future releases. I haven't tested it, but if you really want I could whip something up that tests it.

    Raises exception when allocating unused_data fails, fixes memory leak when allocating unused_data fails, raises exception when allocating decompress data failes; These are all only tiggerable when memory allocation fails.

    Removes vistigial code from decompress flush; the fix to the main "sync-flush" bug ensures that decompress always returns all available data. This means that the decompress flush() can be simplified.

    tidies code etc; these are just code cleanups...

    @akuchling
    Copy link
    Member

    Checked in to revision 2.39 of zlibmodule.c (at long last); thanks!

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 9, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    extension-modules C modules in the Modules dir
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant