Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RAGE error: ERR_MEM_MULTIALLOC_FREE crash when hitting cloth ped alternate variations limit #2760

Closed
DurtyFree opened this issue Aug 30, 2024 · 37 comments · Fixed by #3190 or #3195
Closed
Labels
crash status:deferred Action on this has been deferred to a later time

Comments

@DurtyFree
Copy link

DurtyFree commented Aug 30, 2024

What happened?

My Cloth Tool received some new features in its recent update, properly utilizing the R* Cloth "Ped Alternate Variations" feature (pedalternatevariations.meta). This file basically defines a set of alternate models (YDD) per clothing that will applied when a certain other cloth is weared/applied on the ped. R* uses this for all sorts of things but the most common one is for hairs to not glitch thru clothes that cover the head, like for example big masks and hoodies.

When now generating a cloth resource that properly creates all the alternate definitions for berds (big masks) or jbibs (hoodies) the game will crash. The reason for the crash is a internal game limit that is hardcoded to 160 ped alternate variations per cloth, this limit is not related to the technical limitation of what is possible and seems like some console gen related limit. In theory this should be very easily patchable. Increasing this limit to 512 should be already more than enough.

Why increasing it and not keep it the way it is? Every server that wants to utilize proper handling of hairs/not glitching thru their clothes will come across this issue very quickly. In before most people didn't knew how to properly use this feature or it was to inconvenient to use but now it is easily accessible and I am already getting tons of reports with this crash.

Here is some quick maths to showcase the limits;

  • R* currently has about 81 hairs
  • Adding one new big mask with remove hairs feature, requires to add one ped alternation variation data for each hair to basically define that each hair uses an alternate model to remove the hairs when this particular big mask is worn. Thats 81 alternate variations already.
  • This leaves us with 79 own addon hairs in this case, so basically when we add 79 own hair styles (yes many server have this many hair styles) we already reached the limit. This is currently very possible
  • Additionally this scales up very quickly as the ped alternate variations on each hair style are also counted afaik

Feel free to reach out to me on Discord @DurtyFree for more information if needed.

Expected result

Loads the cloth alternate variations properly without game crash

Reproduction steps

  1. Create or have cloth resource with a lot of clothing, each defining ped alternate variations for basegame clothes and more
  2. Apply any of the clothes with too many ped alternate variations on it (for example some berd or jbib)
  3. Game will crash

For any cloth resource and detailed steps on how to reproduce it feel free to DM me (I don't want and also can't upload 2GB of cloth resource here)

Importancy

Crash

Area(s)

FiveM

Specific version(s)

FiveM 9654, Server 7290 Windows

Additional information

Some crashes on b3095
7cWgAVuPgt

[Window Title]
Error GTA5_b3095.exe!sub_141306B24 (0x52)

[Main Instruction]
RAGE error: ERR_MEM_MULTIALLOC_FREE

[Content]
A game error (at 0000000141306b76) caused the game to stop working.
Game memory error. Please reboot and restart the game.

[Expanded Information]
Report ID: si-e2043c39136746dc80bc30a254bc1f70

CfxCrashDump_2024_08_30_09_35_04.zip

[Window Title]
Error GTA5_b3095.exe!sub_141306B24 (0x52)

[Main Instruction]
RAGE error: ERR_MEM_MULTIALLOC_FREE

[Content]
A game error (at 0000000141306b76) caused the game to stop working.

Game memory error. Please reboot and restart the game.

[Expanded Information]
Report ID: si-6daf61a06e0e499197556f9447643a9d
[Window Title]
Error GTA5_b3095.exe!sub_141306B24 (0x52)

[Main Instruction]
RAGE error: ERR_MEM_MULTIALLOC_FREE

[Content]
A game error (at 0000000141306b76) caused the game to stop working.
Game memory error. Please reboot and restart the game.

[Expanded Information]
Report ID: si-db255086d4fc4a99aea892db6cdcb015

CfxCrashDump_2024_08_30_09_52_01.zip

@slashkeyvalue
Copy link
Contributor

Hi, could you include a resource to easily reproduce the crash?

@DurtyFree
Copy link
Author

Hi, could you include a resource to easily reproduce the crash?

Hi due to copyright reasons and the size of such a resource (2GB+) I can hardly upload it here but feel free to DM me at Discord @DurtyFree and I am happy to provide it privately

@MLV-Paul
Copy link

We are a server with an average of 250-300 players.

We have exactly this problem, as addressed here by DurtyFree.

For this reason, we would also like to see improvements made here so that the problem can be resolved quickly.

@FelixDE
Copy link

FelixDE commented Aug 30, 2024

Hey,
we also have this problem. Especially when players go through pieces of clothing they get the crash with the error message that DurtyFree send above.

@Legacy-TacticalGamingInteractive

+1

@grzybeek
Copy link

grzybeek commented Sep 1, 2024

I think the same or similar was already reported years ago here https://forum.cfx.re/t/native-setpedcomponentvariation-0x262b14f48d29de80/2108253

There is repro resource attached (I believe it was for 1604 back then 😅), it was even fixed for a while but removed because it caused more issues. https://github.com/citizenfx/fivem/blob/master/code/components/gta-streaming-five/src/CrashFixes_Clothing.cpp

@slashkeyvalue
Copy link
Contributor

slashkeyvalue commented Sep 1, 2024

I was able to increase the limit to 512 without any noticiable issues while testing

I'm guessing that other fix attempt was missing patches in some other places and that's why it was causing weird crashes

@LemonzPCMR
Copy link

I was able to increase the limit to 512 without any noticiable issues while testing

I'm guessing that other fix attempt was missing patches in some other places and that's why it was causing weird crashes

You possibly sharing this fix? I would love to testing it on a live server

@slashkeyvalue
Copy link
Contributor

Unfortunately this is not something you would be able to test on a live server.

The patch is done but it requires some other fix to prevent crashing players that don't yet have the patch.

@keiraskyler
Copy link

Exact same problem.

@TayMcKenzieNZ
Copy link

Hoping the Cfxre team looks into and implements this

@Cockers96
Copy link

Hope this is looked into and fixed as a priority as yesterday alone in the space of 6 hours we had nearly 200 crashes with the errors reported above which isnt ideal for a server owner or players of the server

@DurtyFree
Copy link
Author

Afaik @slashkeyvalue already implemented a fix and its just waiting for some other changes to be published before being merged.

Maybe CFX team can confirm and provide more information

@talonlzr
Copy link

Another 2-300 concurrent players server here, Project NXT.
We are also fighting this issue, and stand with Alexander here (@DurtyFree).

A giant +1 from us. This is quickly becoming one of the most limiting factors in growing and increasing the quality our content to our end users.

@Legacy-TacticalGamingInteractive

Afaik @slashkeyvalue already implemented a fix and its just waiting for some other changes to be published before being merged.

Maybe CFX team can confirm and provide more information

I believe it usually takes 5-6 weeks or so before fixes get pushed to Release build on average? Correct me if I'm wrong @Nobelium-cfx

@slashkeyvalue
Copy link
Contributor

There has been no push or commit to fix this issue yet.

I do have a working prototype for it but haven't had the time to actually finish it and can't promise I will be able to in the near future.

Maybe someone else from Cfx manages to fix it before i do

@Mytic2330
Copy link

There has been no push or commit to fix this issue yet.

I do have a working prototype for it but haven't had the time to actually finish it and can't promise I will be able to in the near future.

Maybe someone else from Cfx manages to fix it before i do

Could you share what you have achived so far?

@atorres112
Copy link

has anyone had luck on fixing this?

@DurtyFree
Copy link
Author

has anyone had luck on fixing this?

There is no way in fixing this yourself. Will most likely have to wait until someone creates a PR to fix this as CFX doesn't seem to care about this

@prikolium-cfx prikolium-cfx added status:deferred Action on this has been deferred to a later time and removed bug triage Needs a preliminary assessment to determine the urgency and required action labels Nov 18, 2024
@Skewwy
Copy link

Skewwy commented Dec 26, 2024

im getting the same issues.. i packed a girls pack and didnt do anything for their hair because why would you.. but i have made those settings so hair works with hats and im getting game crashes at random, i have optimized the hell out of this pack the best i can and the total size is 3.5gig with about 4500 files... nothing is over the 128 limit as well..

hope i can get some help on this as i have worked on these packs for weeks..

@Legacy-TacticalGamingInteractive

Is this still an issue? About to do a big EUP update with DurtyCloth and want to kinda plan ahead.

@DurtyFree
Copy link
Author

DurtyFree commented Jan 26, 2025

Is this still an issue? About to do a big EUP update with DurtyCloth and want to kinda plan ahead.

Yes it still is but DCT provides options to shrink the possibility of it occuring, with the trade off some game clothing mechanics

@jellyton255
Copy link

@DurtyFree Is there something that changed with DurtyCloth in recent updates that changed how packs were generated, even with ped alternates disabled? We returned back to our old clothing packs, removed all extra generated metadata files in our clothing packs, and we're still getting massive rates of this crash, same game build, same clothing items, only difference is the version of DurtyClothTool.

@DurtyFree
Copy link
Author

@DurtyFree Is there something that changed with DurtyCloth in recent updates that changed how packs were generated, even with ped alternates disabled? We returned back to our old clothing packs, removed all extra generated metadata files in our clothing packs, and we're still getting massive rates of this crash, same game build, same clothing items, only difference is the version of DurtyClothTool.

Try to reproduce this issue just with the cloth resource and nothing else. Because its not an issue only caused by clothes

With "ped alternates disabled" it should create as much (and in some cases even less) entries as before.

@jellyton255
Copy link

@DurtyFree Is there something that changed with DurtyCloth in recent updates that changed how packs were generated, even with ped alternates disabled? We returned back to our old clothing packs, removed all extra generated metadata files in our clothing packs, and we're still getting massive rates of this crash, same game build, same clothing items, only difference is the version of DurtyClothTool.

Try to reproduce this issue just with the cloth resource and nothing else. Because its not an issue only caused by clothes

With "ped alternates disabled" it should create as much (and in some cases even less) entries as before.

We did two separate tests today, one like you said with just clothing resources, no measured decrease in the crash rate, and then we did an update to the packs, where we added a chunk (~30 total) of standard clothing with no metadata, just plain clothing, and the crash rate increased quite a bit.

@xodashy
Copy link

xodashy commented Feb 24, 2025

This is becoming out of control can we get a fix please Rockstar

@LemonzPCMR
Copy link

This seriously should be higher priority.

@DaniGP17
Copy link
Contributor

DaniGP17 commented Feb 24, 2025

Is this easy to solve by increasing a pool size in the gameconfig.xml or is a hardcoded size?

Edit: sorry I didnt properly read the issue.

@Legacy-TacticalGamingInteractive

It is unfortunate and makes buying more EUP rather pointless if we are all unable to add more with this limitation.

I see @prikolium-cfx deferred it. Suppose we will just have to wait gents. I am not going to be a downer about any future commits to the project. Because I have seen several being made still by some contributors... hopefully this gets priority as its been several months now and its such a limiting issue.

@DaniGP17
Copy link
Contributor

Because I have seen several being made still by some contributors... hopefully this gets priority as its been several months now and its such a limiting issue.

Do you have reproduction steps for this?

@jellyton255
Copy link

I know that getting servers to use the latest game build is a priority, based on Nobelium's work on the updated game build system, this should absolutely be a prioritized issue based on that fact alone. It's impossible to upgrade without exacerbating this issue. This crash accounts for ~57% of all crashes we experience on our server. I urge the team to reconsider the severity of this issue and the urgency of a fix.

@citizenfx citizenfx deleted a comment from TayMcKenzieNZ Feb 24, 2025
@LemonzPCMR
Copy link

Because I have seen several being made still by some contributors... hopefully this gets priority as its been several months now and its such a limiting issue.

Do you have reproduction steps for this?

Reproducing isn't hard, but takes a bit of work in my experience. A clothing pack with lots of hair variations (cut hair) heels as well, if I'm not mistaken. Than have a few people in the server, at the same clothing store or general area and start flicking through hats and someone will crash eventually. I am sure Durty could give more accurate steps. But from my packs and servers I have worked on, that's what triggers the crash.

@TayMcKenzieNZ
Copy link

TayMcKenzieNZ commented Feb 24, 2025

Disquse fixed ped props

#2421

Now you just need someone competent enough to fix this, seeing as Disquse has parted ways.

@DaniGP17
Copy link
Contributor

I believe I already have a patch for this limit, but I need someone who can provide a resource to prove that this limit has been increased.

@william-des
Copy link
Contributor

Here is a repro resource (100 hair, tested on 3095). With a male freemode ped, I can reproduce the crash using SetPedCollectionComponentVariation(PlayerPedId(),11,"mp_m_repro",0,0,0)

alternate-variations-crash.zip

I think the limit of 320 proposed in your PR might be a bit tight for some servers. Increasing it to 512, as suggested by DurtyFree, would be safer.

@itsAdminPlus
Copy link

itsAdminPlus commented Mar 5, 2025

@DaniGP17 I am currently having this crash in my server with 225 players everyday & the crash happens very often, we believe it is our clothing pack over the prop limit on some of the props jackets/hats etc. Not sure if we can be helpful in anyway to test for you.

@DaniGP17
Copy link
Contributor

DaniGP17 commented Mar 5, 2025

@DaniGP17 I am currently having this crash in my server with 225 players everyday & the crash happens very often, we believe it is our clothing pack over the prop limit on some of the props jackets/hats etc. Not sure if we can be helpful in anyway to test for you.

I already test the patch and I didn't get any crash related to that, we've to wait to a cfx member to review my PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crash status:deferred Action on this has been deferred to a later time
Projects
None yet