Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upPlatform interoperability weirdness #64
Closed
Comments
|
The reason that you are getting an out of memory error is because you are using SizeLimit::Infinite and the data trying to deserialize the Vec is malformed, causing it to pre-allocate a huge amount of memory crashing your program. As to why the data is malformed, I have no idea. Could you try the following:
|
|
Without further information, I'm going to close this. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have to admit I'm not 100% sure whether this problem is on bincode or flate2 (Zlib Encoder/Decoder)'s side, but I'm having trouble decoding a file I made on Linux in Windows 10. The file opens fine on the Linux install (and it's the same physical box so no weird hardware issues). Same version of Rust on both (nightly March 9, 2016). The struct is:
And AleSystemState is encoded/decoded as a
Vec<i8>. The file in question is a series of individual encodes ofRecordingStates (not a Vec, a series of individual ones). The first one is always aChangeGame(Rom,f32,f32)instruction. Action is justpub struct Action(pub i32);.I managed to track the error down to the line:
When I hit that line I do NOT get a normal Rust panic, instead I get:
self.decoderis aZlibDecoder<BufReader<File>>. The compression I encode with isBest.The file that's breaking is here:
https://www.dropbox.com/s/ry9zhzlanvxaqkr/data.games?dl=0
It looks like my project is on
0.4.0, but I observe the same behavior after bumping to0.5.1even after re-encoding/decoding.I'm trying to reproduce this with a smaller example, especially in order to determine if this is due to flate2 or this library. I'm only guessing bincode because of the size limit. I haven't had any luck triggering it so far though.