Engine crashes without explanation

Posted By: NITRO777

Engine crashes without explanation - 07/31/08 03:08

In programming Lite-C I have noticed that the engine crashes without notice or error message on several occasions. While I am well aware that the fault of the crashes come from bugs with my own code, it would make code easier to debug if there was some error message to read.

Is this a bug under your consideration?

It happens a lot. frown
Posted By: jcl

Re: Engine crashes without explanation - 07/31/08 08:01

I am not sure what "bug under consideration" is supposed to mean, but we normally don't consider bugs, we fix them.

When you experience a crash, please first read the troubleshooting section in the manual. If you think it's a bug, note down the precise circumstances and the code of the crash, and then either contact the support or make a bug report on the user forum. How to report a bug is described at the top of the bug forum.
Posted By: NITRO777

Re: Engine crashes without explanation - 07/31/08 13:28

By "under consideration" I meant that you were already working on it, I simply didn't want to bother you with problems which you already were aware of.

This happens to be easy to reproduce on my computer, here is the code

Code:
#include <acknex.h>
#include <default.c>

ENTITY* lamp_pointer;   // lamp is an entity    
var lamp_counter = 1; // 1 for on, 0 for off. 


function main()
{
	level_load("lamp_pointer.WMB");
	wait(3);
	printf("Press [0] to move the camera!");
}


action lamp()     
{    
      me=lamp_pointer;    
      my.red  = 200; // lamp light colors    
      my.green = 200;    
      my.blue = 150;    
}    



function lamp_on ()    
{    
      if (lamp_counter == 1)     
      {    
            lamp_pointer.lightrange = 500; // turn the light on    
            lamp_counter = 0;  // reset counter    
      }    
      else    
      {    
            lamp_pointer.lightrange = 0; // turn it off    
            lamp_counter = 1;  // set counter    
      }    
}    



action light_switch()
{
	my.emask |= ENABLE_SHOOT;
	my.event = lamp_on;
} 


Notice that in action lamp() I put me=lamp_pointer instead of lamp_pointer=me so obviously that is my own fault. When I write lamp_pointer=me the code runs fine.

There are two circumstances which will occur depending upon if I am running the script from WED or directly from SED.

1)From WED: The engine will crash and I am returned to the desktop

2)From SED: The engine will crash AND SED will crash and dissapear.

In either case the windows error message will occur sometimes, sometimes it will not:



COMMERCIAL EDITION V7.07.6
INTEL PENTIUM 2 GHZ, 2 GIG RAM
NVIDIA GEFORCE GO 7800 GTX


Here is the acklog.txt, but it doesnt seem to help:

Quote:
Log of A7 Engine 7.07.6 run at Thu Jul 31 09:23:29 2008
Jason M Dube' on Windows NT/2000/XP version 5.1 Build 2600
Options lamp_pointer.c -nx 30 -diag

App C:\Program Files\GStudio7\acknex.exe in C:\Program Files\GStudio7\lamp_pointer\
MM mixer opened
DSOUND device opened
DI interface opened
Start Window opened
(c)Conitec . Dieburg . San Diego . www.3dgamestudio.com
A7 Engine - Commercial Edition V7.07.6 - Jan 7 2008
Development version
Registered to: Jason Dube

Mouse found
SigmaTel C-Major Audio opened
NVIDIA GeForce Go 7800 GTX pure T&L device 1ff9 detected
D3D device NVIDIA GeForce Go 7800 GTX 1ff9 selected.
PATH C:\Program Files\GStudio7\code\
t7.dll opened
Compiling LAMP_POINTER.C - [Esc] to abort... .... .
Running LAMP_POINTER.C.
2 objects
Main started
D3D_Init Window: 640x480 -> Window: 1x640x480x32
Video memory found: 591 MB...cmap,1 ents,591 verts,2 lmaps,4 texs,480 faces,pvs,hull
Physics restarted...ok
def_startup started
Main loop..


Posted By: jcl

Re: Engine crashes without explanation - 07/31/08 16:53

Thanks for the report. I can not reproduce the problem here - a wrong pointer in a function gives an error message. But you were using an old version, so can you update to the current version and try again?

If there is really such a problem in the recent version, can you send your complete project to the support? It might be a side effect of something else, such as a damaged level or entity file.
Posted By: MadJack

Re: Engine crashes without explanation - 07/31/08 17:12

Quote:
action lamp()
{
me=lamp_pointer;
...
}

May be I am wrong, but are you sure you want that ?
Isn't it : lamp_pointer = me
Posted By: NITRO777

Re: Engine crashes without explanation - 07/31/08 18:22

Quote:
But you were using an old version, so can you update to the current version and try again?
That was it, thanks. With the new version I get an error version and the engine continues to run. This is the message for v7.10.1:


Quote:
May be I am wrong, but are you sure you want that ?
Isn't it : lamp_pointer = me
No. You are are right, I did not want to do that, it was a mistake I made. The reason I made this bug report was not to find that mistake, it was to report on the engine crashing immediately after I tried to run the program. The engine in v7.07.6 would just shut down and exit, also, if I was running the program from SED it would also close and exit SED immediately. Now in this beta version 7.10.1 it is more of an expected behavior.
© 2024 lite-C Forums