Hacker Newsnew | past | comments | ask | show | jobs | submit | lomase's commentslogin

Does Rust not have race conditions?

One of Rust's core guarantees is that a race condition in safe code will never cause UB. It might return a nondeterministic result, but that result will be safe and well-typed (for example, if it's a Vec, it will be a valid Vec that will behave as expected and, once you have a unique reference, is guaranteed not to change out from under you).

When talking about the kind that lead to torn memory writes, no it doesn't have those. To share between threads you need to go through atomics or mutexes or other protection methods.

Rust has double free concurrency bugs

https://materialize.com/blog/rust-concurrency-bug-unbounded-...

Lockbud: project detailing memory, concurrency bugs and panics for Rust. https://github.com/BurtonQin/lockbud

USENIX paper on model checking for Rust OS kernels uncovered 20 concurrency bugs across 12 modules in projects like Redox OS and Tock, including data races, deadlocks, and livelocks

https://www.usenix.org/system/files/atc25-tang.pdf


You've linked to a bug that was unintentional and was fixed.

Go allowing torn writes for their slices and interfaces (their fat pointer types) is intentional behavior in the go implementation and has no sign of being fixed.

Some one getting unsafe code unintentionally wrong is not an indication that any language lacks memory safety.


I see, you wish to limit the domain. Do safety issues in the async runtime count ? Or is even "async Rust" out of your criteria ?

What about this one ? "Futurelock in Tokyo" ? https://rfd.shared.oxide.computer/rfd/0609


> What about this one ? "Futurelock in Tokyo" ?

Deadlocks are not memory safety issues by the definition used in the OP. Furthermore, safe Rust is only intended to guarantee protection against data races, not race conditions in general.


What about these ones ? They are considered memory-safety/soundness issues

'static closures/FnDefs/futures with non-'static return type are unsound https://github.com/rust-lang/rust/issues/84366

Resolve unsound interaction between noalias and self-referential data (incl. generators, async fn) https://github.com/rust-lang/rust/issues/63818


I think this is starting to wander rather far afield from where this thread started...

But anyways, at least from a quick glance those would at the very least seem to run into codys' unintentional bug vs. intentional behavior distinction. The bugs you linked are... well... bugs that the Rust devs fully intend to fix regardless of whether any in-the-wild exploits ever arise. The Go data race issue, on the other hand, is an intentional implementation decision and the devs have not indicated any interest in fixing it so far.


Neither set of issues is apposite to MemorySafety.org. The whole thing is just a dumb language war spat.

Rust prevents data races, but not race conditions.

It is if for AI users who can't type code.

I am a heavy AI user and have been typing code for 3 decades :)

Ok, if you have such insight into development, why not leverage agents to type for you? What sort of problems have you faced that you are able to code against faster than you can articulate to an agent?

I have of course found some problems like this myself. But it's such a tiny portion of coding I really question why you can't leverage LLMs to make yourself more productive


Do you feel called out?

not at all, can’t feel called out by people who don’t have a clue what they are talking about :)

Why you waste your time with people who don't have a clue what they talk about and rush to reply them?

You replied 2 min after my comment... I am sorry you are that lonely on christmas day


thanks, bored at the airport :)

Expert vibe engineer sounds as silly as exper stackoverflow copypaster.

I ask the LLM to split the task for me. It shines.

Steam, +130 million users, biggest gamming store, multi billion dolar company, is offline every week for a few minutes.

99.999999 is so overated.


Maybe that is why is down.

On sales the store does not go down, but gets really slow.


Matlab has been proven to be a indispensable tool in many fields.

AI is the same, for example creating slop or virtual girlfriends.


Why every single post in HN has to come down to talk about AI sloop...

Pssst, I can write one in 1 minute.

I use this LLM called git clone.


vibe coders hate this one weird trick

.Net has never been something most of HN cares about.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: