GTA5GangMod icon indicating copy to clipboard operation
GTA5GangMod copied to clipboard

Crash (during wars?)

Open lucasvinbr opened this issue 7 years ago • 24 comments

Users (me too) have been experiencing crashes during some apparently intense moments. Those crashes don't seem to be predictable, however, so the exact cause isn't known. It's possible to fight 3 or 4 wars without crashing, and then crash during, or after, another one

lucasvinbr avatar Jan 10 '18 13:01 lucasvinbr

The crash I experience can be described as:

  • game freezes for a few seconds (I'd say around 5);

  • "game stopped working" window appears

  • crash logs in event viewer seem to indicate a stack overflow happens

lucasvinbr avatar Jan 10 '18 13:01 lucasvinbr

I have the same issue. Wish there was a fix as this mod is awesome when it isn't suck frozen.

YoruBestBudPingu avatar Mar 07 '18 20:03 YoruBestBudPingu

Hey @YoruBestBudPingu , is there any other info about the crash you've noticed? Like, when does the crash happen for you?

lucasvinbr avatar Mar 09 '18 15:03 lucasvinbr

Hi I have the same issue. It happens quite always during wars. I'm gonna try to see if I can do something, perhaps debug it.

DanteMarshal avatar Mar 24 '18 15:03 DanteMarshal

Sounds good, let me know when the new version comes out! Awesome mod!

On Fri, Mar 9, 2018 at 10:29 AM, Lucas Vinícius [email protected] wrote:

Hey @YoruBestBudPingu https://github.com/yorubestbudpingu , is there any other info about the crash you've noticed? Like, when does the crash happen for you?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/lucasvinbr/GTA5GangMod/issues/10#issuecomment-371845330, or mute the thread https://github.com/notifications/unsubscribe-auth/Ajb96L7Uj78slzPGqRBSn22a_z0SqVL9ks5tcp_rgaJpZM4RZUaV .

-- Joshua Harrison-Maul Phone: 437-772-1710 Email: [email protected] [email protected]

YoruBestBudPingu avatar Mar 24 '18 16:03 YoruBestBudPingu

UPDATE 1 Just checked windows' event viewer, And saw there was an unhandled exception on crash with code c0000005, Which is the code for an access violation.

DanteMarshal avatar Mar 24 '18 16:03 DanteMarshal

Hmmm, I've looked around the scripthookvdotnet issues a bit and I think it could have something to do with one of the Natives directly called in this mod; maybe one of them is being called providing wrong parameters or invalid data?

lucasvinbr avatar Mar 24 '18 17:03 lucasvinbr

Or... it could be something with the MarkAsNoLongerNeeded function and underlying natives. At least the "Access violation" error, that is (the stack overflow is probably something else)

lucasvinbr avatar Mar 24 '18 17:03 lucasvinbr

UPDATE 2 Murphy's Law :| I've been playing the game waiting for a crash to debug for 3 hours now, And no single crash happened :| Before this, there were crashes every half an hour at least. Though, I've changed the number of my Active gangs. There were 12, But I saved them and used a maximum of 5 Gangs for debugging. No crash happened as long as I was playing.

Though, The exception is unlikely to happen just because of high number of gangs. It mostly looks like a logical error in code.

DanteMarshal avatar Mar 24 '18 19:03 DanteMarshal

Haha yeah, it's pretty unpredictable. Have you made any changes to the code before testing? Even if you didn't, did you recompile the mod or something like that?

lucasvinbr avatar Mar 24 '18 22:03 lucasvinbr

Nope, Nope. I used the same dll I used before, just attached the Debugger to game process. I'm gonna play with my old configuration next time I have the free time to see if they are the problem. The things I changed before it didn't crash anymore are : GangData.xml - Removed some gangs, kept only a few. ModSettings.xml - Changed 'maxCoexistingGangs' from 12 to 5. TurfZoneData.xml - Removed all turfs to mark them myself in the game. After that I completed about 10 wars and no crash happened.

DanteMarshal avatar Mar 25 '18 04:03 DanteMarshal

OK, I've got some UPDATEs 3

  • I failed to have a single crash while Debugger is attached, But when there's no debugger crashes happen.
  • I got two crashes with debugger off, After winning wars (not while in war)
  • My brother has a more high-end laptop and uses the same version + same configuration. He doesn't get a single crash.

I think, it might be performance / memory related because when I make the following changes, I don't get crashes anymore :

  • I reduced the number of gangs in "GangData.xml" and set max coexisting gangs in "ModOptions.xml" to 5 (from 12)
  • I emptied "TurfZoneData.xml" from zones and added zones manually in game

It's not a fix of course, But I think it can be a workaround for now !

DanteMarshal avatar Mar 27 '18 18:03 DanteMarshal

Hmmm, were the crashes without the debugger all of the "access violation" type? Those crashes that happened after winning wars, were they right after winning or a few seconds or more time later?

lucasvinbr avatar Mar 27 '18 19:03 lucasvinbr

To be honest, I forgot where I could see the exception type in those two 😀 or maybe they were not like the other one, Maybe they really were different, I don't know. But those crashes after war, They happened a few seconds after I won the war. Though I don't know why and how, But my brother never experiences any crashes no matter how many gangs or turf zones he has.


UPDATE 4 : I just got another crash on my new never-crashed configuration. I kept adding new turf zones manually and after the crash I checked and I've got 28 zones now. The crash happened so randomly, I was simply driving and not in any war. It wasn't even after a war. And also, I tried to debug the crash. It was a .Net 1 or .Net 2 exception, But when I continued it thrown another exception from .Net 4.5, Though I think this behavior was caused by the Debugger (which was not attached while I was in game).

DanteMarshal avatar Mar 28 '18 02:03 DanteMarshal

hahah when I crashed, I checked windows's event viewer, it showed the exception type there too. Hmmm, could the problem be in the gangs' AI then? Maybe when they're trying to "think" about the zones or something like that

lucasvinbr avatar Mar 28 '18 18:03 lucasvinbr

I'm thinking maybe your mod has no problem. Maybe its something related to NativeUI or ScriptHookV.Net ? And what I don't understand, is Why doesn't my brother experience crashes while using the same exact version and mod configuration as mine ?

DanteMarshal avatar Mar 29 '18 11:03 DanteMarshal

Hmmm... I still think it's something related to this mod because other mods don't seem to have the same issue. About your and your brother's configurations, are you using the same OS? Do you have the same .NET framework versions? Is your brother using a similar gangModData config, like your never-crashed configuration? No idea what the difference that really matters for us is, but maybe those are worth checking hehe

lucasvinbr avatar Mar 29 '18 15:03 lucasvinbr

I've made a few tweaks to the mod in the "untested" branch... I haven't tested it too much, but have had no crashes so far. I guess I haven't tested it enough hahaha

lucasvinbr avatar Apr 02 '18 02:04 lucasvinbr

Hi, sorry for Too late reply. I'm a bit busy these days, but I'll give it a try when I can. Just one thing, can you tell me the Details on how you build it ? Like your IDE, what dlls to Reference and where to find them, and etc. ! Just cuz I failed to build it last time, though I haven't yet tried building NativeUI from source, but it's good to arrange everything before I try to build again.

DanteMarshal avatar Apr 05 '18 16:04 DanteMarshal

I use Visual Studio Community 2013, referencing the latest ScripthookVDotNet (the latest release from https://github.com/crosire/scripthookvdotnet/releases) and a NativeUI.dll that was built with that SHVDN (I don't know if I built mine from the exact commit from version 1.7 of NativeUI, or from a commit that came afterwards, like you mentioned... it's probably better to do it like you said, stick to the released version to avoid unstable code and stuff)

lucasvinbr avatar Apr 05 '18 19:04 lucasvinbr

Hi 😬 Soooo... I've got this Hard Disk problem (Long story) and now my GTA is gone. Guess I won't be installing it anytime soon. But I'll be happy to help with this Mod after I returned to the world of GTA. By the way, Sorry for not keeping my promise 😞

DanteMarshal avatar Apr 24 '18 03:04 DanteMarshal

Hey, don't worry about it hahahah I've also been a bit busy... and Hard Disks can be troublesome hehe. Please do come back once you feel like it... and the circumstances permit hahahah

lucasvinbr avatar Apr 24 '18 13:04 lucasvinbr

-I've tried commenting out everything vehicle-related (including spawning) -Also limited all spawn attempts to 1 try only -Commented out the enemy spawn relocation during wars as well Crashes during wars still happen with this setup

lucasvinbr avatar Jul 06 '18 16:07 lucasvinbr

As of lately, crashes seem rare, and seem to happen mostly when quickly despawning/marking as no longer needed large numbers of members (when using a trainer to teleport to somewhere far, or reloading scripts with Insert)... So I'd say that recent changes (in the mod and maybe in the game?) have mitigated the issue. It does still happen in wars, however, if the spawned member limit is set to something like 200

lucasvinbr avatar Apr 26 '19 17:04 lucasvinbr