bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: problem with $(</proc/net/route) on amd64


From: Tatavarty Kalyan
Subject: Re: problem with $(</proc/net/route) on amd64
Date: Tue, 19 Jul 2005 18:22:40 +0530

Though I get the same results as posted above on i686,i am not sure if
this is a bash problem.

On the  other hand i feel there is might be some issue with the glibc
read  and  /proc filesystem on some 2.6 kernels as i wasnt able to
reproduce this on  Redhat with 2.4.21-20.EL kernel.I was able to
reproduce this problem on Redhat with 2.6.9-5.EL and Gentoo with
2.6.11-gentoo-r4.

Changing the buffer size of lbuf array in zcatfd function
(lib/sh/zcatfd.c) to anything greater than 128 makes bash print the
complete contents of "/proc/net/route".Bash calls the glibc read
inside the zread function(in lib/sh/zread.c) called by zcatfd.
Incidently,the first newline in /proc/net/route is the 128th character.

When the SIZE argument to read function is 128 , glibc read is
returning 0(end-of-file) after it reads the first chunk and therefore
we get a truncated output.

I was able to confirm this by running a small test program with libc
read and /proc/net/route.

Thanks,
Kalyan

On 7/16/05, Chet Ramey <chet.ramey@case.edu> wrote:
> Aron Griffis wrote:
> 
> > Bash Version: 3.0
> > Patch Level: 16
> > Release Status: release
> >
> > Description:
> >         Using bash internals to read /proc/net/route on amd64 stops
> >         reading at the end of the first line.  Tested on bash-3.0-16
> >         on Gentoo and Debian.  Also tested on alpha, ia64 and x86,
> >         none of which exhibit the problem.
> 
> I don't have any amd64 systems to test this on, so I'll have to rely
> on others' debugging.
> 
> Chet
> --
> ``The lyf so short, the craft so long to lerne.'' - Chaucer
> ( ``Discere est Dolere'' -- chet )
>                                                 Live...Laugh...Love
> Chet Ramey, ITS, CWRU    chet@case.edu    http://cnswww.cns.cwru.edu/~chet/
> 
> 
> _______________________________________________
> Bug-bash mailing list
> Bug-bash@gnu.org
> http://lists.gnu.org/mailman/listinfo/bug-bash
>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]