Skip to content

CMake build giving invalid output or seg fault on some inputs using Z_FIXED #485

@chanphil

Description

@chanphil

The issue seems like it may depend on the system configuration, so I've including a minimalistic Dockerfile to create a clean test environment to demonstrate the issue. The Dockerfile is included in zlib_test.tar.gz, along with input data the hits the issue (test_data), a simple python program to run the input through zlib (test.py) and a shell script (run_test.sh) to demonstrate some of the strange behaviour I've observed. log.txt shows a run through this demonstration (the most interesting bits are at the bottom, the rest is mostly building up the docker container to run the tests).

To summarize my testing and observations:

  • I'm using the develop branch, but I've observed the issue on master as well.
  • The particular input data provided here exhibits two different failure modes depending on the compression level (crc error or seg fault). I have other failing inputs, and they all give some variation of an error indicating invalid input (not necessarily a crc error) when attempting to decompress the output from zlib, or a seg fault.
  • This issue appears to only occur when installing zlib using CMake. Using the configure script works fine with the test cases I have.
  • This issue appears to only occur when compressing using the Z_FIXED strategy.
  • As demonstrated in run_tests.sh, installing libpython3.6 via apt-get in the docker makes the issue go away, but it doesn't come back if libpython3.6 is purged via apt-get.
  • Despite what the above point would imply, the issue is not python specific. I've observed it while using zlib via C/C++ code, but that code was too deeply embedded into other code to easily pull out for a simple example. The libpython3.6 install makes the issue go away for the C/C++ code as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions