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

Crash (during wars?) #10

Open
lucasvinbr opened this issue Jan 10, 2018 · 24 comments
Open

Crash (during wars?) #10

lucasvinbr opened this issue Jan 10, 2018 · 24 comments
Labels

Comments

@lucasvinbr
Copy link
Owner

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
Copy link
Owner Author

lucasvinbr commented Jan 10, 2018

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

@YoruBestBudPingu
Copy link

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

@lucasvinbr
Copy link
Owner Author

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

@DanteMarshal
Copy link

DanteMarshal commented Mar 24, 2018

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.

@YoruBestBudPingu
Copy link

YoruBestBudPingu commented Mar 24, 2018 via email

@DanteMarshal
Copy link

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.

@lucasvinbr
Copy link
Owner Author

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
Copy link
Owner Author

lucasvinbr commented Mar 24, 2018

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)

@DanteMarshal
Copy link

DanteMarshal commented Mar 24, 2018

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.

@lucasvinbr
Copy link
Owner Author

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?

@DanteMarshal
Copy link

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
Copy link

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 !

@lucasvinbr
Copy link
Owner Author

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?

@DanteMarshal
Copy link

DanteMarshal commented Mar 28, 2018

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).

@lucasvinbr
Copy link
Owner Author

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

@DanteMarshal
Copy link

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 ?

@lucasvinbr
Copy link
Owner Author

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
Copy link
Owner Author

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

@DanteMarshal
Copy link

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.

@lucasvinbr
Copy link
Owner Author

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)

@DanteMarshal
Copy link

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 😞

@lucasvinbr
Copy link
Owner Author

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
Copy link
Owner Author

-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
Copy link
Owner Author

lucasvinbr commented Apr 26, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants