BurtonQin / lockbud

Statically detect memory, concurrency bugs and possible panic locations for Rust.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support for Tokio::sync primitives

agourlay opened this issue ยท comments

Thank you very much for this tool, it has helped me and my team several times to find critical deadlocks ๐Ÿ‘

The only missing part is having support for the primitives from Tokio::sync such as: RwLock & Mutex.

Is it even possible to track usage of asynchronous locks in a similar fashion?

If yes, I would be happy to help and contribute as it would be a game changer for my current usage of Rust.

Glad you are interested in my project. The representation of async's Mutex primitives in MIR is different from that of sync. But I believe it can be done, and it's something I've always wanted to do, but I'm short on time recently.

Happy to hear it is feasible ๐Ÿ‘

Could you please share some ideas to help me get started?

I have tried to add the detection of Tokio primitives in to the lock interest infrastructure.

It seems those new guards are now picked up by the analyzer but as far as I can tell the callgraphs for tokio::spawn are not generated so no deadlocks are detected.

Would also love to have support for tokio. Would be a game changer for my project. This is a massively cool project, thanks so much for your efforts.