New Bug? (CJ Bug Report) SOLVED (but question)

Started by Hollister Man, Tue 22/06/2004 06:56:23

Previous topic - Next topic

Hollister Man

UPDATE: Discovered the reason for this crash.  Ever called a NewRoom from inside a Player Leaves Screen function?  Don't.  See last post.

---------------------------
Illegal exception
---------------------------
An exception 0xC00000FD occured in ACWIN.EXE at EIP = 0x0044CD9E ; program pointer is +6, ACI version 2.61.747, gtags (14,78)

AGS cannot continue, this exception was fatal. Please note down the numbers above, remember what you were doing at the time and notify CJ on the Tech forum.

(Room 209 script line 91)


Most versions of Windows allow you to press Ctrl+C now to copy this entire message to the clipboard for easy reporting.

___________________________________

I am now recieving this message in the Verb Coin room, where I never did before.  Line 91 is simply GUIOn(2);

Not a big issue, but I thought I would mention it.  I am sure it will all come out in the wash. ;)
That's like looking through a microscope at a bacterial culture and seeing a THOUSAND DANCING HAMSTERS!

Your whole planet is gonna blow up!  Your whole DAMN planet...

strazer

These responses are taken from some other threads. I don't know exactly what numbers are relevant and I understand they can be different across AGS versions, but maybe it's worth checking out:

An exception 0xC0000094 occured in ACWIN.EXE at EIP = 0x0042182A ; program pointer is +6, ACI version 2.56.627, gtags (2,0):
CJ: "Hmm, it looks like a crash trying to display an empty line of text."

An exception 0xC0000005 occured in ACWIN.EXE at EIP = 0x0040D2DB ; program pointer is +6, ACI version 2.56.627, gtags (0,19):
CJ: "That's some sort of text rendering problem."

An exception 0xC00000FD occured in ACWIN.EXE at EIP = 0x004476CE ; program pointer is +157, ACI cersion 2.60.698, gtags (2,36):
CJ: "0xC00000FD is a stack overflow, so you've probably managed to set up a recursive call somehow."

Hollister Man

#2
Actually, it was being caused by a NewRoomEx call I discovered after moving that GUIon to the next room.  I don't know why it would suddenly decide to crash, but here it is...
Code: ags

89   function room_a() {
90     // script for room: Player leaves screen
91    NewRoomEx(200, 420, 145); //takes player back to GUI Hall, at coordinates 420, 145 
92    EnableCursorMode(1);
93    EnableCursorMode(2);
94    EnableCursorMode(3);
95    ChangeCursorGraphic(0, 402);


That's like looking through a microscope at a bacterial culture and seeing a THOUSAND DANCING HAMSTERS!

Your whole planet is gonna blow up!  Your whole DAMN planet...

Hollister Man

Sorry for the double post, but I thought this deserved an explanation.  I called NewRoomEx from INSIDE the player leaves room function.  This really should have a more elegant dump, but I found it nonetheless. 

I have left a comment in the script for posterity that I am an idiot.  ::) :-\ ::)
That's like looking through a microscope at a bacterial culture and seeing a THOUSAND DANCING HAMSTERS!

Your whole planet is gonna blow up!  Your whole DAMN planet...

Gilbert

Hmmm can you post the whole Player leaves screen function content here for us to see?

Due to engine design, NewRoomEx() will be executed as the last command in a piece of script, regardless of its position in the script (as when the room is unloaded, the current script is unloaded).

So in your piece of code, though you put the NewRoomEx() line as the first line, it's actually queued in memory until the lines that follow (EnableCursorMode()... etc.) are all executed, then the room will change.

It's quite possible that there're some lines that follow that will interfere with the NewRoomEx() process (whether it's a clash of two functions which must be executed as the last line, or some bugs in the engine). So I think it's quite useful to see the whole script.


Scorpiorus

I guess it's because the NewRoom(Ex) function calls a player leaves room script by itself (to notify that we are about to change a room). So, it calles a leave room script in which we call NewRoom(Ex) which in turn calls a leave room and again there is a NewRoomEx call... etc. So, as Strazer discovered, the exception stands for stack overflow which will eventually occur if we have an infinite recursive call.

Hollister Man

I have a knack for finding un-elegant crashes lately (this might be a good thing for the editor to check for)

I also had a "invalid message" crash, which I discovered to be caused by the last message in the edior being checked "run next message after this one".

Basically, that is the whole script, sans the closing brackets.  The primary call comes from a "Player walks off left edge of screen" interacton which calls NewRoomEx(200, X, Y); then the Player Leaves Screen calls the same thing.  I think Gilbot is right, its a recursive call.
That's like looking through a microscope at a bacterial culture and seeing a THOUSAND DANCING HAMSTERS!

Your whole planet is gonna blow up!  Your whole DAMN planet...

Pumaman

Hehe that'll be it -- I'll update the engine to detect this situation and give a friendlier error message.

SMF spam blocked by CleanTalk