Hi,

I'm trying to link my own .as file with the D.eval library
(http://www.riaone.com/download/).
When I try, as3compile (freshly compiled from GIT) crashes.

Following is a stack trace at the time of the crash, using an empty 'test.as'
for the purpose of investigating this bug.

$ gdb /opt/swftools-git-20110420-debug/bin/as3compile
(gdb) run -X 550 -Y 400 -l D.eval-1.1.swf -o "test.swf" "test.as"
Starting program: /opt/swftools-git-20110420-debug/bin/as3compile -X 550 -Y 400 
-l D.eval-1.1.swf -o "test.swf" "test.as"

Program received signal SIGSEGV, Segmentation fault.
dict_put (h=0x0, key=0x80c50b8, data=0x80c50b8) at q.c:1146
1146        unsigned int hash = h->key_type->hash(key);
(gdb) bt
#0  dict_put (h=0x0, key=0x80c50b8, data=0x80c50b8) at q.c:1146
#1  0x0805da52 in classinfo_register (access=22, 
    package=0x80c33e8 "r1.deval.rt", name=0x80c68a0 "Block", num_interfaces=0)
    at as3/registry.c:211
#2  0x080703ce in import_code (_abc=0x80c30b8, 
    filename=0xbfde06a1 "D.eval-1.1.swf", pass=0, asset_bundle=0x0)
    at as3/import.c:312
#3  0x0807075b in as3_import_swf2 (r=0xbfddeda0, 
    filename=0xbfde06a1 "D.eval-1.1.swf", deps=0x0) at as3/import.c:73
#4  0x080708f0 in as3_import_swf (filename=0xbfde06a1 "D.eval-1.1.swf")
    at as3/import.c:119
#5  0x08070a4b in as3_import_file (filename=0xbfde06a1 "D.eval-1.1.swf")
    at as3/import.c:247
#6  0x0804aada in args_callback_option (name=0x0, 
    val=0xbfde06a1 "D.eval-1.1.swf") at as3compile.c:110
#7  0x0804b14c in main (argc=10, argv=0xbfddf154) at ../lib/args.h:79
(gdb) up
#1  0x0805da52 in classinfo_register (access=22, 
    package=0x80c33e8 "r1.deval.rt", name=0x80c68a0 "Block", num_interfaces=0)
    at as3/registry.c:211
211         dict_put(registry_classes, c, c);
(gdb) p registry_classes
$1 = (dict_t *) 0x0

It appears that registry_classes was never initialised.
Adding a call
    registry_init();
to src/as3compile.c before the call to processargs() fixes this problem,
although I haven't delved deep enough into the as3compile code to be sure that
this is the correct solution.

Regards,

Serge van den Boom


Reply via email to