this post was submitted on 21 Jan 2024
787 points (93.4% liked)

Programmer Humor

32739 readers
754 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 13 points 11 months ago (1 children)
[–] [email protected] 2 points 11 months ago (2 children)

Leaks aren't usually security critical though, and I've never heard of sudo triggering the OOM killer.

Also, no general purpose language that I'm aware of can guarantee a lack of memory leaks.

[–] [email protected] 7 points 11 months ago (2 children)

no general purposd language can guarantee a lack of memory leaks

You're going to summon every Rust enthusiast on the platform

[–] [email protected] 1 points 11 months ago

I am myself a crustacean, and we crabs know that lack of memory leaks is not one of the guarantees of safe rust.

[–] [email protected] 1 points 11 months ago

crab_with_glowing_eyes.jpg

[–] [email protected] 2 points 11 months ago

Especially since sudo is generally quite short lived. Unless it is leaking a significant amount of memory waiting for authentication that never comes it is insignificant. It would actually be pretty easy to argue that sudo just shouldn't free memory at all. This would be better for security (all pointers live forever) and possibly faster as upon exec the kernel can just wipe all state rather than having free carefully account for the releases.