[uClibc]Re: fressh-0.3 works on mipsel. Thanks!

Matthew Bloch matthew at bytemark.co.uk
Mon Sep 30 10:58:59 UTC 2002


On Monday 30 September 2002 10:44, Matthew Bloch wrote:
> On Monday 30 September 2002 06:02, Joseph Chiu wrote:
> > Hi Matthew,
> >
> > Wow - Thanks for that fressh patch.  I was able to use it to
> > cross-compile fressh for mipsel, something that's been bugging me for
> > quite a while.
> >
> > I just had a few more bumps -- my mipsel-uclibc-gcc (built against
> > gcc-3.0.4) complained about uninitialized variables and multiline
> > literals; and uclibc (perhaps only on MIPS?) returned NULL's for
> > malloc(0).
> >
> > I fudged the malloc(0) problem by always allocating an extra byte.
>
> Hmmm, yes, I noticed that there were malloc(0)s in the ltrace which almost
> corresponded with the crash I saw, but uClibc's malloc seems fine with
> allocating and freeing a zero-size block, at least in a quick test program
> I tried.  I'll try the sshd under the debugger to see exactly what's
> wrong...

Well it looks like something to do with zero-sized buffers, and I suspect a 
bug in the FreSSH code being shown up by uClibc not "emulating" some 
behaviour of glibc. 

(gdb) bt
#0  0x40046574 in free () from 
/home/mattbee/bootstrap/target-lib/lib/libc.so.0
#1  0x40046514 in free () from 
/home/mattbee/bootstrap/target-lib/lib/libc.so.0
#2  0x0804fcb3 in buf_alloc (buf=0xbffffb24, size=0) at ssh_buffer.c:71
#3  0x0804ea77 in xmit_data (context=0x8088820, ptype=14 '\016', rawbuf=0x0, 
    len=0, flag=1) at ssh_packet.c:354
#4  0x0804bd34 in start_encryption (context=0x8088820) at sshd_intro.c:195
#5  0x0804da5b in doServer (context=0x8088820) at sshd_server.c:48
#6  0x0804d204 in dolisten () at sshd_main.c:439
#7  0x0804c553 in main (argc=6, argv=0xbffffdb4) at sshd_main.c:110

Anyhow I'll try with valgrind and see if that unearths any obvious memory 
errors.

-- 
Matthew Bloch         Bytemark Computer Consulting Limited
                                http://www.bytemark.co.uk/
                                  tel. +44 (0) 8707 455026




More information about the uClibc mailing list