Live data from Hacker News

How a 20 year old bug in GTA San Andreas surfaced in Windows 11 24H2

cookieplmonster.github.io

231–240 of 315 posts

Re: How a 20 year old bug in GTA San Andreas surfaced in Windows 11 24H2

#231
post #206
post #179

Earlier quoted context omitted.

The problem is that after calling scanf(), the number of variables that are defined is a variable number. For example: int x, y, z; int n = scanf("%d %d %d", &x, &y, &z); At compile time, you can make no inferences about which of x, y, and z are defined, because that depends on the returned value n. There are many ways to branch out from this. One is to insist on definite assignment - so if we cannot prove all of the…

I interpret "don't allow unintialized locals when declared" as meaning that this call: int n = scanf("%d %d %d", &x, &y, &z); Would be caught, because it takes references to undeclared variables. To be allowed, the programmer would have to initialize the variables beforehand.

Then people would complain about the wasteful initialisation of out-params. Foolishly, perhaps

Re: How a 20 year old bug in GTA San Andreas surfaced in Windows 11 24H2

#232

Earlier quoted context omitted.

Nope. You have to remember https://www.hyrumslaw.com/ With a sufficient number of users of an API, it does not matter what you promise in the contract: all observable behaviors of your system will be depended on by somebody. If you promise randomization, then somebody will depend on that :) And then you can never remove it!

> If you promise randomization You don't. You say the order is undefined.

That isn't the point. In practice, if you provide randomness, it will be depended upon.

Re: How a 20 year old bug in GTA San Andreas surfaced in Windows 11 24H2

#233
post #142

Earlier quoted context omitted.

Any sane language would design a list iterator to follow the order of the list. No, the difference is when you're iterating over orderless hash-based sets or maps/dictionaries. Many languages choose to leave the iteration order undefined. I think Python did that up to a point, but afterward they defined dictionaries (but not sets) to be iterated over in the order that keys were added. Also, some languages intentional…

Best change ever, that. Now it would also be nice if sets were ordered too.

I am pretty sure there are trivial impls of sets with guaranteed iteration order in Python that use an underlying ordered map and a dummy value in each entry.

Re: How a 20 year old bug in GTA San Andreas surfaced in Windows 11 24H2

#234

Earlier quoted context omitted.

> If you promise randomization You don't. You say the order is undefined.

That isn't the point. In practice, if you provide randomness, it will be depended upon.

Why is that? Is that just bad coding habits?

Re: How a 20 year old bug in GTA San Andreas surfaced in Windows 11 24H2

#235
post #9

I always enjoy reading deeply technical writeups like these. I only wonder how much more rare they may or may not get in the AI era.

I don't think they will get more rare; there will always be a top % of engineers that do deep dives. I hope anyway. But AI won't replace them, nor did the past 50+ years of software development innovation. There's millions (tens of millions?) of higher programming language developers that don't know the difference between stack or heap besides maybe some theory they half remember from school but they don't care becau…

If your whole career will be using higher order languages with very little data stored on stack (vs heap), why should those programmers care? It seems like normal progression of more abstraction in the tools that we use. Similarly, I have programmed a lot of C and C++ in my career and I never once need assembly language. (I am expecting someone to pop in the convo here and tell me about how I am a terrible C/C++ programmer because I don't know any assembly.)

Re: How a 20 year old bug in GTA San Andreas surfaced in Windows 11 24H2

#236
post #17
post #9

I always enjoy reading deeply technical writeups like these. I only wonder how much more rare they may or may not get in the AI era.

i think the shift will be from craftmens to trademens in regards to general software engineers, but these are type of writes up stem of a artisan style all to its own.

What about the incredible front end Devs that only know JS/CSS/HTML? They can still be true craftspeople in their art, be it cross-browser/platform issues or performance tweaking.

Re: How a 20 year old bug in GTA San Andreas surfaced in Windows 11 24H2

#237
post #17

Earlier quoted context omitted.

i think the shift will be from craftmens to trademens in regards to general software engineers, but these are type of writes up stem of a artisan style all to its own.

We have been seeing this shift for a while, where "software engineers" graduate from 3 month bootcamps. Except now most likely they will not be earning 500k making crud apps.

I call bullshit. What 3mo bootcamp grads were earning 500k writing CRUD apps? Zero.

Re: How a 20 year old bug in GTA San Andreas surfaced in Windows 11 24H2

#238

IMHO, 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.

Then you are wasting runtime clock cycles randomizing lists.

You can get it pretty much for free by using a random salt with your hash function. This is also useful for avoiding DOS attacks using deliberate hash collisions to trigger quadratic behavior in your hash tables.

Re: How a 20 year old bug in GTA San Andreas surfaced in Windows 11 24H2

#239
post #71

> 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…

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.
Post reply on HN