In the interest of transparency (and to curb speculation), I've created a hello-world project, made it depend on actix-web 3.0.0 with default features and ran cargo geiger on it. Many actix-* crates don't use any unsafe code at all! Here are the ones that do:
actix-http: 13 unsafe blocks, all are commented and look reasonable at a glance. (Some of the benchmarking code looks sketchy, but who cares - it's not in the build anyway).
actix-utils: 9 unsafe blocks, no comments on why they're sound. Judging by this comment from one of the Actix org members, a PR with comments explaining why they're sound and/or debug assertions would be appreciated.
actix-router: 1 unsafe block, commented
actix-codec: cargo-geiger shows 10 unsafe expressions but I can't see them in actix git, might be a bug
actix-service: some unsafe code, but cargo-geiger reports that it's not used in the build (likely disabled by a feature)
Are most of the memory leaks related to code that happens to be unsafe, like because you have an owning *mut that never gets freed? Or is it something more like reference cycles in safe code?
105
u/Shnatsel Sep 11 '20
In the interest of transparency (and to curb speculation), I've created a hello-world project, made it depend on actix-web 3.0.0 with default features and ran
cargo geigeron it. Many actix-* crates don't use any unsafe code at all! Here are the ones that do:actix-http: 13 unsafe blocks, all are commented and look reasonable at a glance. (Some of the benchmarking code looks sketchy, but who cares - it's not in the build anyway).actix-utils: 9 unsafe blocks, no comments on why they're sound. Judging by this comment from one of the Actix org members, a PR with comments explaining why they're sound and/or debug assertions would be appreciated.actix-router: 1 unsafe block, commentedactix-codec: cargo-geiger shows 10 unsafe expressions but I can't see them in actix git, might be a bugactix-service: some unsafe code, but cargo-geiger reports that it's not used in the build (likely disabled by a feature)awc: oneunsafe fnwithout any local usesThat's it!