Skip to content

Fix hugely popular crash in RpAnimBlendAllocateData (SA 0x000D5F6F)#4894

Open
Dutchman101 wants to merge 2 commits into
multitheftauto:masterfrom
Dutchman101:animcrashfix
Open

Fix hugely popular crash in RpAnimBlendAllocateData (SA 0x000D5F6F)#4894
Dutchman101 wants to merge 2 commits into
multitheftauto:masterfrom
Dutchman101:animcrashfix

Conversation

@Dutchman101

Copy link
Copy Markdown
Member

This PR fixes all paths i could trace for a very common crash, according to crash stats.
There's not much to say, other than that the pre-existing hook meant to avert this crash wasn't sufficient, but now it is.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code changes here seem to be guarding against m_pModelInfo pointing to invalid data, but do we know why it's invalid in the first place?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Seems like a use after free or something?)

@Dutchman101 Dutchman101 Jul 2, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code changes here seem to be guarding against m_pModelInfo pointing to invalid data, but do we know why it's invalid in the first place?

@qaisjp
No, we don't know it.. the 'fix' acts on an emerging crash as per the crash stats. There's users complaining of this crash as well, but none of them could pinpoint the exact circumstances. After i couldn't find a 100% confirmed root cause, i just looked at, and prevented, additional paths i could find for it to occur.

Averting crashes based on stats and collected dumps alone is an established practice, we don't always get much to work with.

Comment on lines +2913 to +2918
#define HOOKPOS_CAnimBlendAssocGroup_CreateAssociations 0x4CE2F7
#define HOOKSIZE_CAnimBlendAssocGroup_CreateAssociations 7
#define HOOKCHECK_CAnimBlendAssocGroup_CreateAssociations 0x8B
DWORD RETURN_CAnimBlendAssocGroup_CreateAssociations = 0x4CE2FE;
DWORD RETURN_CAnimBlendAssocGroup_CreateAssociations_Skip = 0x4CE36F;
void _declspec(naked) HOOK_CAnimBlendAssocGroup_CreateAssociations()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please could you write some comments explaining exactly what the hook does?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Dutchman101 please can you add the requested comments here and we'll get this merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants