Skip to content

Possible bug in GZipCodec decode with dictionary #45232

Open
@chocolatkey

Description

Dart SDK version: 2.12.0 (stable) (Thu Feb 25 19:50:53 2021 +0100) on "windows_x64" used to reproduce and test, but also an issue on Flutter (Android ARM64).

When decoding gzip data compressed with a custom dictionary using another language (go)'s implementation, Dart returns Filter error, bad data. However, the same content compressed using the custom dictionary in Dart works fine. That lead me to believe that it's a bug in my go code, however I then wrote an implementation in python, which is able to decode both the go and dart versions. This leads me to believe there is a bug in Dart's implementation. Strangely Dart sets the gzip flag for the OS to TOPS-20 (10) as well (although this is not a bug just strange behavior that maybe has to do with the issue).

I have managed to consistently reproduce this issue on Windows, and have attached a ZIP with some example files for testing/debugging. The files are as follows:

  • [pgd]: contains the python gzip module modified to support reading gzip files with custom dictionaries (just adds to the zlib call)
  • gdict.bin: the custom dictionary used
  • test.dart: the dart script used to create testpart.html.dart.gz and which also fails to decompress testpart.html.go.gz
  • test.py: the python script which can successfully decompress both .gz files
  • testpart.html: the test plaintext
  • testpart.html.dart.gz: the dictionary-compressed file created by test.dart
  • testpart.html.go.gz: the dictionary-compressed file created by the go backend

Please let me know if there's anything else I can provide anything else that may help, I'm eager to get this resolved.

Metadata

Assignees

No one assigned

    Labels

    P2A bug or feature request we're likely to work onarea-vmUse area-vm for VM related issues, including code coverage, and the AOT and JIT backends.library-iotriagedIssue has been triaged by sub teamtype-bugIncorrect behavior (everything from a crash to more subtle misbehavior)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions