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

Decompressor in C creates wrong output #17

Closed
DeeFuse opened this issue Jun 28, 2023 · 8 comments
Closed

Decompressor in C creates wrong output #17

DeeFuse opened this issue Jun 28, 2023 · 8 comments
Labels
bug Something isn't working

Comments

@DeeFuse
Copy link

DeeFuse commented Jun 28, 2023

Using the C code to compress and decompress a file does not result in the same uncompressed output.

The compressor produces the same output as the Python implementation but the C decomressor corrupts the data.
The first few bytes are correct but later into the decompression more and more bytes are wrong.

I used VisualStudio 2022 to build tamp as a x86 binary.

@BrianPugh
Copy link
Owner

Thanks for the bug report! Can you share the specific data that triggers this bug? Trying to figure out if it's some edge case in the compression algorithm, or it's some platform incompatibility that I need to fix. Thanks!

@DeeFuse
Copy link
Author

DeeFuse commented Jun 28, 2023

I've teste it with 663 bytes of binary data, mostly 0x00 (60%) and also ran a test using 1024 byte "Lorem ipsum" text as plaintext.

I got some "converting const uint16_t to uint8_t" warnings, but adjusting the functions did not change the output.

I've created a VS2022 project that demonstrates my problem:
TampTest.zip

@BrianPugh
Copy link
Owner

Can you share the code you are using to decompress? Just trying to narrow down the problem; the CLI uses the C decompressor by default and I haven't been able to observe any decompression corruption.

@DeeFuse
Copy link
Author

DeeFuse commented Jun 28, 2023

I used the code from the c-profiler to test the functionality.

You can also have a look into the attached zip in my last comment.

@BrianPugh
Copy link
Owner

BrianPugh commented Jun 28, 2023

I just manually tested the pip-installed CLI on windows (I rarely use windows) with the enwik8 dataset, as well as a 10,000 long lorem ipsum, and everything is working on fine, so going to need more information to reproduce.

EDIT: we were typing at the same time, looking at your stuff now :D

@BrianPugh
Copy link
Owner

you are correct, there must be a bug in the c-profiler code (honestly, that code was pretty rushed). I don't believe the bug is in the library itself, but in that script. I'll be investigating shortly and keep you updated. Issue is unrelated to Windows.

@BrianPugh
Copy link
Owner

Addressed in #18. I'll be releasing this and some minor performance improvements later today in v1.1.4. Thank you very much for the bug report!

@BrianPugh
Copy link
Owner

fixed in v1.1.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants