5 ms·
This issue outlines one of the problems with memory safety which is not fixed. Since you don't believe outsiders, look at your own tickets, where your own devel
by rurban 8y ago
This issue outlines one of the problems with memory safety which is not fixed. Since you don't believe outsiders, look at your own tickets, where your own developers admit unsafety. There are probably more, this is just the first I found.
But the general problem is that rust cannot be made memory safe at all with its current architecture. Overlarge alloca calls are unsafe by default (either accept compile-time failures or accept run-time stack failures on new threads), and the strategy with global containers and references into it is unsafe. Even when rust would remove its unsafe keyword, and disallow malloc via ffi.
Maybe you should fix your attitude towards your unsafeties.
- dbaupp 8y agoI see no mention of memory safety or unsafety in the issue you linked. Could you be more specific?
- rurban 8y agoI don't need to be more specific. Read the ticket outlining the alloca problems. It cannot get more safety relevant. "Unresolved questions: * [ ] How can we mitigate the risk of unintended unsized or large allocas? Note that the problem already exists today with large structs/arrays. A MIR lint against large/variable stack sizes would probably help users avoid these stack overflows. Do we want it in Clippy? rustc? * [ ] How do we handle truely-unsized DSTs when we get them? They can theoretically be passed to functions, but they can never be put in temporaries."
- dbaupp 8y agoThat is a feature that is not yet implemented! Of course there may be unsolved questions. Neither of those are memory safety relevant. (A stack overflow is a reliable crash, not memory corruption, in Rust.)