On Tuesday 19 February 2008 16:28, Cristian Ionescu-Idbohrn wrote:
> On Tue, 19 Feb 2008, Cristian Ionescu-Idbohrn wrote:
> 
> > Doesn't look that way :(  Seems to bail out on this line (see attached
> > diff).
> >
> >                             eq = strchr(str, '=');
> >
> > str is pointing to something, but that doesn't seem to be the right
> > thing (uninitialized?).

I got around to trying to reproduce, and you know what?
It works for me:

sh-3.2# export RUNLEVEL=3
sh-3.2# ./busybox ash
/.1/usr/srcdevel/bbox/fix/busybox.t1 # for B in $RUNLEVEL; do echo $B; done
ash: name_len:2    <====== debug
ash: str:'echo'    <====== debug
3
/.1/usr/srcdevel/bbox/fix/busybox.t1 # exit

Same with unset variable:

sh-3.2# ./busybox ash
/.1/usr/srcdevel/bbox/fix/busybox.t1 # for B in $RUNLEVE; do echo $B; done
(no output, as expected)
/.1/usr/srcdevel/bbox/fix/busybox.t1 #

.config is attached. I build busybox against static uclibc as follows:

vda_mk.sh:

export ARCH=i386
export CROSS_COMPILE=i486-linux-uclibc-
test x"$CROSS_COMPILE" = x || cross="CROSS_COMPILE=$CROSS_COMPILE"
nice -n 10 make $cross "$@"

Can you try with my .config?


> > # for B in $VAR;do echo $B;done
> > sh: LINE 5907
> > sh: LINE 5914: name='VAR=', name_len=4
> > sh: LINE 5916
> > sh: LINE 5920
> > sh: LINE 5923
> 
> Yes.  Something fishy going on.  This is what happens during init
> (runlevel 3, init scripts), a few steps before ash segfaults; please
> compare the var_str_list and str pointer values:
> 
> ,----
> | + [ N ]
> | sh: LINE 5907
> | sh: LINE 5914: name='runlevel=', name_len=9
> | sh: LINE 5916
> | sh: LINE 5920: var_str_list=0x00118404, str=0x001183fc

Value of pointer doesn't seem to be terribly wrong.
Can you just printf str? bb_error_msg("LINE %d str %p '%s", __LINE__, str, str);

> | sh: LINE 5923
> | sh: LINE 5925
> | sh: LINE 5943
> | sh: LINE 5946
> | sh: LINE 5948
> | sh: LINE 5950
> | sh: LINE 5952
> | + echo New runlevel: 3
> | New runlevel: 3
> | sh: LINE 5907
> | sh: LINE 5914: name='runlevel=.d', name_len=9
> | sh: LINE 5916
> | sh: LINE 5920: var_str_list=0x0011840c, str=0x00118414
> | sh: LINE 5923
> | sh: LINE 5925
> | sh: LINE 5943
> | sh: LINE 5946
> | sh: LINE 5948
> | sh: LINE 5950
> | sh: LINE 5952
> | + [ -d /etc/rc3.d ]
> | sh: LINE 5907
> | sh: LINE 5914: name='prevlevel=', name_len=10
> | sh: LINE 5916
> | sh: LINE 5920: var_str_list=0x0011840c, str=0x00118414
> | sh: LINE 5923
> | sh: LINE 5925
> | sh: LINE 5943
> | sh: LINE 5946
> | sh: LINE 5948
> | sh: LINE 5950
> | sh: LINE 5952
> | + [ N != N ]
> | sh: LINE 5907
> | sh: LINE 5914: name='runlevel=.d/S??*', name_len=9
> | sh: LINE 5916
> | sh: LINE 5920: var_str_list=0x000b5bee, str=0x8feee1fc
> | sh: LINE 5923
> | rc (pid 75) segfaults for page address 8feee000 at pc 355a06a6
> `----
> 
> A new shell is started at this point, which also segfaults when I
> execute the following:
> 
> ,----
> | # for B in $VAR;do echo $B;done
> | sh: LINE 5907
> | sh: LINE 5914: name='VAR=', name_len=4
> | sh: LINE 5916
> | sh: LINE 5920: var_str_list=0x000b81c2, str=0x201892c1
> | sh: LINE 5923
> | sh (pid 72) segfaults for page address 20188000 at pc 355a06a6
> `----
> 
> 
> 
> Cheers,
> 

Attachment: .config.bz2
Description: BZip2 compressed data

_______________________________________________
busybox mailing list
[email protected]
http://busybox.net/cgi-bin/mailman/listinfo/busybox

Reply via email to