Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Not sure what to make of this....bug?

Author
Message
wargasmic
18
Years of Service
User Offline
Joined: 15th Oct 2006
Location: UK
Posted: 15th Apr 2013 15:08 Edited at: 15th Apr 2013 15:35
So, after debugging for a while and killing hundreds of enemies I get some errors...



And upon clicking continue a couple of times...



And after clicking retry I get...



Then after clicking continue, it gives the first error again, where I click continue again, thereafter follows a constant stream of unhandled exceptions.

I can't seem to pinpoint this to something in my own code, and the call stack seems point to AGK.

Here's the call stack.



Edit: I'm using 108Beta11, but I had this problem in beta 9 and 10 too.
wargasmic
18
Years of Service
User Offline
Joined: 15th Oct 2006
Location: UK
Posted: 15th Apr 2013 15:56
OK I thought maybe functions in my custom particle system were clashing with the agk particle system, so I have completely removed it and tested without it.

Still getting unhandled exception. Here's the call stack...



Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 15th Apr 2013 16:24
Are you using AppGameKit arrays? - if so I would suggest checking all of that first, like an overflow somewhere trying to access an array index that is above the maximum, that sort of thing.

Why AppGameKit crashes out with little or no feedback, I tend to check array subscript bounds before anything else.

I got a fever, and the only prescription, is more memes.
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 15th Apr 2013 17:02
Van B, wargasmic is working in Tier 2.

However, out of bounds array is possible.

But it looks like Object::ClearComponents() is trying to delete something that no longer exists.

wargasmic, can you show the code in the Object::ClearComponents() method?

I used to run into issues with AppGameKit trying to manipulate something after I deleted it. But your issue looks more like AppGameKit is trying to delete something at your command that no longer exists.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
wargasmic
18
Years of Service
User Offline
Joined: 15th Oct 2006
Location: UK
Posted: 15th Apr 2013 17:31 Edited at: 15th Apr 2013 17:43
Here's Object::ClearComponents()



And here's Component::Clear(). It's a virtual funtion to perform actions specific to the component, in this case, MeshComponent. The AppGameKit object being deleted is an instanced object.



Edit: The error only seems to occur with my enemy objects after destroying many of them, but not the bullet objects, which there are a lot of and are destroyed often/when leaving the play area. Both enemy and bullet derive my base object class and have meshcomponents attached to them. The bullets and enemies are constructed in pretty much the same way, both calling the methods above when destroyed, so I cant understand, if it is a problem with agk trying to perform actions on an object that doesn't exist anymore, why doesn't it happen with both the enemies and the bullets.
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 15th Apr 2013 17:43
Okay, does the destructor for MeshComponent by any chance call MeshComponent::Clear()? Or does the destructor for Object call Object::ClearComponents()?

If it does, then the following line is what is causing the issue:


The erase method may be calling the destructor for the elements stored. I am pretty certain that the clear() method does as well. I know it does for lists and vectors.

One way to test is have the ClearComponents and Clear methods output something to a text file indicating when they are called and see if you get more calls than you expect.

In case you haven't tried your code in Android, you may find that when you do the compile fails. I discovered that the compilers used in the Android build (as set up by the instructions for Android building) don't work with the std::map class (much to my frustration).

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
wargasmic
18
Years of Service
User Offline
Joined: 15th Oct 2006
Location: UK
Posted: 15th Apr 2013 17:55
No, I haven't even defined a dtor for MeshComponent and my dtor for Object is empty atm.

the component Clear method is only called from Object::ClearComponents().

I haven't gotten around to building for android yet, but was planning to as soon as this error is fixed. It's next on my list.

std::map not working for android is going to be a pain:S. I use map a lot for my resources and components
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 15th Apr 2013 18:14
I was hoping to use map as well and had some things working very nicely and then couldn't compile.

I just tried adding "include <map>" to an app, just so I could share the error message. Naturally, it compiled without one. But, I didn't have any guts in it so maybe it actually takes putting all the map stuff in to trigger the error.

Let me know if it compiles without complaint for you when you get to the Android stage. The issue was the level of the compiler.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 15th Apr 2013 18:15
Still, it can't hurt to put a debug statement in (or use the debugger and put a break in the Clear method) to see if too many calls are being made.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
wargasmic
18
Years of Service
User Offline
Joined: 15th Oct 2006
Location: UK
Posted: 15th Apr 2013 18:23
Hmm it appears there is more than one call to Clear

Lets find this sucka!!
wargasmic
18
Years of Service
User Offline
Joined: 15th Oct 2006
Location: UK
Posted: 15th Apr 2013 18:27
Wait, no there isn't lol.

Login to post a reply

Server time is: 2024-11-24 12:06:49
Your offset time is: 2024-11-24 12:06:49