Prasanna Kumar | 3 Oct 13:16 2005
Picon

toke core dumps

Hello All,

When I try to tokenize a large FCode source file, the
tokenizer crashes with Segmentation Fault.

Debug messages:

tst.fth:6763: debug: tokenizing control word 'endof'
tst.fth:6764: debug: read token 'endcase', length=7
tst.fth:6764: debug: matched internal opcode 0x0013
tst.fth:6764: debug: tokenizing control word 'endcase'
tst.fth:6764: debug: endcase offset 0x8401
tst.fth:6764: debug: endcase offset 0xffff83f1
                                    ??????????
Segmentation fault (core dumped)

When I looked at the code, the offending function was
in emit.c :

s16 receive_offset(void)
{
        s16 offs=0;

        if (offs16) {
                offs= ((*opc)<<8)|(*(opc+1));
        } else {
                offs=(*opc);
       }
        return offs;
}
(Continue reading)

Stefan Reinauer | 5 Oct 19:48 2005

Re: toke core dumps

Hi Prasana,

thanks a lot for your bug report. It's nice to see that toke
is widely used nowadays and I'm glad if we can get the last 
few bugs out of it.

> If the msb of *opc is set 1(Value >0 0x8yyy), the offs
> gets changed to ffff8yyy. 
> 
> Changing offs to u16 and receive_offset returning
> value of u16 type would solve the problem. Change the
> prototype for receive_offset in emit.h as well.

I've changed the code in a slightly different way, doing 
the same thing though. 

> - Create a fcode source file with around 7000
>   variables.

Are you sure you mean variables? A single FCode program has a limitation
of 2048 variables due to the space reserved for them (Local FCode
numbers go from 0x800 to 0xfff). 

The problem you described occurs though if your bytecode size exceeds
0x7fff bytes. 

I fixed this in openbios--main--patch-21. Now you get an error message
if you exceed the maximum word count and case..endcase constructs are
working for code larger than 32KB ;-)

(Continue reading)

Prasanna Kumar | 6 Oct 15:22 2005
Picon

Re: toke core dumps

Hi Stefan,

Thanks a lot for your reply and fixing the problem.

--- Stefan Reinauer <stepan@...> wrote:

> Hi Prasana,
> 
> thanks a lot for your bug report. It's nice to see
> that toke is widely used nowadays and I'm glad if we
can get
> the last few bugs out of it.

Yea sure Stefan.
> 
> > If the msb of *opc is set 1(Value >0 0x8yyy), the
> offs
> > gets changed to ffff8yyy. 
> > 
> > Changing offs to u16 and receive_offset returning
> > value of u16 type would solve the problem. Change
> the
> > prototype for receive_offset in emit.h as well.
>  
> I've changed the code in a slightly different way,
> doing  the same thing though. 
> 
> > - Create a fcode source file with around 7000
> >   variables.
> 
(Continue reading)

Rink Springer | 29 Oct 18:46 2005
Picon

OpenBIOS/xbox patch

Hi everyone,

Based on Ed's work, I've made a patch to really make the XBox support
work :-) It contained two minor flaws, both of which are fixed by the
patch. If I apply it, I see the OpenBIOS welcome screen.

You can download it from
http://rink.nu/downloads/xbox-patches/openbios-xbox.diff. Feel free to
apply it in the tree.

-- 
Rink P.W. Springer                                - http://rink.nu
"God, root, what is difference?"                  - Pitr, Userfriendly
Hi everyone,

Based on Ed's work, I've made a patch to really make the XBox support
work :-) It contained two minor flaws, both of which are fixed by the
patch. If I apply it, I see the OpenBIOS welcome screen.

You can download it from
http://rink.nu/downloads/xbox-patches/openbios-xbox.diff. Feel free to
apply it in the tree.

--

-- 
Rink P.W. Springer                                - http://rink.nu
"God, root, what is difference?"                  - Pitr, Userfriendly

Gmane