🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

AngelScript 2.10.0 released

Started by
25 comments, last by WitchLord 16 years, 7 months ago
I've uploaded a new update for AngelScript. This time I've improved the AngelScript garbage collector so that it can be allowed to take care of application registered types as well. Most registered types probably won't need this, but if you intend to register container classes that can form circular references, then you may want to look into this. For the GC to be able to take care of the registered types a couple of new behaviours must be implemented and registered for the types. Now that registered types can be handled by the script engine, I decided to move the built-in any type out of the core library and into an add-on instead. It's thus no longer a built-in type and can be registered if desired by the application. For the next version I plan on improving the interface for registering types and functions. Once it is complete, it will be easier to catch and pinpoint mistakes in the registration so that less time is spent on debugging memory leaks or stack corruptions. 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

Advertisement
Thanks, good work!

What about "ExecuteString() shouldn't lock dynamic config groups" feature? Is it in a near future?
It is quite high on the to-do list. I can't give any dates, but it is something I want to do soon.

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 experienced some problems with new WIP version. i'm on a "roxxorx 2.6.22-kamikaze9 SMP i686 Intel(R) Pentium(R) 4 CPU 2.80GHz GenuineIntel GNU/Linux" with gcc 4.1.2

- first of all, the test_feature application wouln't compile anymore on gcc-linux. we have some functions not present anymore (or moved like the any class) and some tests not in the makefile. i'll try to fix and send you an updated version of the test (which i use sometimes to test as behaviour).

- secondly, instantiate script classes outside of function (in main context) crashes angeljuice or a simple example like this:

#include "angelscript.h"void TestCrash{	asIScriptEngine *engine = asCreateScriptEngine(ANGELSCRIPT_VERSION);	engine->ExecuteString(0, "class XXX { int a; }; XXX b;");	engine->Release();}


produce:

*** glibc detected *** ./testgnuc: double free or corruption (fasttop): 0x0814d210 ***======= Backtrace: =========/lib/libc.so.6[0xa7d417ab]/lib/libc.so.6(__libc_free+0x7e)[0xa7d42d2f]/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/libstdc++.so.6(_ZdlPv+0x21)[0xa7ed7af9]./testgnuc[0x8097561]./testgnuc[0x8097586]./testgnuc[0x80975d6]./testgnuc[0x8097700]./testgnuc[0x809772a]./testgnuc[0x8096691]./testgnuc[0x80a684c]./testgnuc[0x80c3291]./testgnuc[0x80c2fa0]./testgnuc[0x80c306e]./testgnuc[0x80c309a]/lib/libc.so.6(exit+0xdc)[0xa7d0aa54]/lib/libc.so.6(__libc_start_main+0xe4)[0xa7cf582c]./testgnuc(__gxx_personality_v0+0xb9)[0x8049e81]======= Memory map: ========08048000-08145000 r-xp 00000000 08:04 3604482    /home/kunitoki/Projects/angelscript/tests/test_feature/bin/testgnuc08145000-08146000 r--p 000fc000 08:04 3604482    /home/kunitoki/Projects/angelscript/tests/test_feature/bin/testgnuc08146000-08147000 rw-p 000fd000 08:04 3604482    /home/kunitoki/Projects/angelscript/tests/test_feature/bin/testgnuc08147000-08171000 rw-p 08147000 00:00 0          [heap]a7b00000-a7b21000 rw-p a7b00000 00:00 0 a7b21000-a7c00000 ---p a7b21000 00:00 0 a7cde000-a7ce0000 rw-p a7cde000 00:00 0 a7ce0000-a7dfb000 r-xp 00000000 08:03 2639004    /lib/libc-2.5.soa7dfb000-a7dfd000 r--p 0011b000 08:03 2639004    /lib/libc-2.5.soa7dfd000-a7dfe000 rw-p 0011d000 08:03 2639004    /lib/libc-2.5.soa7dfe000-a7e01000 rw-p a7dfe000 00:00 0 a7e01000-a7e0a000 r-xp 00000000 08:03 2240096    /usr/lib/gcc/i686-pc-linux-gnu/4.1.2/libgcc_s.so.1a7e0a000-a7e0b000 rw-p 00009000 08:03 2240096    /usr/lib/gcc/i686-pc-linux-gnu/4.1.2/libgcc_s.so.1a7e0b000-a7e2d000 r-xp 00000000 08:03 2638432    /lib/libm-2.5.soa7e2d000-a7e2e000 r--p 00021000 08:03 2638432    /lib/libm-2.5.soa7e2e000-a7e2f000 rw-p 00022000 08:03 2638432    /lib/libm-2.5.soa7e2f000-a7f01000 r-xp 00000000 08:03 2240097    /usr/lib/gcc/i686-pc-linux-gnu/4.1.2/libstdc++.so.6.0.8a7f01000-a7f04000 r--p 000d1000 08:03 2240097    /usr/lib/gcc/i686-pc-linux-gnu/4.1.2/libstdc++.so.6.0.8a7f04000-a7f06000 rw-p 000d4000 08:03 2240097    /usr/lib/gcc/i686-pc-linux-gnu/4.1.2/libstdc++.so.6.0.8a7f06000-a7f0c000 rw-p a7f06000 00:00 0 a7f2b000-a7f2d000 rw-p a7f2b000 00:00 0 a7f2d000-a7f2e000 r-xp a7f2d000 00:00 0          [vdso]a7f2e000-a7f48000 r-xp 00000000 08:03 2639003    /lib/ld-2.5.soa7f48000-a7f49000 r--p 00019000 08:03 2639003    /lib/ld-2.5.soa7f49000-a7f4a000 rw-p 0001a000 08:03 2639003    /lib/ld-2.5.soaf9db000-af9f0000 rw-p af9db000 00:00 0          [stack]


