Comments (18)
Will look into it.
from deflate-rs.
Yes, I'm unable to trigger the assert now. Great work!
from deflate-rs.
Thanks for the report. Would it be posible to provide the data/image you used? I haven't managed to reproduce it.
from deflate-rs.
I'm following a tutorial on raytracers and the problem might very likely be in my code. :-)
Please have a look:
stingray.tar.gz
EDIT: Let me add that the assert started kicking in at version 0.7.7
from deflate-rs.
It makes sense that it started in 0.7.7 since that was when the assertion was put in. I'm pretty sure it's a problem in deflate though, that assert shouldn't trigger on an user error.
from deflate-rs.
It was definitely my error :), I think I've sorted it, there was an issue causing the compressor to end earlier than it should. Your code works fine for me with 0.7.9 now, let me know if it's fixed for you.
from deflate-rs.
0.7.9 fixed my issue. Thanks a lot! :-)
from deflate-rs.
I've triggered this same assertion on deflate 0.7.10. I am saving a 20,000 x 20,000 png image.
thread 'main' panicked at 'assertion failed: `(left == right)` (left: `400020000`, right: `400052768`)', C:\Users\Seekr\.cargo\registry\src\github.com-1ecc6299db9ec823\deflate-0.7.10\src\writer.rs:50
stack backtrace:
0: std::sys_common::backtrace::_print
1: std::panicking::default_hook::{{closure}}
2: std::panicking::default_hook
3: std::panicking::rust_panic_with_hook
4: std::panicking::begin_panic
5: std::panicking::begin_panic_fmt
6: <deflate::writer::ZlibEncoder<W>>::output_all
at C:\Users\Seekr\projects\rust\single\Buddhabrot\buddhabrot-cli/<panic macros>:8
at C:\Users\Seekr\.cargo\registry\src\github.com-1ecc6299db9ec823\deflate-0.7.10\src/writer.rs:189
7: buddhabrot::bucket_field::nonatomic_bucket_field::NonatomicBucketField::save_png
at C:\Users\Seekr\.cargo\registry\src\github.com-1ecc6299db9ec823\deflate-0.7.10\src/writer.rs:196
at C:\Users\Seekr\.cargo\registry\src\github.com-1ecc6299db9ec823\png-0.7.0\src/encoder.rs:137
at C:\Users\Seekr\.cargo\registry\src\github.com-1ecc6299db9ec823\image-0.13.0\./src/png.rs:110
at C:\Users\Seekr\projects\rust\single\Buddhabrot\buddhabrot\src\bucket_field/nonatomic_bucket_field.rs:40
8: buddhabrot_cli::run
at C:\Users\Seekr\projects\rust\single\Buddhabrot\buddhabrot\src/setup.rs:101
at src/main.rs:46
9: buddhabrot_cli::main
at C:\Users\Seekr\projects\rust\single\Buddhabrot\buddhabrot-cli/<quick_main macros>:4
10: _rust_maybe_catch_panic
11: std::rt::lang_start
12: _tmainCRTStartup
13: mainCRTStartup
14: unit_addrs_search
from deflate-rs.
That's a pretty large file, I will see if I can reproduce it.
from deflate-rs.
Okay, I may or may not have fixed it in the last commit, does using deflate from the latest git solve the issue. Also, does it output a valid file in release mode?
from deflate-rs.
I'm still able to trigger the assert. I'm compiling with opt-level = 3
.
thread 'main' panicked at 'assertion failed: `(left == right)` (left: `400020000`, right: `400052768`)', C:\Users\Seekr\.cargo\git\checkouts\deflate-rs-44887ade842f84eb\f2c71f8\src\writer.rs:53
stack backtrace:
0: std::sys_common::backtrace::_print
1: std::panicking::default_hook::{{closure}}
2: std::panicking::default_hook
3: std::panicking::rust_panic_with_hook
4: std::panicking::begin_panic
5: std::panicking::begin_panic_fmt
6: <deflate::writer::ZlibEncoder<W>>::output_all
at C:\Users\Seekr\projects\rust\single\Buddhabrot\buddhabrot-cli/<panic macros>:8
at C:\Users\Seekr\.cargo\git\checkouts\deflate-rs-44887ade842f84eb\f2c71f8\src/writer.rs:183
7: buddhabrot::bucket_field::nonatomic_bucket_field::NonatomicBucketField::save_png
at C:\Users\Seekr\.cargo\git\checkouts\deflate-rs-44887ade842f84eb\f2c71f8\src/writer.rs:190
at C:\Users\Seekr\.cargo\registry\src\github.com-1ecc6299db9ec823\png-0.7.0\src/encoder.rs:137
at C:\Users\Seekr\.cargo\registry\src\github.com-1ecc6299db9ec823\image-0.13.0\./src/png.rs:110
at C:\Users\Seekr\projects\rust\single\Buddhabrot\buddhabrot\src\bucket_field/nonatomic_bucket_field.rs:40
8: buddhabrot_cli::run
at C:\Users\Seekr\projects\rust\single\Buddhabrot\buddhabrot\src/setup.rs:101
at src/main.rs:46
9: buddhabrot_cli::main
at C:\Users\Seekr\projects\rust\single\Buddhabrot\buddhabrot-cli/<quick_main macros>:4
10: _rust_maybe_catch_panic
11: std::rt::lang_start
12: _tmainCRTStartup
13: mainCRTStartup
14: unit_addrs_search
from deflate-rs.
Okay, I managed to reproduce the issue thanks to rust-fuzz.
from deflate-rs.
I think I've sorted this in the latest git, I will make a new release soon, does it solve your issue?
from deflate-rs.
Okay, thanks for the report.
from deflate-rs.
I'm getting this same assertion using 0.8.1: issue18.tar.gz
$ cargo run
Updating crates.io index
Finished dev [unoptimized + debuginfo] target(s) in 0.34s
Running `target/debug/conv`
thread 'main' panicked at 'assertion failed: `(left == right)`
left: `36725`,
right: `69494`', /home/lane/.cargo/registry/src/github.com-1ecc6299db9ec823/deflate-0.8.1/src/writer.rs:54:5
(found originally trying to track down this issue, then I reduced the size of the crashing test data)
It looks like something about if the first block returns BufferFull, but that's about where my debugging prowess ends.
from deflate-rs.
I wasn't able to reproduce the issue just using deflate_bytes and sending the data all in one call. The issue18.tar.gz file contains good and bad data examples, base64 encoded such that each line is a different call to write_all on a ZlibEncoder.
from deflate-rs.
Yeah I noticed. Found that if I disable the assertion the compressed data comes out wrong when I looked into it, so the assertion is working as intended in this case. Didn't have time to look into it further.
from deflate-rs.
I guess that means that the debug assertion is working at least :D Let me know if there are any tests I can run to help.
from deflate-rs.
Related Issues (20)
- Proper writer behaviour
- Hash chains are not updated correctly in some cases. HOT 1
- deepin linux build error HOT 8
- Assertion error from fuzzing HOT 1
- Follow API guidelines
- dictionary support
- Port fast mode from miniz
- libflate link in README is broken HOT 1
- Panic on mips64 / mips64el HOT 4
- Remove the flate2 dev-dependency HOT 4
- Panic in `ChainedHashTable::add_hash_value` when encoding HOT 2
- Remove use of deprecated mem::uninitialized HOT 1
- AFL crash HOT 3
- More AFL crashes HOT 3
- Internal assertion fails at images larger than 4800×4800 HOT 6
- Readme claims no unsafe but there is one HOT 1
- Flushing `ZlibEncoder` loops infinitely on some writers HOT 2
- v0.8.5 generates invalid PNGs HOT 7
- Is this project only for deflate usage? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from deflate-rs.