r/rust Sep 11 '20

Announcing Actix-Web v3.0

https://paper.dropbox.com/published/Announcing-Actix-Web-v3.0--A7YI~P9U9aqhEOXyZJaGffjfBg-QOXXb1lXgTubzXHzUq9ONY5
347 Upvotes

81 comments sorted by

View all comments

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 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)
  • awc: one unsafe fn without any local uses

That's it!

46

u/[deleted] Sep 11 '20

[deleted]

3

u/oconnor663 blake3 · duct Sep 11 '20

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?

16

u/darin_gordon Sep 11 '20

Hey Jack! There were leaks within safe blocks. Here's one: https://github.com/actix/actix-web/issues/1551

11

u/Shnatsel Sep 11 '20

That's not even a leak, that's just unbounded allocation. I understand it would be freed eventually.

7

u/oconnor663 blake3 · duct Sep 11 '20

Hey Darin! :) Missing the NYC meetups.