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

Behavior difference between static and not #105

Open
wcampbell0x2a opened this issue Jan 19, 2023 · 0 comments · Fixed by Portable-Network-Archive/liblzma-rs#19
Open

Behavior difference between static and not #105

wcampbell0x2a opened this issue Jan 19, 2023 · 0 comments · Fixed by Portable-Network-Archive/liblzma-rs#19

Comments

@wcampbell0x2a
Copy link

I'm currently using this library for my squashfs library and i'm trying to let the user build this library statically: wcampbell0x2a/backhand@master...add-xz-gzip-features

This library works great when building without the static features. However, when using this features the library gives different results breaking my tests and library when decompressing.

The first is an example of the beginning of the buffers being sent into the library:

extracting data @ offset 6a
before [fd, 37, 7a, 58, 5a, 00, 00, 01, 69, 22, de, 36, 03, c0, ea, fe, 01, 80, 80, 08]
after
before [fd, 37, 7a, 58, 5a, 00, 00, 01, 69, 22, de, 36, 03, c0, 9d, 83, 03, 80, 80, 08]
after
before [fd, 37, 7a, 58, 5a, 00, 00, 01, 69, 22, de, 36, 03, c0, d4, 84, 03, 80, 80, 08]
after
before [fd, 37, 7a, 58, 5a, 00, 00, 01, 69, 22, de, 36, 03, c0, d2, a4, 03, 80, 80, 08]
after
before [fd, 37, 7a, 58, 5a, 00, 00, 01, 69, 22, de, 36, 03, c0, 9b, d9, 03, 80, 80, 08]
after
before [fd, 37, 7a, 58, 5a, 00, 00, 01, 69, 22, de, 36, 03, c0, e7, 9e, 03, 80, 80, 08]
after
before [fd, 37, 7a, 58, 5a, 00, 00, 01, 69, 22, de, 36, 04, c1, cd, ff, 01, 80, 80, 08]
after
before [fd, 37, 7a, 58, 5a, 00, 00, 01, 69, 22, de, 36, 03, c0, e1, 98, 01, 80, 80, 08]
after
before [fd, 37, 7a, 58, 5a, 00, 00, 01, 69, 22, de, 36, 03, c0, b8, 9b, 01, 80, 80, 08]
after
before [fd, 37, 7a, 58, 5a, 00, 00, 01, 69, 22, de, 36, 03, c0, ee, 9b, 01, 80, 80, 08]
after
before [fd, 37, 7a, 58, 5a, 00, 00, 01, 69, 22, de, 36, 03, c0, e4, be, 01, 80, 80, 08]
after
before [fd, 37, 7a, 58, 5a, 00, 00, 01, 69, 22, de, 36, 03, c0, 87, 88, 02, 80, 80, 08]
after
before [fd, 37, 7a, 58, 5a, 00, 00, 01, 69, 22, de, 36, 03, c0, ac, aa, 02, 80, 80, 08]
after
before [fd, 37, 7a, 58, 5a, 00, 00, 01, 69, 22, de, 36, 03, c0, 86, fd, 01, 80, 80, 08]
after
before [fd, 37, 7a, 58, 5a, 00, 00, 01, 69, 22, de, 36, 03, c0, b0, a2, 02, 80, 80, 08]
after
before [fd, 37, 7a, 58, 5a, 00, 00, 01, 69, 22, de, 36, 03, c0, c6, fc, 01, 80, 80, 08]
after
before [fd, 37, 7a, 58, 5a, 00, 00, 01, 69, 22, de, 36, 03, c0, f2, 94, 02, 80, 80, 08]
after
before [fd, 37, 7a, 58, 5a, 00, 00, 01, 69, 22, de, 36, 03, c0, d4, f8, 01, 80, 80, 08]
after
before [fd, 37, 7a, 58, 5a, 00, 00, 01, 69, 22, de, 36, 03, c0, e1, b6, 02, 80, 80, 08]
after
before [fd, 37, 7a, 58, 5a, 00, 00, 01, 69, 22, de, 36, 03, c0, c8, 82, 03, 80, 80, 08]
after
before [fd, 37, 7a, 58, 5a, 00, 00, 01, 69, 22, de, 36, 03, c0, 84, b7, 02, 80, 80, 08]
after
before [fd, 37, 7a, 58, 5a, 00, 00, 01, 69, 22, de, 36, 03, c0, a2, 98, 01, 80, 80, 08]
after
before [fd, 37, 7a, 58, 5a, 00, 00, 01, 69, 22, de, 36, 03, c0, f6, 6d, 80, 80, 08, 21]
after
before [fd, 37, 7a, 58, 5a, 00, 00, 01, 69, 22, de, 36, 03, c0, 97, ad, 01, 80, 80, 08]
after
before [fd, 37, 7a, 58, 5a, 00, 00, 01, 69, 22, de, 36, 03, c0, 83, a2, 01, 80, 80, 08]
after
before [fd, 37, 7a, 58, 5a, 00, 00, 01, 69, 22, de, 36, 03, c0, bf, b5, 01, 80, 80, 08]
after
before [fd, 37, 7a, 58, 5a, 00, 00, 01, 69, 22, de, 36, 03, c0, c6, 8e, 01, 80, 80, 08]
after
before [fd, 37, 7a, 58, 5a, 00, 00, 01, 69, 22, de, 36, 03, c0, b1, d7, 01, 80, 80, 08]
after
before [fd, 37, 7a, 58, 5a, 00, 00, 01, 69, 22, de, 36, 03, c0, fe, bb, 01, 80, 80, 08]
after
before [fd, 37, 7a, 58, 5a, 00, 00, 01, 69, 22, de, 36, 03, c0, f6, 91, 01, 80, 80, 08]
after
before [fd, 37, 7a, 58, 5a, 00, 00, 01, 69, 22, de, 36, 03, c0, 8e, 7b, 80, 80, 08, 21]
after
before [fd, 37, 7a, 58, 5a, 00, 00, 01, 69, 22, de, 36, 03, c0, 85, 35, 80, 80, 08, 21]
after
before [fd, 37, 7a, 58, 5a, 00, 00, 01, 69, 22, de, 36, 03, c0, a5, 1a, 80, 80, 08, 21]
after
before [fd, 37, 7a, 58, 5a, 00, 00, 01, 69, 22, de, 36, 03, c0, dc, 37, 80, 80, 08, 21]
after
before [fd, 37, 7a, 58, 5a, 00, 00, 01, 69, 22, de, 36, 03, c0, d1, 25, 80, 80, 08, 21]
after
before [fd, 37, 7a, 58, 5a, 00, 00, 01, 69, 22, de, 36, 03, c0, f3, e0, 01, 80, 80, 08]
after
before [fd, 37, 7a, 58, 5a, 00, 00, 01, 69, 22, de, 36, 03, c0, a4, c4, 01, 80, 80, 08]
after
before [fd, 37, 7a, 58, 5a, 00, 00, 01, 69, 22, de, 36, 03, c0, d3, 29, 90, 81, 01, 21]
after
data bytes: 4a4090
extracting data @ offset 6a
before [fd, 37, 7a, 58, 5a, 00, 00, 01, 69, 22, de, 36, 03, c0, ea, fe, 01, 80, 80, 08]
after
before [fd, 37, 7a, 58, 5a, 00, 00, 01, 69, 22, de, 36, 03, c0, 9d, 83, 03, 80, 80, 08]
after
before [fd, 37, 7a, 58, 5a, 00, 00, 01, 69, 22, de, 36, 03, c0, d4, 84, 03, 80, 80, 08]
after
before [fd, 37, 7a, 58, 5a, 00, 00, 01, 69, 22, de, 36, 03, c0, d2, a4, 03, 80, 80, 08]
after
before [fd, 37, 7a, 58, 5a, 00, 00, 01, 69, 22, de, 36, 03, c0, 9b, d9, 03, 80, 80, 08]
after
before [fd, 37, 7a, 58, 5a, 00, 00, 01, 69, 22, de, 36, 03, c0, e7, 9e, 03, 80, 80, 08]
after
before [fd, 37, 7a, 58, 5a, 00, 00, 01, 69, 22, de, 36, 04, c1, cd, ff, 01, 80, 80, 08]
thread 'test_08' panicked at 'called `Result::unwrap()` on an `Err` value: StdIo(Custom { kind: InvalidInput, error: Options })', tests/test.rs:35:75
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

I remind you, both examples are extracting the same file. All I see is that the following byte is different:

                                                                                           \/
before [fd, 37, 7a, 58, 5a, 00, 00, 01, 69, 22, de, 36, 04, c1, cd, ff, 01, 80, 80, 08]

Any help would be appreciated.

wcampbell0x2a added a commit to wcampbell0x2a/backhand that referenced this issue May 31, 2023
This ony fixes the static issue for the binaries built in this repo, you
will need to define these yourself if using backhand as a library!

See:
- #150
- alexcrichton/xz2-rs#105
- alexcrichton/xz2-rs#111
ChanTsune added a commit to Portable-Network-Archive/liblzma-rs that referenced this issue Sep 24, 2023
ChanTsune added a commit to Portable-Network-Archive/liblzma-rs that referenced this issue Sep 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant