[BusyBox] Re: login buggy also in 1.00pre5

Friedrich Lobenstock fl at fl.priv.at
Tue Jan 6 02:48:29 UTC 2004


Hello!

Erik Andersen wrote on 06.01.2004 02:30 MET:
> On Tue Jan 06, 2004 at 01:51:37AM +0100, Friedrich Lobenstock wrote:
> 
>>I wounder why I see the busybox mailinglist in the CC-header but not
>>any of your answers really make it to the list. Therefore I'm keeping
>>the full quote.
> 
> 
> My answers seem to make it to the list just fine...
> http://busybox.net/lists/busybox/2004-January/010369.html
> 
> Perhaps you have some email problems?

No I've found out you had set "Avoid duplicate copies of messages?"
globally. I've disabled it for me now.

Despite I've set a Reply-To to the list you've CC'd me. That
breaks all my filtering rules (I filter on the X-BeenThere header
for you information). So please don't do that. Thanks.


>>I have the problem also when running login from a shell or
>>from getty (here it hangs forever). So I think the telnet daemon
>>does not make a difference here. BTW I use the utelnetd that is
>>included in the Axis developer kit, which I see got included now
>>in busybox, but the sources are a little different.
> 
> 
> Hmm.  Nothing has changed in the login stuff since -pre3.
> I'm really at a loss to explain your problems.

I could make it break in pre3 too if I enabled inetd. See my
posting http://busybox.net/lists/busybox/2003-December/010186.html

>  What C library are you using?

Glibc 3.2.1

fl:/usr/local/cris> ls -d lib/gcc-lib/cris-axis-linux-gnu/3.2.1
lib/gcc-lib/cris-axis-linux-gnu/3.2.1

>>Is there a way to compile one busybox applet standalone so I could
>>run it with debug symbols under gdbserver? Because I've already
>>got gdbserver I would not have to mess with getting strace/ltrace
>>compiled.
> 
> 

I finally create a little wrapper that basically calls login_main.
An linking it with the correct stuff produces a runable exec in
pre3. So now one to pre5:

busybox-1.00-pre5> gcc-cris  -isystem /home/fl/axis/devboard_82/target/cris-axis-linux-gnu/include -mlinux -I./include -Wall -Wstrict-prototypes -Wshadow -Os -fomit-frame-pointer -D_GNU_SOURCE -DNDEBUG  -Wall -Wshadow -O2 -g  -c -o my_login.o my_login.c
busybox-1.00-pre5> gcc-cris  -isystem /home/fl/axis/devboard_82/target/cris-axis-linux-gnu/include -mlinux -L/home/fl/axis/devboard_82/target/cris-axis-linux-gnu/lib -o my_login ./my_login.o ./loginutils/loginutils.a ./libbb/libbb.a  -lm -lcrypt

Now the big suprise when I run this in the system with the rest still
being pre3 it just works:
[root at AxisProduct /mnt/flash]309# ./my_login
AxisProduct login: root
Password:
[root at AxisProduct /]375#

Now lets compile pre5 and update the system to use pre5 and then
we try it again. The same again:

[root at AxisProduct /mnt/flash]257# ./my_login
AxisProduct login: root
Password:
[root at AxisProduct /]279#

Now here comes the big mistery:

> You can build busybox with the config set to only enable that
> one busybox applet...

I did this:
busybox-1.00-pre5> sed -e "/^$/d" -e "/^#/d" .config
HAVE_DOT_CONFIG=y
CONFIG_FEATURE_BUFFERS_GO_IN_BSS=y
CONFIG_FEATURE_VERBOSE_USAGE=y
CONFIG_FEATURE_DEVPTS=y
EXTRA_CFLAGS_OPTIONS=""
PREFIX="./_install"
CONFIG_USE_BB_PWD_GRP=y
CONFIG_LOGIN=y
CONFIG_FEATURE_SECURETTY=y
CONFIG_FEATURE_SH_IS_NONE=y
CONFIG_DEBUG=y

Compiled it and copied the resulting file to the target.

[root at AxisProduct /mnt/flash]279# ls -l
-rwxr-xr-x    1 root     root       518411 Jan  6 02:32 busybox
lrwxrwxrwx    1 root     root            7 Jan  6 02:32 login -> busybox

And now we have the same thing again - segfault.

[root at AxisProduct /mnt/flash]279# ./login
AxisProduct login: root
Password:
Segmentation fault
[root at AxisProduct /mnt/flash]279#

So there is something else in the busybox source that when linked in
breaks the thing.

Here's with what I can come up from the debugger when
running "busybox login -f root":

busybox-1.00-pre5> /home/fl/axis/temp/gdb/gdb-cris-linux/gdb/gdb
GNU gdb 5.2.1
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=cris".
(gdb) file busybox
Reading symbols from busybox...done.
(gdb) target remote 192.168.1.254:1234
Remote debugging using 192.168.1.254:1234
0x35557608 in ?? ()
warning: Unable to find dynamic linker breakpoint function.
GDB will be unable to debug shared library initializers
and track explicitly loaded dynamic code.
(gdb) c
Continuing.
Error while mapping shared library sections:
/lib/ld.so.1: No such file or directory.
Error while reading shared library symbols:
/lib/ld.so.1: No such file or directory.

Program received signal SIGSEGV, Segmentation fault.
0x9fffdd40 in ?? ()
(gdb) bt
#0  0x9fffdd40 in ?? ()
#1  0x000829b8 in setgroups (size=81, list=0x85872) at libpwdgrp/setgroups.c:37
#2  0x000829b8 in setgroups (size=81, list=0x85872) at libpwdgrp/setgroups.c:37
(gdb)

Hope you can make something out of that. I'll go to bed, it's
really time now. Hear you later.

-- 
MfG / Regards
Friedrich Lobenstock




More information about the busybox mailing list