[uClibc]busybox ps garbled characters

Stuart Hughes seh at zee2.com
Wed Jun 25 16:16:41 UTC 2003


Erik Andersen wrote:
> 
> On Fri Jun 20, 2003 at 03:53:52PM +0100, Stuart Hughes wrote:
> > Hi all,
> >
> > I get garbled characters when I run ps (busybox) with uclibc:
> >
> > #
> > ps
> >   PID  Uid     Stat
> > Command
> >     1 root     S     .
> > ..o*
> >     2 _ÄÄ+     S

> > [snip]
> >
> > I saw something like this on the mailing list:
> >
> > http://www.uclibc.org/lists/uclibc/2003-March/008196.html
> >
> > But there did not seem to be a final answer.
[snip]
> 
> > I'm running as snapshot of uclibc (uClibc-20030616.tar.bz2) on a 5432
> > mipsel platform.  The packages are built using the native uclibc
> > compilers.  The version of busybox is 0.52 (old but I saw a report like
> > this for 0.60.5).
> >
> > - kernel is 2.4.19-rc1
> > - proc is mounted
> > - uclibc .config attached
> >
> > Any clues/pointers gratefully accepted.
> 
> I don't see anything about you .config that suggest problems.
> Tried using ltrace, strace, and/or gdb?
> 

I looked a bit further, and if I change line 155 of ps.c in busybox-0.52
from:
	while (((c = getc(file)) != EOF) && (i < (terminal_width-len))) {
to:
	while ((fread(&c, 1,1,file) != 0) && (i < (terminal_width-len))) {

The output is okay.  I guessed there may be a problem with getc on
uClibc, is this likely or known ??

BTW: I tried debugging using gdb/gdbserver, but although I got then to
build (host is glibc based), and gdbserver seems to start up okay, I see
the following on the host side gdb:


[seh at dell uclibc]$ emb-bin/gdb src/busybox-0.52/busybox
GNU gdb 5.2.90_2002-09-11-cvs
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you
are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for
details.
This GDB was configured as "--host=i686-pc-linux-gnu
--target=mipsel-linux"...DW_FORM_strp pointing outside of .debug_str
section

Has anyone got gdb/gdbserver running with gdb being on a glibc based
host ??

Regards, Stuart



More information about the uClibc mailing list