any clues ?
my 5 cents - I have similar problem under MSVC 2005, there're irregular memory corruptions/double freeing almost every second run of my application - msvc debug heap allocator reports this on exit. There was no such problem in 2.8.1. Trying to trace this problem but still no luck :-(
kunitoki:

I haven't updated the gnuc makefile in a while, since I don't use it myself. I do however use the gcc compiler on Mac and everything works as it should. The makefile should be easy to fix though, just include all the source files.

Your second problem looks like a bug in the AngelScript compiler, it should have produced a compiler error, since you're declaring a class inside a function (ExecuteString wraps the script in a void function). I'll have to look into this problem, thanks.

mono2k:

I use memory leak testing during all my tests, so unless you've encountered a scenario that I'm not testing (like kunitoki seems to have done) I would guess you've not registered your objects correctly so that they aren't released by AngelScript as you would expect.



With 2.11.0 WIP I'm trying to improve the registration of object types and functions so that AngelScript can perform more validations on how the registration is done, and thereby catch more of the errors without having to track difficult to find stack corruptions or memory leaks.

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

kunitoki:

I've not been able to recreate the crash you reported, could this have been because you forgot to update the header file as well?

mono2k:

Have you had any progress on discovering the cause of your memory corruptions?

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 don't know, but everything compiled correctly when i ran that test.

anyway, i've noticed that a lot of things have changed inside the library and my efforts to align my class registrations to permite the new stuff is too work for me now.
My registered classes now don't work anymore, as it seems the allocations for objects have changed.

i'll revert angeljuice back to 2.8.1 (the best version i've ever tried) or 2.9.1 until these changes are settled and documented.
Quote: Original post by WitchLord
mono2k:

Have you had any progress on discovering the cause of your memory corruptions?


Is there any real difference between GetArgAddress & GetArgObject and between SetReturnAddress & SetReturnObject? I have a feeling this is the reason for my problem...
And I'm still using 2.7.0. :/ Doesn't matter I guess, I'd just ignore all the new features anyway.

This topic is closed to new replies.

Advertisement