Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Panic uninitialised linked hash map #167

Open
martinellison opened this issue Dec 19, 2020 · 2 comments
Open

Panic uninitialised linked hash map #167

martinellison opened this issue Dec 19, 2020 · 2 comments

Comments

@martinellison
Copy link

When I try to deserialise YAML using serde, I get the following traceback:

thread 'test::simple' panicked at 'attempted to leave type `linked_hash_map::Node<yaml::Yaml, yaml::Yaml>` uninitialized, which is invalid', /home/martin/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/mem/mod.rs:658:9
stack backtrace:
   0: rust_begin_unwind
             at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/panicking.rs:483
   1: core::panicking::panic_fmt
             at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/core/src/panicking.rs:85
   2: core::panicking::panic
             at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/core/src/panicking.rs:50
   3: core::mem::uninitialized
             at /home/martin/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/mem/mod.rs:658
   4: linked_hash_map::LinkedHashMap<K,V,S>::ensure_guard_node
             at /home/martin/.cargo/registry/src/github.com-1ecc6299db9ec823/linked-hash-map-0.5.2/src/lib.rs:174
   5: linked_hash_map::LinkedHashMap<K,V,S>::insert
             at /home/martin/.cargo/registry/src/github.com-1ecc6299db9ec823/linked-hash-map-0.5.2/src/lib.rs:304
   6: <serde_yaml::ser::SerializeMap as serde::ser::SerializeMap>::serialize_entry
             at /home/martin/.cargo/registry/src/github.com-1ecc6299db9ec823/serde_yaml-0.8.11/src/ser.rs:342
   7: <serde::private::ser::FlatMapSerializeStruct<M> as serde::ser::SerializeStruct>::serialize_field
             at /home/martin/.cargo/registry/src/github.com-1ecc6299db9ec823/serde-1.0.118/src/private/ser.rs:1282
@doronaco
Copy link

doronaco commented Dec 22, 2020

Just solved a similar problem.
For me it happend with rust version 1.48.0
After moving back to 1.47.0 it was solved

@fhennig
Copy link

fhennig commented Jan 17, 2021

I've had this issue and version 0.4.5 fixes it, thank you very much!

FooBarWidget added a commit to FooBarWidget/matchhostfsowner that referenced this issue Jan 31, 2022
Fixed by upgrading to yaml-rust 0.4.5 and linked-hash-map 0.5.4.
chyh1990/yaml-rust#167
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants