Problems in isolating a bug

Blitz3D Forums/Blitz3D Programming/Problems in isolating a bug

jfk EO-11110(Posted 2006) [#1]
I got this strange MAV, sometimes when I shot an enemy. I tried to find the cause, I have no idea. With debugger on it doesn't happen, it MAVs only in release mode.

I take it it's maybe an array access out of bounds, or an illegal bank offset. What else could it be?

BTW I also got a strange kind of framerate stuttering whenever animated characters come into the camera FOV. Is that normal? (animated 3ds with about 800 tris)

Cannot post the source since it's 335kB multidirectionally woven spaghetti code.


b32(Posted 2006) [#2]
Bugs .. :( are you sure it is because of shooting the enemies ? Might be some unfreed memory too. Have you looked at the memory/cpu usage ? Do you get the error on renderworld or on some other part ? Maybe you could try to disable freeing the enemy object after shooting it (for testing). Be sure to make a copy before you try anything.


jfk EO-11110(Posted 2006) [#3]
Thanks. I think I already tested most common causes. It isn't a missing entity. The strange part is, is doesn't happen every time I shoot an enemy. The enemy is not removed in that moment. I takes place when an enemy gets the final lethal bullet.

When compiled in debugging mode it won't crash. That's why I'd like to know what the causes for this condition could be. AFAIK there are only a few conditions that will crash in release mode and won't crash in debug mode, this is:

-access to an array index that is out of bound,eg:
dim a(10)
print a(15)

-access to an illegal bank offset, eg:
bank=createbank(100)
print peekbyte(bank,500)

EDIT wait a minute, these are working exactly the other way round, they crash in debug, and "work" in release mode.


So, what I'm really looking for is something that gives a MAV in release mode and works in debug mode. Any ideas?


b32(Posted 2006) [#4]
Maybe a .dll then, for physics maybe, since the bullet hits the enemy ? And have you ran the program on another pc yet ? I've had a strange error on renderworld caused by my nvidia driver.


jfk EO-11110(Posted 2006) [#5]
I think I have fixed it. It seems I was accessing a pivot that didn't exist anymore. I still don't know why there was no error in debug mode. Accessing a pivot that was removed using FreeEnity may work in release mode (as long as the released ram isn't overwritten by something else), but should result in an "entity does not exist" error in debug mode. In fact I have set the handle to Null, so EntityDistance is using Zero as the first parameter. A little strange that this gives no error in debug mode, as I said. Skipping parts in certain situations seems to fix it, so who cares :)


jfk EO-11110(Posted 2006) [#6]
Thanks bram32. Basicly you were right, it had something to do with access to an entity that was removed due to the lethal bullet. It wasn't the enemy mesh itself, but some helper pivot. The thing that made me stuck was the unexpected behaviour of the debugger and its (missing) message, as mentioned before.
I don't think it has something to do with the hardware. Your Problem sounds more like a mesh with too many Triangles or Vertices per surface. The max number differs from card to card, 32000 is proof.


Graythe(Posted 2006) [#7]
What is MAV? please


KuRiX(Posted 2006) [#8]
Memory Access Violation ...


Graythe(Posted 2006) [#9]
Aah... thanks KuRiX