Crash when using format.abc

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Crash when using format.abc

alstrup
Hi,

I'm producing some relatively big .SWF files. About 400 kb compressed where most of it is compiled by format.abc, and it works for most (although very slowly due to the linear search in lookup in Context.hx). But when the programs get bigger, I get a crash:

Could not produce SWF file: std@buffer_add_char

Called from C:\Program Files (x86)\Motion-Twin\haxe/std/haxe/io/BytesOutput.hx line 48
Called from format/abc/OpWriter.hx line 99
Called from format/abc/OpWriter.hx line 364
Called from format/abc/Context.hx line 215
Called from format/abc/Context.hx line 312
Called from SwfWriter.hx line 590
Called from SwfWriter.hx line 328
...
Uncaught exception - std@buffer_add_char

Any ideas?

Thanks,
Asger


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Crash when using format.abc

Nicolas Cannasse
Le 09/09/2011 11:44, Asger Ottar Alstrup a écrit :

> Hi,
>
> I'm producing some relatively big .SWF files. About 400 kb compressed
> where most of it is compiled by format.abc, and it works for most
> (although very slowly due to the linear search in lookup in Context.hx).
> But when the programs get bigger, I get a crash:
>
>     Could not produce SWF file: std@buffer_add_char
>
>     Called from C:\Program Files
>     (x86)\Motion-Twin\haxe/std/haxe/io/BytesOutput.hx line 48
>     Called from format/abc/OpWriter.hx line 99
>     Called from format/abc/OpWriter.hx line 364
>     Called from format/abc/Context.hx line 215
>     Called from format/abc/Context.hx line 312
>     Called from SwfWriter.hx line 590
>     Called from SwfWriter.hx line 328
>     ...
>     Uncaught exception - std@buffer_add_char

Seems like you're having a OSetReg(null) in your code, which is invalid.

Nicolas

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Crash when using format.abc

alstrup
Hi,

I just checked all calls with OSetReg, but none of them call with null. They call with ints, up to 299. Can it be some kind of buffer overflow instead, or does it only support up to 256 locals?

Regards,
Asger

On Fri, Sep 9, 2011 at 4:13 PM, Nicolas Cannasse <[hidden email]> wrote:
Le 09/09/2011 11:44, Asger Ottar Alstrup a écrit :

Hi,

I'm producing some relatively big .SWF files. About 400 kb compressed
where most of it is compiled by format.abc, and it works for most
(although very slowly due to the linear search in lookup in Context.hx).
But when the programs get bigger, I get a crash:

   Could not produce SWF file: std@buffer_add_char

   Called from C:\Program Files
   (x86)\Motion-Twin\haxe/std/haxe/io/BytesOutput.hx line 48
   Called from format/abc/OpWriter.hx line 99
   Called from format/abc/OpWriter.hx line 364
   Called from format/abc/Context.hx line 215
   Called from format/abc/Context.hx line 312
   Called from SwfWriter.hx line 590
   Called from SwfWriter.hx line 328
   ...
   Uncaught exception - std@buffer_add_char

Seems like you're having a OSetReg(null) in your code, which is invalid.

Nicolas

--
haXe - an open source web programming language
http://haxe.org




--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Crash when using format.abc

Nicolas Cannasse
Le 12/09/2011 13:20, Asger Ottar Alstrup a écrit :
> Hi,
>
> I just checked all calls with OSetReg, but none of them call with null.
> They call with ints, up to 299. Can it be some kind of buffer overflow
> instead, or does it only support up to 256 locals?

Yes, this is it.
buffer_add_char also fails if you are outside the byte range (0-255)

Nicolas

--
haXe - an open source web programming language
http://haxe.org