memesearch
Linus Torvalds Memory Safety

Linus Torvalds Memory Safety

Download Find similar pictures
Text on the meme
From Linus Torvalds <> Date Wed, 14 Apr 2021 12:31:10 -0700 Subject Re: [PATCH 07/13] Rust: Kernel crate On Wed, Apr 14, 2021 at 11:47 AM <ojeda@kernel.org> wrote: > +#[alloc_error_handler] > +fn oom(_layout: Layout) -> ! { > + panic!("Out of memory!"); > +} > + > +#[no_mangle] > +pub fn __rust_alloc_error_handler(size: usize, align: usize) -> ! { > + panic!("Out of memory!"); > +} Again, excuse my lack of internal Rust knowledge, but when do these end up being an issue? If the Rust compiler ends up doing hidden allocations, and they then cause panics, then one of the main *points* of Rustification is entirely broken. That's 100% the opposite of being memory-safe at build time. An allocation failure in some random driver must never ever be something that the compiler just turns into a panic. It must be something that is caught and handled synchronously and results in an ENOMEM error return. So the fact that the core patches have these kinds of panic!("Out of memory!"); things in them as part of just the support infrastructure makes me go "Yeah, that's fundamentally wrong". And if this is some default that is called only when the Rust code doesn't have its error handling, then once again - I think it needs to be a *build-time* failure, not a runtime one. Because having unsafe code that will cause a panic only under very special situations that are hard to trigger is about the worst possible case. Linus panic!("Out of memory!"); here's your memory safety, bro..
What it means

На изображении Линус Торвальдс смеётся рядом со скриншотом электронного письма, посвящённого обработке ошибок выделения памяти в Rust и ядре Linux. Внизу крупно повторяется panic!("Out of memory!"); и саркастическая подпись «here's your memory safety, bro..». Мем высмеивает обещания безопасности памяти Rust, показывая, что аварийная паника при нехватке памяти якобы противоречит заявленной надёжности.

Who
Objects
Tags
Sources
Template
Laughing Linus Torvalds
Type
image
Size
800×675 · 103.3 KiB
Mood
sarcastic, mocking
Language
en
Added

Similar memes