python-zstandard icon indicating copy to clipboard operation
python-zstandard copied to clipboard

Fix assertion failure when calling decompress multiple times

Open TheNeuralBit opened this issue 2 years ago • 3 comments

  • Add a test that emulates the calling pattern in https://github.com/apache/beam/issues/22939
  • Address the assertion failure by checking size of unused_data (please advise if there's a better solution here)

TheNeuralBit avatar Aug 31 '22 02:08 TheNeuralBit

It looks like I also need to turn off NDBEUG to keep the assert from being compiled out. We do this in internal tests, I'm not sure how to change it for this build system.

TheNeuralBit avatar Aug 31 '22 02:08 TheNeuralBit

Adding undef_macros = ["NDEBUG"] here does it: https://github.com/indygreg/python-zstandard/blob/6006fdf164ac0e89b260706a3e4ef5806aceffb6/setup_zstd.py#L114

But that will add it in releases as well.

TheNeuralBit avatar Aug 31 '22 02:08 TheNeuralBit

Thanks, @TheNeuralBit! I am also interested in this fix.

@indygreg, would it be possible to trigger the GitHub actions workflows so that we can see if there are any issues with this PR? Thank you!

tvalentyn avatar Sep 01 '22 22:09 tvalentyn