Advertisement

Crash on linux (gcc 4.3?)

Started by August 26, 2013 08:20 AM
4 comments, last by ruphert 11 years, 2 months ago

Hey,

After switching to Angelscript 2.27.1 I get this crash on linux. But it happens only if I compile on my machine with gcc 4.3.

On gcc 4.7 it works fine.

The crash happens right after calling a second function, first script whatsoever.

Any idea what this is?

The array is empty and the index is 1 in this case.


KAGdedi: ../../source/as_array.h:158: T& asCArray<T>::operator[](size_t) [with T = asCScriptFunction*]: Assertion `index < length' failed.

Program received signal SIGABRT, Aborted.
0xf7fdb425 in __kernel_vsyscall ()
(gdb) bt
#0  0xf7fdb425 in __kernel_vsyscall ()
#1  0xf7d101df in raise () from /lib/i386-linux-gnu/libc.so.6
#2  0xf7d13825 in abort () from /lib/i386-linux-gnu/libc.so.6
#3  0xf7d09085 in ?? () from /lib/i386-linux-gnu/libc.so.6
#4  0xf7d09137 in __assert_fail () from /lib/i386-linux-gnu/libc.so.6
#5  0xf737929d in asCArray<asCScriptFunction*>::operator[](unsigned int) () from Base/../libJuxta_dedi.so
#6  0xf73ce434 in CallSystemFunction(int, asCContext*, void*) () from Base/../libJuxta_dedi.so
#7  0xf7372b34 in asCContext::ExecuteNext() () from Base/../libJuxta_dedi.so
#8  0xf737044a in asCContext::Execute() () from Base/../libJuxta_dedi.so
#9  0xf70b131e in asScript::ExecuteWithDebug (this=0x8225530, ctx=0x81ec0e8) at ../Scripting/asScript.cpp:385
#10 0xf70b1eeb in asScript::executeFunctionByName (this=0x8225530, name=...) at ../Scripting/asScript.cpp:506
#11 0xf70b60a2 in asScriptManager::runScriptFromFile (this=0x80d0e54, fileName=..., entryFunction=..., fileMatch=false) at ../Scripting/asScriptManager.cpp:766
#12 0xf70ac39d in CScript::RunScriptFromFile (this=0x80d0e50, fileName=..., entryFunction=..., fileMatch=<optimized out>) at ../Scripting/Script.cpp:89
#13 0xf6f2b943 in CGame::Run (this=0x8175bd8, argc=1, argv=0xffffd214) at ../Game/GameDLL.cpp:475
#14 0xf6f1620f in GameDLLInit (ie=..., argc=1, argv=0xffffd214) at ../Game/GameDLL.cpp:94
#15 0x0804c078 in CApplication::LoadGameDLL (this=0x80cc088, filename=0x80cc2f4 "Base/../libJuxta_dedi.so", argc=1, argv=0xffffd214) at ../App/main.cpp:346
#16 0x0804e8c5 in CApplication::Run (this=0x80cc088, argc=1, argv=0xffffd214) at ../App/main.cpp:228
#17 0x0804c3ed in main (argc=1, argv=0xffffd214) at ../App/main.cpp:623
(gdb) 
KAG DEVLOG: http://kagdev.tumblr.com/

It's obviously some incompatibility between gnuc versions. The last change I made knowingly for this was in version 2.26.2 where I fixed the native calling conventions for MinGW 4.7, though I believe you were using 2.26.2 before the upgrade so that shouldn't be the cause now.

I'll try to see if I can figure out what may have caused this problem. With version 2.26.2 it was working with both gnuc versions, right?

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

Comparing the code from version 2.26.2 and 2.27.1 I can really only identify one possible cause, and that is the change done to the thread manager. It is possible that the use of thread local storage doesn't work correctly in gnuc 4.3, and that

Would it be possible for you to make a test using the library version 2.27.1, but with the old code for as_thread.cpp and as_thread.h? It shouldn't require any code changes, just a copy of the mentioned files from 2.26.2 version to the 2.27.1 version.

If we can prove this is the cause I'll add a compile time switch to use the old way in the older gnuc compiler.

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

Its working. The issue was unrelated to gcc. It turns out some old or seemingly random angelscript code was used in creating the lib. A full clean of angelscript and rebuilding again helped.

KAG DEVLOG: http://kagdev.tumblr.com/

Ah, great. It's a relief. :)

Has the upgrade to 2.27.1 fixed the crash and memory leak you reported in the other thread too?

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

No, the memory leak remains. I will need to isolate the problem somehow cause right now there is a 16kb leak on every initialized script.

KAG DEVLOG: http://kagdev.tumblr.com/

This topic is closed to new replies.

Advertisement