ash r21030 broken?

Denys Vlasenko vda.linux at googlemail.com
Tue Feb 19 20:42:36 UTC 2008


On Tuesday 19 February 2008 21:17, Cristian Ionescu-Idbohrn wrote:
> On Tue, 19 Feb 2008, Denys Vlasenko wrote:
> 
> > I got around to trying to reproduce, and you know what?
> > It works for me:
> 
> I was afraid wou'd say that :)
> 
> > 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 #
> 
> Yes.  That works for me too, x86, sort of, doesn't segfault:
>   gcc (GCC) 4.2.3 (Debian 4.2.3-1)
>   libc-2.7.so
> 
> Pointer values and strings (in some cases) look wrong to me.
> Please see attached ash.PAGER.err.gz and ash.PAGE.err.gz.

Is this on x86 with .config I sent?

Which line is "LINE 5952" (which is last seen before segfault I guess)?

Let's make it simpler to read. Replace "LINE n" messages with "Line A",
"Line B" etc. Paste into email C code where you have these prints
so that reader can see where each "Line X" is.

For example:

                if (var_str_list) {
                        unsigned name_len = (strchrnul(name, '=') - name) + 1;
bb_error_msg("name '%s' name_len:%d", name, name_len);
                        p = NULL;
                        do {
                                char *str, *eq;
                                str = var_str_list->text;
bb_error_msg("var_str_list %p str: %p '%s'", var_str_list, str, str);
                                eq = strchr(str, '=');
bb_error_msg("line A");
                                if (!eq) /* stop at first non-assignment */
                                        break;
bb_error_msg("line B");
                                eq++;



Running it:

# cat z
RUNLEVEL=3
for B in $RUNLEVEL; do echo $B; done
# ./busybox ash z
ash: name 'B=' name_len:2
ash: var_str_list 0x810e284 str: 0x810e27c 'echo'
ash: line A
3

# cat z2
for B in $UNSETVAR; do echo $B; done
# ./busybox ash z2
(no output)
# 

--
vda



More information about the busybox mailing list