Advertisement

GC cannot free an object of type '_builtin_objecttype_'

Started by December 06, 2011 11:02 PM
7 comments, last by WitchLord 12 years, 11 months ago
Revision 1072.
After loading scripts from source and releasing engine it gives this errors:
[34:249] Script message: : Error : GC cannot free an object of type '_builtin_objecttype_'. Make sure all types that can form circular references have the GC behaviours : 0, 0.
[34:249] Script message: : Error : GC cannot free an object of type '_builtin_objecttype_'. Make sure all types that can form circular references have the GC behaviours : 0, 0.
[34:249] Script message: : Error : GC cannot free an object of type '_builtin_objecttype_'. Make sure all types that can form circular references have the GC behaviours : 0, 0.
[34:249] Script message: : Error : GC cannot free an object of type '_builtin_objecttype_'. Make sure all types that can form circular references have the GC behaviours : 0, 0.
[34:249] Script message: : Error : GC cannot free an object of type '_builtin_objecttype_'. Make sure all types that can form circular references have the GC behaviours : 0, 0.
[34:249] Script message: : Error : GC cannot free an object of type '_builtin_objecttype_'. Make sure all types that can form circular references have the GC behaviours : 0, 0.
[34:249] Script message: : Error : GC cannot free an object of type '_builtin_objecttype_'. Make sure all types that can form circular references have the GC behaviours : 0, 0.
[34:249] Script message: : Error : GC cannot free an object of type '_builtin_objecttype_'. Make sure all types that can form circular references have the GC behaviours : 0, 0.
[34:249] Script message: : Error : GC cannot free an object of type '_builtin_objecttype_'. Make sure all types that can form circular references have the GC behaviours : 0, 0.
[34:249] Script message: : Error : GC cannot free an object of type '_builtin_objecttype_'. Make sure all types that can form circular references have the GC behaviours : 0, 0.[/quote]
This is from ReportUndestroyedObjects().
Loading from bytecode don't give this errors.
This doesn't happen in any of my tests. Can you provide a scenario that I can use to reproduce the problem?

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
This code give error
class T { };
array<T> arr;
Strange, this script doesn't cause me any problem.

Are you using revision 1073? (you mention 1072 above, but I already fixed the other bug you found related to the script array in 1073)

Do you use any custom settings, e.g. asEP_ALLOW_UNSAFE_REFERENCES, or perhaps some customizations on the library or add-ons?

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

On revision 1073 same.

asEP_ALLOW_UNSAFE_REFERENCES true
asEP_OPTIMIZE_BYTECODE true
asEP_SCRIPT_SCANNER 0
asEP_AUTO_GARBAGE_COLLECT false
asEP_ALWAYS_IMPL_DEFAULT_CONSTRUCT true
Others by default.

I have custom things for some addons, i try inspect it now, maybe something wrong with hand-made merging.

And as i say before - after loading from bytecode this errors not showing.
Advertisement
I thought your setting [color=#1C2837][size=2]asEP_ALWAYS_IMPL_DEFAULT_CONSTRUCT[color=#1C2837][size=2] may have been what is different, but no, even when setting the same configurations I still cannot reproduce the problem.
I'm definitely not discarding that this is a bug in AngelScript, especially since you say you don't have the problem when loading from precompiled bytecode, but without being able to reproduce it myself it is very hard to imagine where the problem may be.

My test looks like this:


[source]

{

asIScriptEngine *engine = asCreateScriptEngine(ANGELSCRIPT_VERSION);
engine->SetEngineProperty(asEP_ALWAYS_IMPL_DEFAULT_CONSTRUCT, true);
engine->SetEngineProperty(asEP_ALLOW_UNSAFE_REFERENCES, true);
engine->SetEngineProperty(asEP_OPTIMIZE_BYTECODE, true);
engine->SetEngineProperty(asEP_SCRIPT_SCANNER, 0);
engine->SetEngineProperty(asEP_AUTO_GARBAGE_COLLECT, false);
engine->SetEngineProperty(asEP_ALWAYS_IMPL_DEFAULT_CONSTRUCT, true);
engine->SetMessageCallback(asMETHOD(COutStream, Callback), &out, asCALL_THISCALL);
RegisterScriptArray(engine, true);
engine->RegisterGlobalFunction("void assert(bool)", asFUNCTION(Assert), asCALL_GENERIC);

const char *script =
"class T {} \n"
"array<T> arr; \n";

asIScriptModule *mod = engine->GetModule(0, asGM_ALWAYS_CREATE);
mod->AddScriptSection("script", script);
r = mod->Build();
if( r < 0 )
TEST_FAILED;

r = ExecuteString(engine, "array<T> a; a.insertLast(T()); a.resize(2);", mod);
if( r != asEXECUTION_FINISHED )
TEST_FAILED;

engine->Release();
}
[/source]






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

Sorry, this is my fail, i Release object returned by GetObjectTypeById.

No problem, i'm just glad you found the cause

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

This topic is closed to new replies.

Advertisement