Giter VIP home page Giter VIP logo

Comments (18)

oyvindln avatar oyvindln commented on June 5, 2024 2

Will look into it.

from deflate-rs.

Seeker14491 avatar Seeker14491 commented on June 5, 2024 1

Yes, I'm unable to trigger the assert now. Great work!

from deflate-rs.

oyvindln avatar oyvindln commented on June 5, 2024

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.

uggwar avatar uggwar commented on June 5, 2024

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.

oyvindln avatar oyvindln commented on June 5, 2024

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.

oyvindln avatar oyvindln commented on June 5, 2024

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.

uggwar avatar uggwar commented on June 5, 2024

0.7.9 fixed my issue. Thanks a lot! :-)

from deflate-rs.

Seeker14491 avatar Seeker14491 commented on June 5, 2024

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.

oyvindln avatar oyvindln commented on June 5, 2024

That's a pretty large file, I will see if I can reproduce it.

from deflate-rs.

oyvindln avatar oyvindln commented on June 5, 2024

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.

Seeker14491 avatar Seeker14491 commented on June 5, 2024

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.

oyvindln avatar oyvindln commented on June 5, 2024

Okay, I managed to reproduce the issue thanks to rust-fuzz.

from deflate-rs.

oyvindln avatar oyvindln commented on June 5, 2024

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.

oyvindln avatar oyvindln commented on June 5, 2024

Okay, thanks for the report.

from deflate-rs.

lkolbly avatar lkolbly commented on June 5, 2024

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.

lkolbly avatar lkolbly commented on June 5, 2024

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.

oyvindln avatar oyvindln commented on June 5, 2024

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.

lkolbly avatar lkolbly commented on June 5, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.