Earlier quoted context omitted.
What happened to him?
https://randomascii.wordpress.com/2024/10/01/life-death-and-... https://randomascii.wordpress.com/2016/10/17/vestibular-dysf...
How a 20 year old bug in GTA San Andreas surfaced in Windows 11 24H2
241–250 of 315 posts
Re: How a 20 year old bug in GTA San Andreas surfaced in Windows 11 24H2
#242Earlier quoted context omitted.
There are various compiler options like -ftrivial-auto-var-init to initialize uninitialized variables to specific (or random) values in some situations, but overall, randomizing (or zeroing) the full content of the stack in each function call would be a horrendous performance regression and isn't done for this reason.
There are fast instructions (e.g., REP STOSx, AVX zero stores, dc zva) and tricks (MTE, zero pages), but no magic CPU instruction exists that transparently and efficiently randomizes or zeros the stack on function calls. You think there would be one and I bet there are on some specialized high-security systems, but I'm not sure even where you would find such a product. Telecom certainly isn't it.
As an additional protection, new stack frames are implicitly zeroed as they are created. I assume this is done by filling the CPU cache with zeros for those addresses before continuing to execute the called function. No need to wait for actual zeros to be written to main memory.
Re: How a 20 year old bug in GTA San Andreas surfaced in Windows 11 24H2
#243Earlier quoted context omitted.
Other than C#, there is no reason to use those other languages for game dev. Unless the game is fairly simple, or you want to risk a fairly long project by employing a language that hasn't been proven in tge space yet (Rust). No shade at any of those languages, I don't even like C#, just being pragmatic.
The most successful videogame of all time was written for Java as an applet in the browser.
Re: How a 20 year old bug in GTA San Andreas surfaced in Windows 11 24H2
#244Earlier quoted context omitted.
As if tools in early 2000's were any good...
Valgrind was released in 2002 to immediate celebration. It was available and surely known to the team. All they needed to do was write a unit test that loaded and instantiated those vehicle files and run it with "valgrind" in front of the command line.
Re: How a 20 year old bug in GTA San Andreas surfaced in Windows 11 24H2
#245Re: How a 20 year old bug in GTA San Andreas surfaced in Windows 11 24H2
#246Earlier quoted context omitted.
User has working software. User updates operating system. User has broken software. That's a problem for the party trying to sell operating system updates.
The software was fundamentally broken before the OS update. It was working by pure random chance with undefined behaviour. It’s a C++ issue, not an OS issue. The same code compiled for another OS would have different random results.
Re: How a 20 year old bug in GTA San Andreas surfaced in Windows 11 24H2
#247IMHO, if something isn’t part of the contract, it should be randomized. Eg if iteration order of maps isn’t guaranteed in your language, then your language should go out of its way to randomize it. Otherwise, you end up with brittle code: code that works fine until it doesn’t.
There are various compiler options like -ftrivial-auto-var-init to initialize uninitialized variables to specific (or random) values in some situations, but overall, randomizing (or zeroing) the full content of the stack in each function call would be a horrendous performance regression and isn't done for this reason.
For reference, the actual proposal that was accepted into C++26 is [2]. It discusses performance only in general, and it refers to an earlier analysis [3] for more details. This last reference describes regressions of around 0.5% in time and in code size. Earlier prototypes suggested larger regressions (perhaps even "horrendous") but more emphasis on compiler optimizations has brought the regression down considerably.
Of course one's mileage may vary, and one might also consider a 0.5% regression unacceptable. However, the C++ committee seems to have considered this to be an acceptable tradeoff to remove a frequent cause of undefined behavior from C++.
[1]: https://herbsutter.com/2024/08/07/reader-qa-what-does-it-mea...
[2]: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p27...
[3]: https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2723r1...
Re: How a 20 year old bug in GTA San Andreas surfaced in Windows 11 24H2
#248> all these findings prove that the bug is NOT an issue with Windows 11 24H2, as things like the way the stack is used by internal WinAPI functions are not contractual and they may change at any time, with no prior notice. The real issue here is the game relying on undefined behavior (uninitialized local variables), and to be honest, I’m shocked that the game didn’t hit this bug on so many OS versions, although as I…
[1]: https://herbsutter.com/2024/08/07/reader-qa-what-does-it-mea...
Re: How a 20 year old bug in GTA San Andreas surfaced in Windows 11 24H2
#249Earlier quoted context omitted.
As if tools in early 2000's were any good...
Valgrind was released in 2002 to immediate celebration. It was available and surely known to the team. All they needed to do was write a unit test that loaded and instantiated those vehicle files and run it with "valgrind" in front of the command line.
Re: How a 20 year old bug in GTA San Andreas surfaced in Windows 11 24H2
#250This reminds me of an excellent article I read a while back, the gist of it was that, given sufficient success, there's no such thing as a private API.