Hi there,
I'm using as3compile from 0.9.2 to build swfupload for the debian repo.
Lately i got a bugreport that it segfaults on i386 architecture while
compiling.
This error does not occur on amd64 architecture.
This is, what the compiler says:
----
cd Flash && as3compile -M SWFUpload -T 9 -X 300 -Y 300 -r 15 SWFUpload.as -o
../tmp/swfupload.swf
SWFUpload.as:38:3: warning: function main uses forward or outer block
variable
references (SWFUpload): switching into compatibility mode
SWFUpload.as:925:3: warning: function GetFile uses forward or outer block
variable references (file): switching into compatibility mode
SWFUpload.as:1295:3: warning: function ReturnUploadStart uses forward or
outer
block variable references (message): switching into compatibility mode
SWFUpload.as:1406:3: warning: function BuildRequest uses forward or
outer block
variable references (key): switching into compatibility mode
Segmentation fault (core dumped)
make: *** [build] Error 139
----
Looking in the backtrace of gdb says:
----
Core was generated by `as3compile -M SWFUpload -T 9 -X 300 -Y 300 -r 15
SWFUpload.as -o ../tmp/swfuplo'.
Program terminated with signal 11, Segmentation fault.
#0 0x0809210f in dict_do_lookup (key=0xffbf3768, h=0x805d694) at q.c:1194
1194 q.c: No such file or directory.
(gdb) bt
#0 0x0809210f in dict_do_lookup (key=0xffbf3768, h=0x805d694) at q.c:1194
#1 dict_lookup (h=h@entry=0x805d694, key=key@entry=0xffbf3768) at q.c:1241
#2 0x0805e09d in registry_findmember (cls=cls@entry=0x80bb460,
ns=ns@entry=0x8096c32 "", name=name@entry=0x9557f60 "substr",
recursive=recursive@entry=1 '\001', is_static=is_static@entry=0 '\000')
at as3/registry.c:354
#3 0x0805e176 in registry_findmember_nsset (cls=cls@entry=0x80bb460,
ns=0x0, name=name@entry=0x9557f60 "substr",
superclasses=superclasses@entry=1 '\001', is_static=is_static@entry=0
'\000') at as3/registry.c:376
#4 0x08072104 in findmember_nsset (cls=cls@entry=0x80bb460,
name=0x9557f60 "substr", recurse=recurse@entry=1 '\001',
is_static=is_static@entry=0 '\000') at as3/parser_help.c:413
#5 0x08083dd9 in a3_parse () at parser.y:1969
#6 0x0806fcce in as3_parse_file_or_array (name=0x950eab0 "FileItem.as",
filename=0x94f8178
"/tmp/buildd/libjs-swfupload-2.2.0.1+ds1/Flash/FileItem.as",
mem=mem@entry=0x0, length=length@entry=0) at as3/compiler.c:115
#7 0x08070039 in as3_parse_list () at as3/compiler.c:179
#8 0x08070161 in as3_parse_file (filename=0xffbf5122 "SWFUpload.as") at
as3/compiler.c:211
#9 0x0804afd7 in main (argc=14, argv=0xffbf4534) at as3compile.c:233
----
It fails on some "substr" in file "FileItem.as".
I searched for it and there is only one "substr" in this file:
----
return "$" + ("0000" +
arguments[0].charCodeAt(0).toString(16)).substr(-4, 4);
----
Changing this to
----
var tmp: String = ("0000" + arguments[0].charCodeAt(0).toString(16));
return "$" + tmp.substr(-4, 4);
----
solves the segfault.
Line 1194 of lib/q.c is
----
unsigned int ohash = h->key_type->hash(key);
----
Is there a fix for this?
--
MfG, Christian Welzel
GPG-Key: pub 4096R/5117E119 2011-09-19
Fingerprint: 3688 337C 0D3E 3725 94EC E401 8D52 CDE9 5117 E119
---------------
SWFTools-common is a self-managed list. To subscribe/unsubscribe, or amend an
existing subscription, please kindly point your favourite web browser
at:<http://lists.nongnu.org/mailman/listinfo/swftools-common>