BurtonQin / lockbud

Statically detect memory, concurrency bugs and possible panic locations for Rust.
BSD 3-Clause "New" or "Revised" License
445 stars 25 forks source link

FP Panic Warning #62

Closed stoneman258 closed 1 month ago

stoneman258 commented 1 month ago

Description

I encountered an FP panic warning when usinglockbud` in my crate. The minmized code example is listed below. It seems lockbud adopts regular expression to recognize panic, which can easily lead to false positives (e.g., Link).

Case

fn main() {
    to_panic_report();
}
fn to_panic_report() {
    println!("...");
    // ...
}

Command

cargo lockbud -k panic

Result

PANIC[testa#0]: (DefId(0:3 ~ testa[3645]::main), bb0[0]): span[src/main.rs:2:5: 2:22 (#0)], outermost_span[src/main.rs:1:1: 3:2 (#0)], Panic(Instance { def: Item(DefId(0:4 ~ testa[3645]::to_panic_report)), args: [] })
testa: Panic: 1

Lockbud report a wrong panic warning.

BurtonQin commented 1 month ago

Thanks I will fix it ASAP.

BurtonQin commented 1 month ago

Fixed in https://github.com/BurtonQin/lockbud/commit/07ff4ad2c2d68a8f3d04e56c31ef2504f3462c87