[Gllug] Debugging kernel loading initrd

John Edwards john at cornerstonelinux.co.uk
Sun Apr 27 13:46:31 UTC 2008


On Sun, Apr 27, 2008 at 02:20:15PM +0100, Richard Jones wrote:
> On Sun, Apr 27, 2008 at 02:03:42PM +0100, John Edwards wrote:
>> This had been tested to work on newer machines, but now fails
>> with Pentium CPUs:
>> ------------------------------------------------------------
>> $ sudo chroot ipcop-initrd/ /init
>> Illegal instruction
>> ------------------------------------------------------------
> 
> I'm intrigued ...  What happens when you do:
> 
>   gdb ipcop-initrd/bin/sh
>   r
>   disass

For the statically linked version of busybox:
----------------------------------------------------------------------
$ gdb ./ipcop-1.9.1_trunk-r1332+busybox-static_instroot+hello/bin/sh
GNU gdb 6.4.90-debian
Copyright (C) 2006 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 "i486-linux-gnu"...(no debugging symbols found)
Using host libthread_db library "/lib/tls/libthread_db.so.1".

(gdb) r
Starting program: /home/john/temp/ipcop-1.9.1_trunk-r1332+busybox-static_instroot+hello/bin/sh
warning: shared library handler failed to enable breakpoint
Failed to read a valid object file image from memory.

Program received signal SIGILL, Illegal instruction.
0x080630f1 in ?? ()
(gdb) disass
No function contains program counter for selected frame.
----------------------------------------------------------------------


The original dynamically linked version of busybox will not run
directly, because it needs libraries in the chroot that are different
to the Debian ones that are on the test machine.

So copied /usr/bin/gdb* into the chroot and tried:
----------------------------------------------------------------------
$ sudo chroot initrd/ /usr/bin/gdb /bin/sh
Illegal instruction
$sudo chroot initrd/ /usr/bin/gdb
Illegal instruction
----------------------------------------------------------------------

So it looks like statically linked binaries work on i586 CPUs but
dynamically linked libraries do not.


Could it be that the C libraries we are using are broken for i586?
Is so then this is more serious than just busybox being broken and
is extremely worrying for me.

The IPCop project is building glibc 2.7 using the Linux From Scratch
system:
    http://ipcop.svn.sourceforge.net/viewvc/ipcop/ipcop/trunk/lfs/glibc

I believe that for i486 and above CPUs the key configuration is:
    CFLAGS += -march=i486 -mtune=generic

The programs I have been using were built on an Intel Core 2 Duo.

Any help is very much appreciated. I've not heard anything from the
IPCop development team this weekend.


-- 
#---------------------------------------------------------#
|    John Edwards   Email: john at cornerstonelinux.co.uk    |
#---------------------------------------------------------#
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 196 bytes
Desc: Digital signature
URL: <http://mailman.lug.org.uk/pipermail/gllug/attachments/20080427/334ce396/attachment.pgp>
-------------- next part --------------
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug


More information about the GLLUG mailing list