[BusyBox] Re: login buggy also in 1.00pre5

Friedrich Lobenstock fl at fl.priv.at
Tue Jan 6 12:43:25 UTC 2004


Rob Landley wrote on 06.01.2004 08:36 MET:
> On Monday 05 January 2004 20:48, Friedrich Lobenstock wrote:
> 
>>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)
> 
> 
> Any way to get a stack trace?  It's dying in a library function, that doesn't 
> say where it was called from.  (A grep of loginutils/login.c doesn't show any 
> instances of "setgroups"...)

This is a stack trace (bt...back trace), or am I wrong?
The problem is I don't have a glibc with debug symbols
as it was compiled by Axis an installed as rpm.
I tried linking it statically but now luck.

The thing is if I create it with my little wrapper like this:

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  ./libpwdgrp/libpwdgrp.a -lm -lcrypt

This login then creates a segfault too. BUT if I remove the
"./libpwdgrp/libpwdgrp.a" from the linking like this:

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

I get a perfectly working program that works without a fault.

When I read the file "libpwdgrp/setgroups.c" I read (right at the top)
/*
  * Taken from the set of syscalls for uClibc
  *

What is this code good for? Excuse my dumb question. Is it probably
only needed for uClibc and not for Glibc?

-- 
MfG / Regards
Friedrich Lobenstock




More information about the busybox mailing list