Engine Crash

Expanding and utilizing the engine via C++.
22 posts Page 2 of 3
Jason Campbell
Posts: 335
Joined: Fri Feb 13, 2015 2:51 am
 
by Jason Campbell » Thu Jan 24, 2019 4:30 am
I feel you. I have BitStream PTSD. I was playing a sick game of wack-a-mole. At one point I was considering disabling the Fatal Interupt...

Anyway, I finally squashed all the bugs with the help of GDB(Gnu Debugger). Torsion might do the same thing. Can you backtrace with Torsion?

I absolutely had to view my backtrace and with GDB, I could go frame by frame of the crash.

Apperently GDB is in MinGW
https://sourceforge.net/projects/mingw- ... ed%29/gdb/
Azaezel
Posts: 464
Joined: Tue Feb 03, 2015 9:50 pm
 
by Azaezel » Sat Jan 26, 2019 8:01 pm
Well I was wrong on that last post. It just pushed the bug out to another location. I have 8 missions and it will always crash going into number 5. If I go to main menu after 4 then re enter the game, no crash. So something is not being cleared on a zone switch. I was careful to put everything into missioncleanup.add(%x) I delete things in order, cancel all schedules and cleanup every thing I can find that might hang out there. It still crashes in the ghosting.
that include https://github.com/GarageGames/Torque3D ... er.cs#L266 ? sounds very very much like you're overflowing the max object ID limit
Hodo33
Posts: 86
Joined: Fri Dec 29, 2017 4:34 pm
by Hodo33 » Sun Jan 27, 2019 1:18 am
Max objects per zone is 400. I see the onFire() function does a missioncleanup.add(BULLET) every time a gun is fired. Yet the projectile has a finite time to exist. I have 10 or so bots all shooting (300 - 500 count) so is every bullet stacking or does it self delete on life timeout? That looks like something that could cause an issue if memory is allocated for data on each bullet.
@Jason so far it never has crashed in debug. The one consistent time it crashes is trying to ghost objects at a zone transition.
Hodo33
Posts: 86
Joined: Fri Dec 29, 2017 4:34 pm
by Hodo33 » Mon Jan 28, 2019 11:00 pm
Quick question I was tracking down this
netGhost.cpp line 973 AssertFatal((mGhostArray[j]->flags & GhostInfo::ScopeAlways) != 0 << game will crash here

I see where most objects have this as part of the constructor first line:
mNetFlags.set(Ghostable | ScopeAlways);

Looking around I don't see that the vehicles have this set in the constructor. I added it in but wont compile as mNetFlags is not part of the wheeledvehicle
What include file do I need to make this vehicle ghostable? and why wouldn't all objects be ghostable by default ?
Thanks
Bloodknight
Posts: 242
Joined: Tue Feb 03, 2015 8:58 pm
by Bloodknight » Mon Jan 28, 2019 11:18 pm
That assert is for ScopeAlways which is a permanent scoping from the server to client, does it still break if you specify just ghostable?
Hodo33
Posts: 86
Joined: Fri Dec 29, 2017 4:34 pm
by Hodo33 » Tue Jan 29, 2019 8:55 pm
@
User avatar
Bloodknight
that worked... no crash. I couldn't figure how to do it exactly

AssertFatal((mGhostArray[j]->flags & GhostInfo::ScopeAlways) << GhostInfo does not compile setting this to Ghostable so I looked up the flag for it and just hard coded the number like this
AssertFatal((mGhostArray[j]->flags & 256) != 0
And you dont have to tell me that is a bad way to do things I know. Just can't figure how to just make it work the nice c++ way.
NetObject::NetFlags::Ghostable is not part of the mGhostArray so any hint there would be great.
Thanks for the help...
Happenstance
Posts: 90
Joined: Sat Apr 11, 2015 9:08 pm
by Happenstance » Tue Jan 29, 2019 9:53 pm
Those asserts suggest some higher level issue going on in your code so be careful about changing them, you might just be hiding the issue until it blows up somewhere else.

Getting an assert @ 973 in netGhost.cpp means you have a ghost that shouldn't be in scope that's somehow ended up in the ScopeAlways set. I'm not sure how that would happen but you might try compiling with TORQUE_DEBUG_NET defined and see what info you get.

And if you're constantly seeing crashes every time you enter a "level change" trigger, you might want to post the trigger code. My hunch is this is happening because some object isn't being cleaned up correctly during the level change.
Azaezel
Posts: 464
Joined: Tue Feb 03, 2015 9:50 pm
 
by Azaezel » Wed Jan 30, 2019 4:48 pm
Do keep in mind there's 2 ID lists. server and client. keeps folks form doing things like %yourIDonthierSystem.damage(9001); so does your new area cleanup include a variation on https://github.com/GarageGames/Torque3D ... ioncleanup ?
Hodo33
Posts: 86
Joined: Fri Dec 29, 2017 4:34 pm
by Hodo33 » Thu Jan 31, 2019 5:26 pm
I had made one change in hovervehicle.cpp here some time ago
// Todo: ScopeAlways?
mNetFlags.set(Ghostable); << had this set to scopealways, changed it back. I do use the hovervehicle for a helicopter.

Which brings up a question about vehicles in general, they are not scoped ?

In the vehicle creation in my code I was calling onAdd() on each of the vehicles I made, and discovered the vehicle.cs also did an onAdd so each vehicle was hitting an onAdd twice via Parent:;onadd so I changed that.

I wanted to be sure it wasn't some object I was adding to the scene so I added this at line 970:
// Iterate through the scope always objects...
for (j = mGhostZeroUpdateIndex - 1; j >= 0; j--)
{
Con::printf("Ghost %d %s",j,mGhostArray[j]->obj->getClassName());

What this did was allow me to see each object from the mission file get loaded ( but it doesn't show vehicles )

After these changes we got through the game couple times with no crash.

@
User avatar
Happenstance
I did add the TORQUE_DEBUG_NET define and now I get this in the log file. Mostly around mount and dismount and on death Game crashed shortly after this line.

PlayerData::doDismount(331, Kublah, 1)
packetDataChecksum disagree!
packetDataChecksum disagree!

@
User avatar
Azaezel
yes all that code is there.
I use the same code you would do for a dm cycle
I call cancel all game schedules then endMission() in gamecore.cs then delay 1 to 5 seconds before a call to loadMission(x.mis) and it fails on the load in ghost loading
Last edited by Hodo33 on Thu Jan 31, 2019 5:36 pm, edited 1 time in total.
Azaezel
Posts: 464
Joined: Tue Feb 03, 2015 9:50 pm
 
by Azaezel » Thu Jan 31, 2019 5:28 pm
should be getting scoped via parental inheritance chains, yes.

EDIT: hrm... yeah... https://github.com/GarageGames/Torque3D ... #L160-L162 would indeed suggest that that end should be getting garbage-collected... very strange...

EDIT: https://github.com/GarageGames/Torque3D ... .cpp#L1478 for the packetdata bit seems like it may be tied to the client to server *keybind sends...*

are you freeing the controlobject before removing the simobjectgroups?
Last edited by Azaezel on Thu Jan 31, 2019 5:47 pm, edited 1 time in total.
22 posts Page 2 of 3

Who is online

Users browsing this forum: No registered users and 4 guests