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

config-rs broken since rust 1.48 #158

Closed
dessalines opened this issue Oct 21, 2020 · 13 comments · Fixed by #169
Closed

config-rs broken since rust 1.48 #158

dessalines opened this issue Oct 21, 2020 · 13 comments · Fixed by #169

Comments

@dessalines
Copy link

dessalines commented Oct 21, 2020

We're trying to use config-rs using the latest rust nightly-1.49-0, and we're getting:

thread 'main' panicked at 'attempted to leave type `linked_hash_map::Node<std::string::String, value::Value>` uninitialized
, which is invalid', /home/tyler/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/
mem/mod.rs:659:9

I see this is also failing on your travis build too:

https://travis-ci.org/github/mehcode/config-rs/jobs/734764347#L291

cc @Nutomic

@joelgallant
Copy link
Collaborator

This is an upstream / rustc bug, no?

@dessalines
Copy link
Author

@dessalines
Copy link
Author

config-rs is now broken on rust 1.48.0.

@joelgallant
Copy link
Collaborator

A quick note - this is a test failure, originating in serde_hjson. Error is bubbling up from this line.

@endeav0r
Copy link

endeav0r commented Dec 2, 2020

This appears to be the offending line: https://github.com/contain-rs/linked-hash-map/blob/master/src/lib.rs#L174

linked-hash-map appears to be an old crate, with unsafe behavior. Allocated this type without initializing it, in this unsafe code, is what's throwing these errors. linked-hash-map is being used by yaml-rust, which is being used by config-rs. yaml-rust is maybe trying to replace linked-hash-map ( chyh1990/yaml-rust#157 ), which would most likely solve this issue.

Until then, I can't run my projects which rely on config-rs to parse yaml configurations :(.

@iruizr7
Copy link

iruizr7 commented Dec 4, 2020

This is happening now on last stable.

@martinellison
Copy link

I am getting this too.

@dessalines
Copy link
Author

One possibility would be for config-rs to use feature flags, so that the upstream broken yaml-rust library can be ignored entirely.

@mehcode
Copy link
Collaborator

mehcode commented Dec 17, 2020

config does actually, except they're all by-default enabled

config = { version = "*", default-features = false, features = [ "json", "toml" ] }

@dessalines
Copy link
Author

We are using config = { version = "0.10.1", default-features = false, features = ["hjson"] }, yet the build has still been failing since 1.48.0

Samuel-B-D added a commit to Samuel-B-D/saphir that referenced this issue Jan 15, 2021
richerarc pushed a commit to richerarc/saphir that referenced this issue Jan 20, 2021
* Bump serde_yaml version to solve an issue with linked_hash_map on rust 1.48.0.
We ran into the same bug than here: rust-cli/config-rs#158

* Added x-operation-name to the generated openapi yaml for better generated function name in tools such as ng-openapi-gen

* Bump saphir-cli revision
@dessalines
Copy link
Author

Since yaml-rust hasn't worked for the past two months, how about using https://github.com/dtolnay/serde-yaml as the yaml library instead?

@Nutomic
Copy link

Nutomic commented Feb 11, 2021

We were wrong about this, the problem isnt caused by yaml-rust but by hjson-rust itself. Here is the issue with some possible solutions:

hjson/hjson-rust#23 (comment)

@dessalines
Copy link
Author

Seems both libraries have the same ultimate problem: they're both using linked-hash-map, which is abandoned. They both need PRs to update to use the new https://github.com/kyren/hashlink library, which is maintained. Unfortunately yaml-rust's maintainers also seem to be unresponsive, as there's been a PR to merge hashlink that hasn't been looked at in months. Maybe hjson's maintainer will be more responsive.

@dessalines dessalines changed the title config-rs doesn't build on rust-nightly: linked_hash_map::Node<std::string::String, value::Value> uninitialized config-rs broken since rust 1.48 Feb 13, 2021
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

Successfully merging a pull request may close this issue.

7 participants