[BusyBox] for loop crash

Vladimir N. Oleynik dzo at simtreas.ru
Mon Aug 20 10:25:44 UTC 2001


"Vladimir N. Oleynik" wrote:
> 
> Matt,
> 
> > On Sun, Aug 19, 2001 at 05:48:10PM -0400, Guillaum Dallaire wrote:
> > > Matt Kraai a Иcrit :
> > >
> > > > On Sun, Aug 19, 2001 at 04:53:40PM -0400, Guillaum Dallaire wrote:
> > > > > when I try this:
> > > > >
> > > > > for item in `cat list.txt`
> > > > > do
> > > > >     echo $item
> > > > > done
> > > > >
> > > > > the busybox shell crash.
> > > > >
> > > > > any idea ?
> > > >
> > > > Which BusyBox shell, and which version of BusyBox?
> > > >
> > > > Matt
> > >
> > > busybox: 0.60.0
> > > shell : /bin/sh
> >
> > I tested your script using BusyBox msh, and it failed.  It appears
> > to not handle the `s properly.  Any shell hackers know how to fix
> > this?
> 
> But:
> msh$ i=`cat list.txt`
> also exit normaly...

but not cintinued.
 
> What I was surprise, when I have not found in msh fork()!
> Probably it will be very hard to find such mistake there, where 'cmd' it is
> realized
> without fork() though exit it is caused! I in confusion. Whether the piece from
> the
> original version with a call fork() is missed in busibox?

I have hurried. Msh called pipe+vfork for `cmd` but not correct leave 
(heh, called leave()) to interactive mode with previous fd=0 descriptor.
After all gets from pipe, function readc() called leave(). Oh.
Not quick error finding...


--w
vodz





More information about the busybox mailing list