Decades-old bug in Grand Theft Auto: San Andreas finally shows itself
Something broke on Windows 11 24H2, but dev who discovered it tells El Reg this time Microsoft's not to blame
Microsoft's Windows 11 24H2 update is frustrating some users, but it isn't the operating system at fault this time. Instead, it's down to a 20-year-old error in Grand Theft Auto: San Andreas.
The problem only impacts players of the Rockstar developed action adventure game, first released in 2004, in which the gamer must rebuild a gang, fend off corrupt cops and powerful criminals, and more. It affects specific versions of the game and manifests itself in the apparent disappearance of the seaplane (also referred to as the "skimmer") from gameplay. It's an odd glitch, and bork reports began in November last year, suspiciously close to when Windows 11 24H2 started rolling out.
GitHub user "Silent," who maintains the SilentPatch project, says they were notified of the problem via an issue in the repository. SilentPatch is a tool that deals with the various bugs and flaws spotted in the early 3D Grand Theft Auto games over the decades.
Silent, a game developer, has worked to get older games running on modern hardware. He told El Reg via email, "Every classic is somebody's favorite childhood game, and might become someone else's 'hidden gem.'
"Personally, I enjoy revisiting games I played as a kid, or ones I heard of but didn't get the chance to try until now - and if, in that process, I can also fix those games up slightly so they can be enjoyed better on contemporary hardware, everyone wins."
He added: "Many times compatibility issues are simply related to outdated graphics APIs, and can be reliably fixed with the use of the existing wrappers.
"It's when issues are unrelated to the typical incompatibilities that I need to dive deeper into the game's disassembly, understand the intent of the original code, and come up with a fix for the issue at hand."
This bug did indeed require a deeper dive. It wasn't connected to a mod of the game and only appeared to happen in Windows 11 24H2. Run it up in Windows 11 23H2, and everything worked fine.
Windows 11 24H2 has not been the most stable of releases; a look at Microsoft's Windows Release Health Dashboard shows that the operating system has had more than its share of issues. Could a weird problem with a decades-old game be about to be added to the list?
The developer dug further and found this wasn't Microsoft's fault. The blame lay at the feet of whoever created the definition of the GTA San Andreas skimmer and the way the game handled it.
The line for the skimmer in the game's vehicles.ide
file was missing some crucial parameters compared to other aircraft in the game. Silent has a theory: "In Vice City, Skimmer was defined as a boat, and therefore did not have those values defined by design! When in San Andreas they changed Skimmer's vehicle type to a plane, someone forgot to add those now-required extra parameters.
"Since this game seldom verifies the completeness of its data, this mistake simply slipped under the radar."
But what broke under Windows 11 24H2?
According to the developer, the game assumes all parameters are present. However, the affected parameters are not in the file and so aren't initialized. Instead, whatever was the last initialized value (from an earlier object in the file) ended up being persisted. Which, against all the odds, worked up until the latest release of Windows.
Windows 11 24H2 does things a little differently in stack handling and overwrote those stale values. The result? Skimmer problems.
To be clear, the problem is not an issue with Windows 11 24H2 itself. As Silent points out, "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 problem is the game itself inadvertently relying on undefined behavior, in this case, uninitialized local variables. A massive no-no for developers.
- How a good business deal made us underestimate BASIC
- Apple tells emulator developers it's OK with retro games – not entire OSes
- Hackers mod a Sony PlayStation Portal to run PSP games
- Footage of Nigel Farage blowing up Rishi Sunak's Minecraft mansion 'not real'
Silent called it "an interesting lesson in compatibility: even changes to the stack layout of the internal implementations can have compatibility implications if an application is bugged and unintentionally relies on a specific behavior."
And the lessons?
"Validate your input data – San Andreas was notoriously bad at this, and ultimately this was the main reason why an incomplete config line remained unnoticed.
"[Do] Not ignore the compilation warnings – this code most likely threw a warning in the original code that was either ignored or disabled!" ®