Live data from Hacker News

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

cookieplmonster.github.io

151–160 of 315 posts

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

#151
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 because they don't have to think about it for their day job.

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

#152
post #144

Earlier quoted context omitted.

The compiler has no way of knowing that the memory would be undefined, not unless it somehow can verify the data file. The most I think it can do is flag the program for not checking the return value of scanf, but even that is unlikely to be true since the program probably was checking for end of file which is also in the return value. It was failing to check the number of matched parameters. This is the kind of erro…

> The compiler has no way of knowing that the memory would be undefined Yes it would. -fsanitize=address does a bunch of instrumentation - it allocates shadow memory to keep track of what main memory is defined, and it checks every read and write address against the shadow memory. It is a combination of compile-time instrumentation and run-time checking. And yes, it is expensive, so it should be used for debugging an…

This codebase predates ASAN by the best part of a decade.

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

#153

Earlier quoted context omitted.

Raymond is a wizard. Read his blogs for many years and love his style and knowledge.

Raymond knows everything. From microcode bugs on Alpha AXP to template meta programming to UI.

I wonder how many times a Deloitte, PwC, KPMG, Bain, EY, McKinsey, or BCG consultant naively tried putting him on a shortlist for being “impacted” over the years because he was in the Top X of a spreadsheet sorted on Y.

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

#154

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.

Aren't you just creating another contract? Users might write code that depends on it being random.

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

#155
post #141
post #134

Earlier quoted context omitted.

one might argue that one of the advantages of languages like C is that you only pay for the features you choose to use, no unnecessary overhead like initializing unused variables

You can pay for those features in debug mode or in chaos monkey mode. It's okay to continue to not pay for them in release mode. Heck, Rust has this approach when it comes to handling integer overflow - fully checked in debug mode, silent wraparound in release mode.

In Ada you can pay for integer overflow checks (runtime) if you want to. With Ada SPARK you can prove that your code does not contain integer overflows so that you don't need runtime checks.

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

#156
post #19

Earlier quoted context omitted.

And it did not matter at all. The game shipped and was a success.

Let's be clear that it was a success very much in spite of UB, not because of it. And there was still a cost--likely at least hundreds of person-hours spent fixing other similar bugs due to UB (if not more). I worked in gamedev around the time this game was made and this would have been very much an ordinary, everyday kind of bug. The only really exceptional thing about it is that it was discovered after such a long…

[deleted]

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

#157
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.

and thats a good thing

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

#158
post #19

Earlier quoted context omitted.

And it did not matter at all. The game shipped and was a success.

This is the thing that drives artists and craftsmen to despair and drink: That a flawed, buggy, poor quality work can be "successful" while something beautiful and technically perfect can fail.

Some artist also think "is mot music because it has no guitars".

The standars "artist" have are atificial and snoby.

How can Deadmau5/whatever EDM artist sell so much?

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

#159

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.

Randomization at this level would be too expensive. There are tools that do this for debug purposes, and your stuff runs a lot slower in that mode.

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

#160

Earlier quoted context omitted.

The compiler has no way of knowing that the memory would be undefined, not unless it somehow can verify the data file. The most I think it can do is flag the program for not checking the return value of scanf, but even that is unlikely to be true since the program probably was checking for end of file which is also in the return value. It was failing to check the number of matched parameters. This is the kind of erro…

Uninitialized variables are a really common case.

The pointer to the uninitialized variable is passed to scanf, which writes a value there unless it encounters an error. The compiler cannot understand this contract from the scanf declaration alone.
Post reply on HN