Attempt to add with overflow
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 55/100
Research direction
Start by running the named data_storage::file_format::block::tests::creation_with_data_too_big_test test and inspect serialize_element in rmp-serde's encode.rs, along with UnknownLengthCompound. Done means the huge-data scenario no longer panics with an integer overflow and the relevant test passes.
Written by the indexing model from the issue text.
Description
The scenario. When a huge data chunk needs to be serialized. First it takes a very very long time and then the following issue occurs.
attempt to add with overflow
thread 'data_storage::file_format::block::tests::creation_with_data_too_big_test' (778007) panicked at /Users//.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rmp-serde-1.3.1/src/encode.rs:527:17:
attempt to add with overflow
it is in the encode this function:
fn serialize_element<T: ?Sized + Serialize>(&mut self, value: &T) -> Result<(), Self::Error> {
match self.compound.as_mut() {
None => value.serialize(&mut *self.se),
Some(buf) => {
value.serialize(&mut buf.se)?;
buf.elem_count += 1;
Ok(())
},
}
}
I think the fix would be to increase the the elem_count from u32 to an u64 for good measure.
Current:
#[derive(Debug)]
struct UnknownLengthCompound {
se: Serializer<Vec<u8>, DefaultConfig>,
elem_count: u32,
}
I can myself do this change and create a pull request. Though it is this small, so maybe you can fix it.
- Dominant language
- Rust
- Stars
- 1.4k
- Forks
- 162
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from 3Hren/msgpack-rust
-
Difficulty 1/5 Under an hour Newbie friendliness 68/100
3Hren/msgpack-rust#323 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
3Hren/msgpack-rust#389 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
3Hren/msgpack-rust#381 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 38/100
3Hren/msgpack-rust#380 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
3Hren/msgpack-rust#370 · 1 reaction ·
All issues in 3Hren/msgpack-rust
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
gitbutlerapp/gitbutler#15998 · 1 comment ·
-
bug triage:deciding
Difficulty 1/5 Under an hour Newbie friendliness 88/100
open-telemetry/otel-arrow#4132 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100