verus-lang / verus

Verified Rust for low-level systems code

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Verus fails to write to the interpreter log when run with multiple threads

parno opened this issue · comments

Given the program below, if we verify it with verus --log interpreter test.rs, Verus produces an empty log file in .verus-log/crate.interp. The sample problem occurs if we use --log-all. However, the interpreter logging works if Verus runs in single-threaded mode; i.e., if we run verus --num-threads 1 --log interpreter test.rs. This doesn't appear to affect other forms of logging, e.g., for SMT logging.

use vstd::prelude::*;

verus! {
    fn test() {
        assert(40 + 2 == 42) by(compute_only);
    }

    fn main() {}
}

Yes, there seems to have been an issue with the arguments: it used the wrong logging argument to check whether we want to have interpreter logging or not in the multi-threaded case.

The other issue was that the crate.interp was created regardless of whether we run multi-threaded or not. So when running multi-threading the log files are stored as $module.interp and the crate.interp was always empty.

Proposed fix in PR: #941