rpm & buildroot
Hi Guys,
I'm working on adding rpm to buildroot and after 3 days of working and hacking rpm to be uclibc compatible I've got this problem...
Is it obvious what I"m doing wrong or something I can do to track this issue further?
# rpm argc=1 argv=0xbff8dc74 envp=0xbff8dc7c ELF header=0xb7f90000 First Dynamic section entry=0xb7f9aefc Scanning DYNAMIC section Done scanning DYNAMIC section About to do library loader relocations Done relocating ldso; we can now use globals and make function calls! _dl_get_ready_to_run:169: Cool, ldso survived making function calls _dl_get_ready_to_run:261: Position Independent Executable: app_tpnt->loadaddr=0x80000000 _dl_malloc:892: mmapping more memory _dl_get_ready_to_run:340: Lib Loader: (0xb7f90000) /lib/ld-uClibc.so.0 _dl_get_ready_to_run:609: Loading: (0xb7f1e000) /usr/lib/librpm-4.4.so _dl_get_ready_to_run:609: Loading: (0xb7dd4000) /usr/lib/librpmdb-4.4.so _dl_get_ready_to_run:609: Loading: (0xb7d4b000) /usr/lib/librpmio-4.4.so _dl_get_ready_to_run:609: Loading: (0xb7d45000) /usr/lib/libpopt.so.0 _dl_get_ready_to_run:609: Loading: (0xb7d10000) /usr/lib/libbeecrypt.so.6 _dl_get_ready_to_run:609: Loading: (0xb7cfb000) /usr/lib/libneon.so.25 _dl_get_ready_to_run:609: Loading: (0xb7cda000) /usr/lib/libexpat.so.1 _dl_get_ready_to_run:609: Loading: (0xb7cc9000) /lib/libm.so.0 _dl_get_ready_to_run:609: Loading: (0xb7cc4000) /lib/libdl.so.0 _dl_get_ready_to_run:609: Loading: (0xb7cb4000) /usr/lib/libz.so.1 _dl_get_ready_to_run:609: Loading: (0xb7c9e000) /lib/libpthread.so.0 _dl_get_ready_to_run:609: Loading: (0xb7c39000) /lib/libc.so.0 _dl_get_ready_to_run:609: Loading: (0xb7dd4000) /usr/lib/librpmdb-4.4.so _dl_get_ready_to_run:609: Loading: (0xb7d4b000) /usr/lib/librpmio-4.4.so _dl_get_ready_to_run:609: Loading: (0xb7d45000) /usr/lib/libpopt.so.0 _dl_get_ready_to_run:609: Loading: (0xb7c39000) /lib/libc.so.0 _dl_get_ready_to_run:609: Loading: (0xb7d4b000) /usr/lib/librpmio-4.4.so _dl_get_ready_to_run:609: Loading: (0xb7d45000) /usr/lib/libpopt.so.0 _dl_get_ready_to_run:609: Loading: (0xb7c9e000) /lib/libpthread.so.0 _dl_get_ready_to_run:609: Loading: (0xb7c39000) /lib/libc.so.0 _dl_get_ready_to_run:609: Loading: (0xb7d10000) /usr/lib/libbeecrypt.so.6 _dl_get_ready_to_run:609: Loading: (0xb7cfb000) /usr/lib/libneon.so.25 _dl_get_ready_to_run:609: Loading: (0xb7cc9000) /lib/libm.so.0 _dl_get_ready_to_run:609: Loading: (0xb7cc4000) /lib/libdl.so.0 _dl_get_ready_to_run:609: Loading: (0xb7cb4000) /usr/lib/libz.so.1 _dl_get_ready_to_run:609: Loading: (0xb7c9e000) /lib/libpthread.so.0 _dl_get_ready_to_run:609: Loading: (0xb7c39000) /lib/libc.so.0 _dl_get_ready_to_run:609: Loading: (0xb7c39000) /lib/libc.so.0 _dl_get_ready_to_run:609: Loading: (0xb7c9e000) /lib/libpthread.so.0 _dl_get_ready_to_run:609: Loading: (0xb7cc4000) /lib/libdl.so.0 _dl_get_ready_to_run:609: Loading: (0xb7c39000) /lib/libc.so.0 _dl_get_ready_to_run:609: Loading: (0xb7cb4000) /usr/lib/libz.so.1 _dl_get_ready_to_run:609: Loading: (0xb7cda000) /usr/lib/libexpat.so.1 _dl_get_ready_to_run:609: Loading: (0xb7c39000) /lib/libc.so.0 _dl_get_ready_to_run:609: Loading: (0xb7c39000) /lib/libc.so.0 _dl_get_ready_to_run:609: Loading: (0xb7c39000) /lib/libc.so.0 _dl_get_ready_to_run:609: Loading: (0xb7c39000) /lib/libc.so.0 _dl_get_ready_to_run:609: Loading: (0xb7c39000) /lib/libc.so.0 _dl_get_ready_to_run:609: Loading: (0xb7c39000) /lib/libc.so.0 _dl_get_ready_to_run:736: Beginning relocation fixups Segmentation fault
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://busybox.net/lists/buildroot/attachments/20080324/b43c367a/attachment.pgp
Nigel,
Why RPM? Busybox has facilities for dpkg, and I added ipkg to buildroot recently too. Isn't RPM a little bit too much of a resource hog for embedded use? I know it would be nice, but is it really practical?
John Voltz
Quoted 66 lines · Nigel Kukard
Hi Guys,
I'm working on adding rpm to buildroot and after 3 days of working and hacking rpm to be uclibc compatible I've got this problem...
Is it obvious what I"m doing wrong or something I can do to track this issue further?
# rpm argc=1 argv=0xbff8dc74 envp=0xbff8dc7c ELF header=0xb7f90000 First Dynamic section entry=0xb7f9aefc Scanning DYNAMIC section Done scanning DYNAMIC section About to do library loader relocations Done relocating ldso; we can now use globals and make function calls! _dl_get_ready_to_run:169: Cool, ldso survived making function calls _dl_get_ready_to_run:261: Position Independent Executable: app_tpnt->loadaddr=0x80000000 _dl_malloc:892: mmapping more memory _dl_get_ready_to_run:340: Lib Loader: (0xb7f90000) /lib/ld-uClibc.so.0 _dl_get_ready_to_run:609: Loading: (0xb7f1e000) /usr/lib/librpm-4.4.so _dl_get_ready_to_run:609: Loading: (0xb7dd4000) /usr/lib/librpmdb-4.4.so _dl_get_ready_to_run:609: Loading: (0xb7d4b000) /usr/lib/librpmio-4.4.so _dl_get_ready_to_run:609: Loading: (0xb7d45000) /usr/lib/libpopt.so.0 _dl_get_ready_to_run:609: Loading: (0xb7d10000) /usr/lib/libbeecrypt.so.6 _dl_get_ready_to_run:609: Loading: (0xb7cfb000) /usr/lib/libneon.so.25 _dl_get_ready_to_run:609: Loading: (0xb7cda000) /usr/lib/libexpat.so.1 _dl_get_ready_to_run:609: Loading: (0xb7cc9000) /lib/libm.so.0 _dl_get_ready_to_run:609: Loading: (0xb7cc4000) /lib/libdl.so.0 _dl_get_ready_to_run:609: Loading: (0xb7cb4000) /usr/lib/libz.so.1 _dl_get_ready_to_run:609: Loading: (0xb7c9e000) /lib/libpthread.so.0 _dl_get_ready_to_run:609: Loading: (0xb7c39000) /lib/libc.so.0 _dl_get_ready_to_run:609: Loading: (0xb7dd4000) /usr/lib/librpmdb-4.4.so _dl_get_ready_to_run:609: Loading: (0xb7d4b000) /usr/lib/librpmio-4.4.so _dl_get_ready_to_run:609: Loading: (0xb7d45000) /usr/lib/libpopt.so.0 _dl_get_ready_to_run:609: Loading: (0xb7c39000) /lib/libc.so.0 _dl_get_ready_to_run:609: Loading: (0xb7d4b000) /usr/lib/librpmio-4.4.so _dl_get_ready_to_run:609: Loading: (0xb7d45000) /usr/lib/libpopt.so.0 _dl_get_ready_to_run:609: Loading: (0xb7c9e000) /lib/libpthread.so.0 _dl_get_ready_to_run:609: Loading: (0xb7c39000) /lib/libc.so.0 _dl_get_ready_to_run:609: Loading: (0xb7d10000) /usr/lib/libbeecrypt.so.6 _dl_get_ready_to_run:609: Loading: (0xb7cfb000) /usr/lib/libneon.so.25 _dl_get_ready_to_run:609: Loading: (0xb7cc9000) /lib/libm.so.0 _dl_get_ready_to_run:609: Loading: (0xb7cc4000) /lib/libdl.so.0 _dl_get_ready_to_run:609: Loading: (0xb7cb4000) /usr/lib/libz.so.1 _dl_get_ready_to_run:609: Loading: (0xb7c9e000) /lib/libpthread.so.0 _dl_get_ready_to_run:609: Loading: (0xb7c39000) /lib/libc.so.0 _dl_get_ready_to_run:609: Loading: (0xb7c39000) /lib/libc.so.0 _dl_get_ready_to_run:609: Loading: (0xb7c9e000) /lib/libpthread.so.0 _dl_get_ready_to_run:609: Loading: (0xb7cc4000) /lib/libdl.so.0 _dl_get_ready_to_run:609: Loading: (0xb7c39000) /lib/libc.so.0 _dl_get_ready_to_run:609: Loading: (0xb7cb4000) /usr/lib/libz.so.1 _dl_get_ready_to_run:609: Loading: (0xb7cda000) /usr/lib/libexpat.so.1 _dl_get_ready_to_run:609: Loading: (0xb7c39000) /lib/libc.so.0 _dl_get_ready_to_run:609: Loading: (0xb7c39000) /lib/libc.so.0 _dl_get_ready_to_run:609: Loading: (0xb7c39000) /lib/libc.so.0 _dl_get_ready_to_run:609: Loading: (0xb7c39000) /lib/libc.so.0 _dl_get_ready_to_run:609: Loading: (0xb7c39000) /lib/libc.so.0 _dl_get_ready_to_run:609: Loading: (0xb7c39000) /lib/libc.so.0 _dl_get_ready_to_run:736: Beginning relocation fixups Segmentation fault
Quoted 5 lines
_______________________________________________
buildroot mailing list
buildroot at uclibc.org
http://busybox.net/mailman/listinfo/buildroot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://busybox.net/lists/buildroot/attachments/20080324/55b5c1e9/attachment-0001.htm
A message that is not in the archive (sent off-list or not yet received): 1206355410.3605.5.camel@nigel-x60
I just assume most people use buildroot for embedded devices, but I guess it's not restricted to that alone :)
Did you try using strace or maybe run it in a gdbserver? I use Eclipse with the RSE (Remote System Explorer) plugins. You can easily debug over ethernet this way. I wrote a quick how-to for AVR32 but it will work just the same for x86.
http://avr32linux.org/twiki/bin/view/Main/RemoteDebugging
John
Quoted 6 lines · Nigel Kukard
Quoted 5 lines
Why RPM? Busybox has facilities for dpkg, and I added ipkg to buildroot recently too. Isn't RPM a little bit too much of a resource hog for embedded use? I know it would be nice, but is it really practical?
Quoted 8 lines
Not for embedded use.
I'm using it for a rescue initramfs for x86's.
Buildroot isn't restricted to embedded use is it? ;)
-N
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://busybox.net/lists/buildroot/attachments/20080324/839413ae/attachment.htm
HI Guys,
Quoted 10 lines
I just assume most people use buildroot for embedded devices, but I guess it's not restricted to that alone :)
Did you try using strace or maybe run it in a gdbserver? I use Eclipse with the RSE (Remote System Explorer) plugins. You can easily debug over ethernet this way. I wrote a quick how-to for AVR32 but it will work just the same for x86.
I chroot'ed into the rootfs and gdb'd rpm.
Below backtrace .... is it because its using -fPIC?
GNU gdb 6.6
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 "i586-linux-uclibc"...
Using host libthread_db library "/lib/libthread_db.so.1". (gdb) run
Starting program: /bin/rpm
argc=1 argv=0xbfc4a164 envp=0xbfc4a16c
ELF header=0xb7f70000
First Dynamic section entry=0xb7f7befc
Scanning DYNAMIC section
Done scanning DYNAMIC section
About to do library loader relocations
Done relocating ldso; we can now use globals and make function calls! _dl_get_ready_to_run:169: Cool, ldso survived making function calls _dl_get_ready_to_run:261: Position Independent Executable:
app_tpnt->loadaddr=0x80000000
_dl_malloc:892: mmapping more memory _dl_get_ready_to_run:340: Lib Loader: (0xb7f70000) /lib/ld-uClibc.so.0 _dl_get_ready_to_run:286: calling mprotect on the application program
Program received signal SIGSEGV, Segmentation fault. 0xb7f74835 in _dl_get_ready_to_run (tpnt=0xbfc49da0, load_addr=3086417920, auxvt=0xbfc49d28, envp=0xbfc4a16c, argv=0xbfc4a164) at ldso/ldso/ldso.c:577
577 ldso/ldso/ldso.c: No such file or directory.
in ldso/ldso/ldso.c
(gdb)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://busybox.net/lists/buildroot/attachments/20080325/9da4b20e/attachment.pgp
Try:
(gdb) break main
(gdb) run
And you should stop at main(), unless there's a shared library bringing you down (I think). You might want to disable the security stuff in uClibc too, I don't know if that will interfere with debugging or not. There are also ways to tell gdb where the source files are and where the shared libraries are too, so you get meaningful output from gdb. I unfortunately can't tell you what they are, because I use Eclipse and it does it for me, so I don't really know how it's doing it. :(
You might want to check out the man pages for gdb :)
John
Quoted 46 lines · Nigel Kukard
HI Guys,
Quoted 10 lines
I just assume most people use buildroot for embedded devices, but I guess it's not restricted to that alone :)
Did you try using strace or maybe run it in a gdbserver? I use Eclipse with the RSE (Remote System Explorer) plugins. You can easily debug over ethernet this way. I wrote a quick how-to for AVR32 but it will work just the same for x86.
I chroot'ed into the rootfs and gdb'd rpm.
Below backtrace .... is it because its using -fPIC?
GNU gdb 6.6
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 "i586-linux-uclibc"...
Using hostlibthread_dblibrary "/lib/libthread_db.so.1". (gdb) run
Starting program:/bin/rpm
argc=1 argv=0xbfc4a164 envp=0xbfc4a16c
ELF header=0xb7f70000
First Dynamic section entry=0xb7f7befc
Scanning DYNAMIC section
Done scanning DYNAMIC section
About to do library loader relocations
Done relocating ldso; we can now use globals and make function calls! _dl_get_ready_to_run:169: Cool, ldso survived making function calls _dl_get_ready_to_run:261: Position Independent Executable:
app_tpnt->loadaddr=0x80000000
_dl_malloc:892: mmapping more memory _dl_get_ready_to_run:340: Lib Loader: (0xb7f70000)/lib/ld-uClibc.so.0_dl_get_ready_to_run:286: calling mprotect on the application program
Quoted 9 lines
Program received signal SIGSEGV, Segmentation fault.
0xb7f74835in_dl_get_ready_to_run(tpnt=0xbfc49da0, load_addr=3086417920, auxvt=0xbfc49d28, envp=0xbfc4a16c, argv=0xbfc4a164) atldso/ldso/ldso.c:577
577ldso/ldso/ldso.c: No such file or directory.
inldso/ldso/ldso.c
(gdb)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://busybox.net/lists/buildroot/attachments/20080325/1bce69e6/attachment-0001.htm