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

Errors returned by MetadataLoader are silently discarded #53381

Closed
bjorn3 opened this issue Aug 15, 2018 · 3 comments
Closed

Errors returned by MetadataLoader are silently discarded #53381

bjorn3 opened this issue Aug 15, 2018 · 3 comments

Comments

@bjorn3
Copy link
Member

bjorn3 commented Aug 15, 2018

No description provided.

@oli-obk
Copy link
Contributor

oli-obk commented Aug 15, 2018

Do you have some more info? Is this something users experience? Or is it mostly custom drivers running into problems?

@bjorn3
Copy link
Member Author

bjorn3 commented Aug 15, 2018

When implementing rustc::middle::cstore::MetadataLoader myself I accidentally tried to parse a different file type. This returned an error from get_rlib_metadata, but the error was never printed to the user, instead it said error[E0463]: can't find crate for `...` .

@bjorn3
Copy link
Member Author

bjorn3 commented Aug 15, 2018

Is this something users experience?

It's possible if an rlib/dylib gets corrupt, because then it won't say the file is corrupt.

Or is it mostly custom drivers running into problems?

Yes

kennytm added a commit to kennytm/rust that referenced this issue Sep 20, 2018
…crichton

Warn about metadata loader errors

Output when writing corrupting to libcore.rlib

```
warning: no metadata found: failed to read rlib metadata in '/Users/bjorn/Documents/rust_fork/build/x86_64-apple-darwin/stage1-std/x86_64-apple-darwin/release/deps/libcore-857d662d379c5d0c.rlib': File too small to be an archive

error[E0463]: can't find crate for `core`

error: aborting due to previous error
```

Fixes rust-lang#53381
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

2 participants