Is this a symptom of a bad bank address

Blitz3D Forums/Blitz3D Programming/Is this a symptom of a bad bank address

Matty(Posted 2005) [#1]
My gauntlet remake "Blood & Plunder - Goblin Head Go Squish Squish" is extremely close to finished and has been playtested quite heavily.

Unfortunately, I have had the same error occur 3 times, and only 3 times in the entire life of the program so far. This error does not give an MAV (Memory Access Violation) but rather on the few times it has occurred it is a standard (?) windows error "illegal operation/encountered a problem" (or similar) and the program closes.

I am confident that I have narrowed it down to an out of bounds offset in a bank I create. On a handful of levels , the ones with an odd number of grid squares, the bank created is 1 byte too small. This means that on the few odd sized levels I am writing a value to a single byte outside of the bounds of the bank once per level during load time.

My question (yes, sorry it took so long to get to it) is this: Would/Could changing a byte outside the bank's size result in an occasional, hard to reproduce, error that does not necessarily occur at the moment the byte is changed but at any, effectively random, point during the program's execution?

Without wanting to sound arrogant, I am confident that the rest of my code is 'bug free' and that this is the cause of the issue but would appreciate some feedback.

Thanks.


Mustang(Posted 2005) [#2]
Run this:

http://www.memtest86.com/

I used it at work when my new work PC was recently giving too much BSODs (occasional BSOD is "normal" when developing new high-end apps). And sure enough, it showed clearly that one of the 1GB sticks was faulty. It was replaced and problem was solved.


Gabriel(Posted 2005) [#3]
My question (yes, sorry it took so long to get to it) is this: Would/Could changing a byte outside the bank's size result in an occasional, hard to reproduce, error that does not necessarily occur at the moment the byte is changed but at any, effectively random, point during the program's execution?


Can't say how it goes on all machines, but here I get an offset out of range if I make any attempt to write outside the bounds of a bank, so I'd have to say no.


jfk EO-11110(Posted 2005) [#4]
Gabriel You only get that alert when you're in debugging mode. If your not, Blitz seems to execute the bad offset noneless (Wow, actually it seems we can peek and poke the memory this way, since we know where the true bank data adress is, we can simply use the offset to it!)

Matty, I think it could happen. Now do you think there's access outside the bounds only occasionally, or frequently, becuase then the debugging mode would say something.


Gabriel(Posted 2005) [#5]
Gabriel You only get that alert when you're in debugging mode.


Obviously. But he's looking for a bug, so I assumed he would have enabled the debugger. Perhaps I assumed too much or misunderstood the premise, though.


Matty(Posted 2005) [#6]
Thanks for your replies. Gabriel - I should have thought of trying it with debug on, usually I do use debug but for some reason I hadn't used debug mode while testing the particular level set that had an odd number of grid squares. Just tried it with debug mode on and got an "offset out of range" error on that particular level. I am kind of amazed though that for all the times I've played the game that bug has only caused 3 crashes , but then it was only a single byte that had changed.

jfk - I only accessed the bank out of bounds once per level on which the level had an odd number of grid squares (because I am using half-bytes to store some information when there is an odd number of grid squares I'd forgotten that I need to add 1 to the total bank size)

Anyway, thanks again.