Illegal Instruction? - Any ideas?

Blitz3D Forums/Blitz3D Programming/Illegal Instruction? - Any ideas?

John Pickford(Posted 2005) [#1]
My game is crashing if I leave it running for a bit.

This just started happening today and I've no clue what's going on.

Does anyone have any idea what might cause this error.




Tom(Posted 2005) [#2]
Could you be hitting a surface vertex limit?

Are you getting memory leaks?


John Pickford(Posted 2005) [#3]
Not as far as I know.

The game is running an attract mode repeatedly. Everything is rebuilt each cycle and there are no random elements. The crash happens after it's been running 10-20 minutes (didn't time it).

No memory leaks as far as I can tell.

Would hitting the vertex limit generate an illegal instruction error anyway?


John Pickford(Posted 2005) [#4]
I just put an extra check into that routine and the highest vertex number reported is 2191 which I presume is a long way from hitting any limits.


big10p(Posted 2005) [#5]
What vertex/tri limit are you using for your surfaces, John? Going above ~32000 for either can cause problems sometimes, although, that usually shows up by getting a MAV on RenderWorld. I don't think I've seen an "illegal instruction" error before.

[edit] Nevermind. We cross-posted. :)


Jeppe Nielsen(Posted 2005) [#6]
Where do you call the function?, I think it is there the problem is and not in the function.

In the following example the error will highlight in the function and not at the freeentity:

Graphics3D 800,600,16,2
FreeEntity nonsense(123)


Function nonsense(s)
Return s
End Function



John Pickford(Posted 2005) [#7]
I just got the crash elsewhere. This time on a renderworld().

I'll investigate further - to see if there is a common element.


big10p(Posted 2005) [#8]
Are you accidentally setting a vertex coord to NaN or Infinity, by any chance?


John Pickford(Posted 2005) [#9]
Well I don't think so. As I said the crash happens in attract mode which runs the same demo over and over and has no random elements. The code in question has been running fine for the best part of two years.


big10p(Posted 2005) [#10]
It seems Slenkar has had this error before:
http://www.blitzbasic.com/Community/posts.php?topic=39875&hl=illegal%20instruction

He doesn't say whether he ever found the source of the error but it might be worth emailing him to ask.


John Pickford(Posted 2005) [#11]
Hmm.. I might try going back to an older version of B3D.


Tom(Posted 2005) [#12]
Changed your GFX drivers recently?


John Pickford(Posted 2005) [#13]
Yes.


Michael Reitzenstein(Posted 2005) [#14]
Are you using XMs for sound? There's a crashing bug in there (or was).

If that's not it, I think I came across this error, or something similar, a long time ago, but I'm having trouble remembering the specifics. It was a crash on random graphics functions as a result of something silly I did elsewhere (that gave no error) with mesh functions.


John Pickford(Posted 2005) [#15]
I'm just using B3D sound commands. I'm playing an MP3 when the crash happens.

What's wierd (or perhaps connected) is, I just spent a couple of days fixing a gradual slowdown issue which meant leaving the attract mode running for about 20 minutes each time. I sorted that out - although I still don't quite understand what was slowing the game down - and now the game won't run for that length of time.

I'll unzip an old version just to be sure...


John Pickford(Posted 2005) [#16]
Okay, I've unzipped Sundays version (before I fixed the slowdown issue) and the crash is still happening. Now, that version definitely wasn't crashing on Sunday because, as I said above, I was running it for 20 minutes at a time to track the slowdown.

Looks like the ATI Catalyst drivers might be the culprit.

Now I think of it, IE crashed a few times yesterday as well.

Is there anyway to get hold of old catalyst drivers?


Ross C(Posted 2005) [#17]
The slowdown does seem to suggest a leak of some sort. I have never seen that error message though in my life. Maybe, you have unreferenced a surface, ie. not freed it, but changed it's handle, so the surface still exists. Have you tried keping an eye on system memory and video memory, and noticed whether as the program slows, the memory increases.

I know this is a simple thing, and not really related, so forgive me if i'm insulting you here (it's always good to check simple things), but your not writing too much to the debuglog by any chance?


John Pickford(Posted 2005) [#18]
I fixed the slowdown. I just mentioned it because it meant I was running the game for long periods so I know the crash wasn't happening.

Writing to the debuglog? Does that cause problems? I write a lot to it.


skidracer(Posted 2005) [#19]
JP can you pls check in at the dev team forum.


Ross C(Posted 2005) [#20]
Well, i don't honestly know if the debuglog would cause an illegal instruction, but it definetly causes slowdown, if it contains alot of debug text. But since you've fixed that problem... i dunno. Sorry i can't be of more help. Hope you get it sorted, looks like a cracking game.


big10p(Posted 2005) [#21]
JP/Skidracer: can one of you report back here if you solve this, please. It would be useful to know in case other members encounter this problem. Y'know, lowly members like me who don't get privileged attention from BRL staff and access to VIP dev forums. ;)


John Pickford(Posted 2005) [#22]
Of course. I'm starting to think this is a driver issue. I'm getting system crashes as well on occasion too. Odd as this is a fresh install with the latest drivers.


big10p(Posted 2005) [#23]
Is it possible your GFX card has a minor/intermittent fault? It would be good if you could get hold of an identical card and swap it in to check. Also, are you able to test on a machine with different GFX hardware? i.e. nVidia


John Pickford(Posted 2005) [#24]
Well I can't afford a new card. I'll get my brother to give the game a stress test today.


Damien Sturdy(Posted 2005) [#25]
Illegal Instruction? Ive never seen blitz throw THAT error before. strange. Either way, I hope it gets fixed soon.