|
|
Log in / Subscribe / Register

Rust for embedded Linux kernels

Rust for embedded Linux kernels

Posted Apr 23, 2024 18:12 UTC (Tue) by AClwn (subscriber, #131323)
Parent article: Rust for embedded Linux kernels

The Rust compiler likes to move data around as a program runs; if that data happens to be a structure containing linked-list pointers, moving it will break the list and create hard-to-find bugs. Adding a list_head structure to an existing C structure can, as a result, break a Rust abstraction built on that structure in ways that are hard to detect automatically.

I would be interested in reading more detail about this. My high-level understanding of Rust is that it will refuse to compile when presented with code that could cause memory errors, but this text makes it sound as though Rust will actually introduce additional bugs by unsafely moving memory around because it doesn't understand pointers. What exactly happens when you add the aforementioned list_head structure? Do you get a compile failure or runtime bugs?


The LWN site is currently under high scraper load, so comment display has been suppressed for anonymous users. If you are a human, you may read the comments by clicking the button below:

Note: you can avoid this step in the future by logging into your LWN account.


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds