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

Could not obtain Cargo metadata #11

Closed
Morganamilo opened this issue Aug 21, 2021 · 10 comments
Closed

Could not obtain Cargo metadata #11

Morganamilo opened this issue Aug 21, 2021 · 10 comments

Comments

@Morganamilo
Copy link

I'm trying to run rudra on https://github.com/archlinux/alpm.rs but there is an error.

morganamilo@Octavia master ~git/Rudra % PATH=$PATH:docker-helper docker-cargo-rudra ~/git/alpm.rs/alpm/
2021-08-21 12:15:24.016251 |INFO | [rudra-progress] Running cargo rudra
2021-08-21 12:15:24.211067 |ERROR| [rudra-progress] Could not obtain Cargo metadata

I think the issue might be because alpm.rs is in a workspace. But running a dir up doesn't work either.

@piano-man

This comment has been minimized.

@mcseemk

This comment has been minimized.

@Qwaz
Copy link
Member

Qwaz commented Aug 22, 2021

I pushed a commit that attempts to fix this. Could you test the latest master and see if it fixes your problem?

@Qwaz
Copy link
Member

Qwaz commented Aug 22, 2021

To clarify the problem:

  1. Rudra does not support Rust workspace. However, it should print "does not support workspace" in such cases.
  2. There was a bug in Cargo index management logic which makes Rudra to print "Could not obtain Cargo metadata" when docker-cargo-rudra is used right after a new RUDRA_RUNNER_HOME is set.

After the fix, running Rudra on a workspace should print "does not support workspace" correctly. For non-workspace projects, docker-cargo-rudra should work now.

@Morganamilo
Copy link
Author

So what am I meant to do and why can't I use a workspace project?

@Qwaz
Copy link
Member

Qwaz commented Aug 22, 2021

Rudra's cargo wrapper is based on cargo-miri's design, which had the same issue until it was eventually fixed in rust-lang/miri#1540. A PR that ports Miri's update to Rudra is welcome.

As a workaround, you can run cargo rudra inside each member in the workspace (in alpm.rs/alpm instead in alpm.rs). The docker wrapper doesn't fully support this scenario yet, so you might need to install Rudra on your host - see DEV.md for the instruction.

I can add another docker-helper script that makes this process easier for general cases. However, alpm.rs seems to require a special library that is not available in Debian (which Rudra's Dockerfile is based on) so you might still want to install Rudra on your host.

@Morganamilo
Copy link
Author

Right. I was assuming installing it natively would have the same issue.

@Morganamilo
Copy link
Author

2021-08-22 18:46:52.396436 |INFO | [rudra-progress] Running cargo rudra
2021-08-22 18:46:52.585671 |INFO | [rudra-progress] Running rudra for target lib:alpm
2021-08-22 18:46:53.011026 |INFO | [rudra-progress] Rudra started
2021-08-22 18:46:53.011155 |INFO | [rudra-progress] SendSyncVariance analysis started
2021-08-22 18:46:53.011163 |INFO | [rudra-progress] SendSyncVariance analysis finished
2021-08-22 18:46:53.011167 |INFO | [rudra-progress] UnsafeDataflow analysis started
2021-08-22 18:46:53.018732 |INFO | [rudra-progress] UnsafeDataflow analysis finished
2021-08-22 18:46:53.018743 |INFO | [rudra-progress] Rudra finished
2021-08-22 18:46:54.031907 |INFO | [rudra-progress] Rudra started
2021-08-22 18:46:54.032210 |INFO | [rudra-progress] SendSyncVariance analysis started
2021-08-22 18:46:54.032277 |INFO | [rudra-progress] SendSyncVariance analysis finished
2021-08-22 18:46:54.032281 |INFO | [rudra-progress] UnsafeDataflow analysis started
2021-08-22 18:46:54.074200 |INFO | [rudra-progress] UnsafeDataflow analysis finished
2021-08-22 18:46:54.074217 |INFO | [rudra-progress] Rudra finished
2021-08-22 18:46:54.955731 |WARN | [cargo_rudra] Target bench:list is not supported
2021-08-22 18:46:54.955758 |WARN | [cargo_rudra] Target custom-build:build-script-build is not supported
2021-08-22 18:46:54.955767 |INFO | [rudra-progress] cargo rudra finished

Does this mean it worked with 0 issues? I assume so.

So I am aware of some memory bugs in this version including issues with send/sync.

@Qwaz
Copy link
Member

Qwaz commented Aug 22, 2021

Glad it worked for you, and yes, that output means Rudra didn't report anything. Rudra identifies three specific bug patterns, and no report generated from Rudra does not guarantee the absence of memory safety bugs. We recommend using Rudra in complement with established secure coding methods - formal verification, test with Miri, etc.

@Qwaz
Copy link
Member

Qwaz commented Aug 22, 2021

Could you confirm that your issue has been resolved? If so, I'll close this issue and open another issue to track the status of general workspace support.

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

4 participants