Decades-old bug in Grand Theft Auto: San Andreas pops out

Microsoft’s Windows 11 24H2 update has stirred frustration among some users, but the root of the issue lies not within the operating system itself. Instead, it traces back to a long-standing error in Grand Theft Auto: San Andreas, a game that has captivated players since its release in 2004.

Understanding the Glitch

This peculiar problem specifically affects players of the Rockstar-developed action-adventure title, where gamers engage in rebuilding a gang while navigating a world filled with corrupt law enforcement and formidable criminals. The glitch manifests as the unexpected disappearance of the seaplane, commonly referred to as the “skimmer,” from gameplay. Reports of this anomaly began surfacing in November of last year, coinciding suspiciously with the rollout of Windows 11 24H2.

GitHub user “Silent,” who oversees the SilentPatch project—a tool designed to address various bugs in early 3D Grand Theft Auto games—was alerted to the issue through a repository issue. Silent, a game developer dedicated to ensuring older titles run smoothly on modern hardware, expressed the sentiment that “every classic is somebody’s favorite childhood game, and might become someone else’s ‘hidden gem.'” He elaborated on his passion for revisiting nostalgic games, stating, “If I can also fix those games up slightly so they can be enjoyed better on contemporary hardware, everyone wins.”

Diving Deeper into the Code

Silent noted that many compatibility issues stem from outdated graphics APIs, which can often be resolved using existing wrappers. However, this particular bug required a more thorough investigation. Unlike typical mod-related issues, the glitch only appeared in Windows 11 24H2, functioning without a hitch in the previous version, Windows 11 23H2.

As Silent delved deeper, he discovered that the problem was not a fault of Microsoft. Instead, it was rooted in the original coding of the game itself. Specifically, the definition for the skimmer in the game’s vehicles.ide file lacked crucial parameters compared to other aircraft. Silent theorized that during the transition from Vice City to San Andreas, where the skimmer’s vehicle type was altered from a boat to a plane, essential parameters were inadvertently omitted.

He explained, “Since this game seldom verifies the completeness of its data, this mistake simply slipped under the radar.” The game was designed to assume that all parameters were present, but the absence of these parameters meant they were not initialized correctly. Instead, the game persisted the last initialized value from an earlier object, which had worked until the latest Windows release.

The Impact of Windows 11 24H2

Windows 11 24H2 introduced changes in stack handling that overwrote these stale values, leading to the skimmer issues. It is important to clarify that this is not a flaw in Windows 11 24H2 itself. As Silent pointed out, “the way the stack is used by internal WinAPI functions is not contractual and may change at any time, with no prior notice.” The underlying issue lies in the game relying on undefined behavior, specifically uninitialized local variables—a significant oversight in software development.

Silent characterized the situation as “an interesting lesson in compatibility,” highlighting that even minor changes in stack layout can have significant implications for applications that inadvertently depend on specific behaviors. He emphasized the importance of two key lessons for developers:

  • Validate your input data: San Andreas was notoriously lax in this regard, leading to unnoticed incomplete configuration lines.
  • Do not ignore compilation warnings: The original code likely generated warnings that were either ignored or disabled.
Winsage
Decades-old bug in Grand Theft Auto: San Andreas pops out