Comments (7)
Ignore the previous comment if you saw it.
Initially thought this could be a stdlib/rustc issue since the overflow was occurring between async function calls, only on Windows (couldn't reproduce on MacOS), and only in debug mode. Whilst it may still be, at least part of the cause seems to be the buffer size chosen for part of the reading. It was 64kb, which doesn't seem insane to me but apparently is too much in debug mode.. I guess?
At least a short term solution is to reduce it down to 16kb I guess, but that does also impact perf.
from rs-async-zip.
I'll look into the specifics of this in the future but I've gone and reduced it.
Should be fixed in version 0.0.7
. 👍
from rs-async-zip.
That sounds like a silly issue. Why would a read buffer of 64kb be too big in debug mode? I'll test moving my code into main for you and get back. Obviously more performance is better.
from rs-async-zip.
FYI @Majored, works fine with just main
for me too. I asked around on rust discord. Seems the Windows stack is only about 1mb where unix/linux has a higher stack size. So, if you're allocating more than that it's causing an issue. They suggest using a Vec if needing more, which I think is because it stores those on the heap.
from rs-async-zip.
Understand that, but that buffer is only ~6% of that stack size on Windows. There really shouldn't be too much else on the stack so the fact that the size is ballooning in debug mode is still just weird to me - along with the fact that removing that single indirection of the print_p4k_contents() fn is the difference between overflowing and not.
I feel like there's something else going on there but honestly, could be completely wrong. I'll leave it as is now with the reduced size. Want to keep everything stack-allocated where it can be.
from rs-async-zip.
Ok, just wanted to give you the info I found. I forgot to mention in the previous comment: They also said the compiler may be helpfully optimizing out the stack requirement when it's in main, and just skipping it entirely.
from rs-async-zip.
Ah, that makes a lot more sense then.
Thanks :)
from rs-async-zip.
Related Issues (20)
- deflate64 support
- Support to read Info-ZIP Unicode Path Extra Field HOT 1
- Incorrect Zip64 Header Implementation HOT 8
- Tokio file doesn't satisfy `tokio::fs::File: futures_lite::AsyncWrite` HOT 1
- Incorrect parsing of zip64 extended information field HOT 1
- New Release? HOT 3
- Offset and size of entry in archive HOT 1
- Parallel Zip Stream support HOT 2
- Async ZIP Streaming?... HOT 13
- Test failures on 32-bit arches HOT 2
- data descriptor not supported error HOT 11
- Broken pipe occurs. HOT 4
- Streaming - Write file in chunks HOT 2
- Option to compress externally and just store input compressed byte stream.
- a computed CRC32 value did not match the expected value - when CRC is in data_descriptor HOT 2
- Can't properly use the stream method
- SPECIFICATION.md is not redistributable HOT 3
- A way to `write_entry_stream` while retaining valid local file headers
- `tokio::io::AsyncRead`(`Ext`) doesn't seem to be implemented for `async_zip::tokio::read::ZipEntryReader` HOT 2
- OwnedEntryStreamWriter 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 rs-async-zip.