Advertisement

huge problems with precompilde byte code

Started by October 17, 2012 07:07 AM
18 comments, last by _Engine_ 12 years, 1 month ago
Hi!


We are using angel script in our game engine, but we encountered with serious problems. Before 2.25 we try use precompiled byte-code but
they are was error in loading byte-code. So we just compile script in runtime and this works fine until script became too big and app on ios forced to close because too much memory consuption take place when compiling script. Now with 2.25 when we save byte code angel script just crashes.

Also always triggered assert in when compiling script
as_compiler, line 925
if( !hasCompileErrors )
{
asASSERT( tempVariables.GetLength() == 0 );
asASSERT( reservedVariables.GetLength() == 0 );
}

Can we send source code and nessesery data so you can debug angel script code and figure out what we did wrong or what bug lie in angel code?


Best regards.
Asserts in AngelScript is most likely a bug in the script engine. Sometimes they may be hit due to invalid scripts, but it would still be a bug in the library.

When the assert happens in the compiler, can you inspect the outFunc member in the compiler to determine which script function is being compiled, and then post that function here (or send it to me by e-mail) so I can take a look at it?

If the assert hits in the compiler, how is it that you manage to save the bytecode?

Please don't send me the full source code. At least not without trying to narrow down the problem first.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

Advertisement
Hi!

?ssert itself not a problem because script work fine. Real problem is not working precompiled byte code - previosly byte code load don't work and now byte code saving are broke and this is real problem because we working at commercial project and almost failed because angel script leads to huge techincal problems with we can't solve by ourselfs (((
just send function is not a solution because we have very complecivity using of angels code so only full code is solution and also we cannot fix angelcode bug because problem too complex (((
The fact that the assert fails is likely the related to why the precompiled code doesn't work, even if running the scripts work seems to be working ok.

The specific assert that is failing tells me that the compiler is doing something wrong with the temporary variables. There is probably a specific expression in which the compiler fails to deallocate one of the temporary variables. This kind of problem can make the code in the bytecode serialization fail is the instructions don't match up when it adjust the positions to keep the saved code platform independent.

Seeing the function that causes the assert failure will hopefully allow me to identify what expression the compiler is having trouble with in order to fix it.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

HI!

looks like i managed how to create script thats halting on assert. Please download this archive - http://www34.zippyshare.com/v/78988412/file.html
In archive modifaed project of tutorial project with comes with angel script and problematic script.
Advertisement
Thanks. I'll look into this as soon as possible.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

I've reduced the script to the following:


shared class SPoint
{
SPoint@ opAssign(const SPoint&in assign)
{
return this;
}
}
class SBuilding
{
void ReleasePeople()
{
SPoint cellij;
if ( GetRoadOrFreeCellInAround(cellij) ) // <-- the assert happens here
{
}
}
bool GetRoadOrFreeCellInAround(SPoint&out cellij)
{
return false;
}
}


It's definitely a bug in the compiler. I'll let you know when I have it fixed.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

Alright. I've fixed the assert() failure in revision 1441.

The assert() was hit because the SPoint opAssign method returned a handle instead of a reference. This caused the compiler to allocate a temporary variable to store that handle, but it was then never released again. This was actually causing a memory leak, as the SPoint object would never be freed.

Let me know if you still have trouble with saving/loading the bytecode after picking up the fix.

If the problem still exists, then can you call the WriteConfigToFile() function from the helper add-on in your application after registering the interface? It will save all the registered functions to a file that I can then use to recreate the same configuration even without the full implementation of your engine.

Regards,
Andreas

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

Thank's. I wiil try tommorov new revision.

This topic is closed to new replies.

Advertisement