News for hackers. Stuff that matters.
Re:Some mistakes Rust doesn't catch by kaba0 on Tuesday February 08, 2022 @03:37AM (#30256128)
The thing is, C won’t even fail in a reproducible way. Good luck hunting down mistakes caused by uninitialized variables for example.

Sure, valgrind exists, but that is not native execution.

Re:Some mistakes Rust doesn't catch by bregma on Tuesday February 08, 2022 @06:53AM (#30257392)
Why would runtime checking for a condition that could be caught at build time be in any way a more desirable solution?
Re:Some mistakes Rust doesn't catch by 10000truths on Tuesday February 08, 2022 @05:47AM (#30256943)
MemorySanitizer will catch uninitialized variable errors.
Re:Some mistakes Rust doesn't catch by tialaramex on Tuesday February 08, 2022 @07:18AM (#30257564)
The Sanitizers catch errors that happen when they're running

So in many situations the Sanitizer gives you a false sense of security that your code is correct because in the test environment, with the Sanitizer, it works, and then in Production, without a Sanitizer, under some circumstances it blows up because those circumstances never arose in your test environment.

Compare (safe) Rust which doesn't have uninitialized variables, and even WUFFS which doesn't have array bounds errors. In both cases the entire problem doesn't exist, programs which exhibit this problem are not valid programs in those languages, which is great because we did not mean to write these programs anyway. Hooray.

Re:Some mistakes Rust doesn't catch by usrbinbash on Tuesday February 08, 2022 @03:39AM (#30256140)
The reproducible thing about this error would be: I forgot to initialize my variables.
Re:Some mistakes Rust doesn't catch by MereInterest on Tuesday February 08, 2022 @03:54AM (#30256214)
That results in undefined behavior, which is by definition, not reproducible.
Re:Some mistakes Rust doesn't catch by usrbinbash on Tuesday February 08, 2022 @04:47AM (#30256554)
The behavior of the program is not reproducible.

The cause of the error is.

Re:Some mistakes Rust doesn't catch by programmer_dude on Tuesday February 08, 2022 @06:01AM (#30257042)
I think you are confused. The cause is not something you reproduce. It just exists. You can however "isolate/determine" the root cause.
Re:Some mistakes Rust doesn't catch by usrbinbash on Tuesday February 08, 2022 @07:42AM (#30257727)
If I have 10 different errors, but the root cause for all of them is that I forgot to do something I should have done (initialize a variable), then the cause is the same across all 10 different errors. If I don't start initializing the variables, then I will continue to have erros (which may or may not be similar to each other), thus making the problem reproduceable.

The errors are not the problem, but the result of the underlying problem.

Re:Some mistakes Rust doesn't catch by MereInterest on Tuesday February 08, 2022 @11:16AM (#30260245)
If you have an error that only occurs on your computer, on your compiler version, on your particular optimization level, on this particular phase of the moon, how do you determine that the root cause is forgetting to initialize a variable? In the context of debugging, "reproducible" means "can reproduce that exact error in order to better identify the root cause", not "frequently occurs as a root cause".