3 ms·
This comment reminded me of Redox (rust microkernel), which I haven’t looked at in a while. It’s an impressive project, but it was funny to see that in their to
by richard_todd 4y ago
This comment reminded me of Redox (rust microkernel), which I haven’t looked at in a while. It’s an impressive project, but it was funny to see that in their top news post, one of the items is about tracking down memory-corruption/use-after-free bugs:
> “After having thoroughly debugged the orbital/orblogin memory corruption bug with little success, I decided to go as far as phase out the old paging code (ActivePageTable/InactivePageTable/Mapper etc.) in favor of RMM (Redox Memory Manager). Surprisingly, this fixed the bug entirely in the process, and it turns out the issue was simply that parent page tables were not properly unmapped (causing use-after-free), most likely due to the coexistence of RMM and the old paging code, which did not agree on how the number of page table entries were counted.”
(https://www.redox-os.org/news/drivers-and-kernel-7/ https://www.redox-os.org/news/drivers-and-kernel-7/)
This project surely uses rust more thoroughly and idiomatically than the Linux kernel ever will. And yet here we are with memory corruption and use after free bugs. And the text indicates the bug was so hard to track down that they basically gave up and just replaced the old code.
Rust may prove to be beneficial to Linux, but there is too much over-promising hype at this point.
- UltraViolence 4y agoWhen you write an operating system you eventually will have to go down into the boiler room and write assembly and such. This is most likely where the bugs occur. Also, you need unsafe() blocks once in a while to interoperate with the extremely low-level assembler parts. So I'm not in the least surprised there are still memory corruption errors in Redox. Mind you the bug occurred in the memory paging code and was eventually fixed.
- richard_todd 4y agoYou literally said in another comment that rust is a "magic bullet" that will "put an end" to memory and thread bugs. That is clearly too much hype, when you can turn around and say you're not surprised that a rust microkernel still has memory corruption errors. Whether it's an unsafe() block, or that in a kernel a logic-bug can also be a memory-corrupting bug (and apparently a use-after-free bug), the fact remains: there's no magic bullet here. Just hopefully an overall improvement. We'll see.