GithubHelp home page GithubHelp logo

Comments (4)

hermanventer avatar hermanventer commented on May 19, 2024

By design, cargo mirai behaves as much as possible as cargo check does. If you have not yet run cargo mirai on a workspace, it should be rebuilding all members of the workspace because it needs to run rustc with different compiler flags than is the case with cargo check.

Something that may be tripping you up is that you only see diagnostics for issues that are reachable from an entry point. Only public, non generic functions can be entry points. Even then, by default, you only see issues that are very likely to be real issues. See the discussion here: https://github.com/facebookexperimental/MIRAI/blob/main/documentation/Overview.md

It seems that a much more extensive tutorial would be useful. Perhaps we can collaborate on producing one. I have significant time constraints, so it would be very helpful if you take the lead on it, if this interests you.

from mirai.

hermanventer avatar hermanventer commented on May 19, 2024

Also, perhaps start out with MIRAI_FLAGS="--diag=paranoid" and then downgrade from there as you become more comfortable with how to run MIRAI and more annoyed with all the false positives.

from mirai.

TomMD avatar TomMD commented on May 19, 2024

Herman, thanks for taking the time to respond. Your reminder about reachability is great but I do still think there is a bug. Consider the earlier modification to examples/tag_analysis, making it a workspace with members of "timing_channels", "trait_methods", "verification_status". We can run cargo mirai and get no results. We can even make modifications to the main routine of trait_methods such as:

--- a/examples/tag_analysis/trait_methods/src/lib.rs
+++ b/examples/tag_analysis/trait_methods/src/lib.rs
@@ -46,6 +46,7 @@ impl ProcessWithoutTaint for Block {

 pub fn main() {
     let mut block = Block { content: 99991 };
+    add_tag!(&block, SecretTaint);
     verify!(does_not_have_tag!(&block, SecretTaint));

If we cd examples/tag_analysis/trait_methods ; cargo mirai then we do see the error on line 50 of a " provably false verification condition". So far so good.

If we cd examples/tag_anslysis ; cargo clean with our workspace in place and cargo mirai then there are absolutely no errors. Did I misunderstand? Should this issue errors for all reachable code for all packages in the workspace?

from mirai.

hermanventer avatar hermanventer commented on May 19, 2024

I think the problem might be due to a heuristic that causes MIRAI to suppress any error message that does not originate in the root crate of a compilation. Perhaps when you run it over a workspace such as examples/tag_analysis, it treats the workspace as the root and suppresses the errors that come from the members of the workspace. I don't have time to chase this down and fix it. If you set the directory to a particular example, you will see output.

from mirai.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.