[Ltrace-devel] ltrace v0.7.0-git: Session on a Freetz MIPSEL router box

Sedat Dilek sedat.dilek at gmail.com
Mon Sep 3 17:28:34 UTC 2012


On Mon, Sep 3, 2012 at 12:50 PM, Petr Machata <pmachata at redhat.com> wrote:
> Sedat Dilek <sedat.dilek at gmail.com> writes:
>
>> as promised here my first impressions on ltrace v0.7.0-git on my
>> MIPSEL router.
>
> Thank you for this.  I'm trying to install Debian Wheezy on emulated
> MIPS64el as I write this, but it takes ages to finish.
>
>> I have built ltrace statically against libelf-0.8.13,
>> libstdc++.so.6.0.16 and etc.(see attached patch).
>>
>> Then, I uploaded ltrace binary together with upstream's ltrace.conf to
>> /var/tmp/{etc}.
>>
>> Unfortunately, ltrace fails when tracing running daemons or ELF
>> binaries.
>
> Daemons could be PIE (position independent) binaries, those are not
> supported by ltrace.
>
>> I played a bit with --debug=LEVEL... I could see that the new config
>> is used (required!) but using other parameters flooded here my box.
>> Can you help with debugging?
>
> The config itself is only interesting for formatting displayed library
> calls.  You could just pass -F /dev/null.  (But it doesn't hurt if the
> file is there.)
>
>> root at fritz:/# cat /proc/version
>> Linux version 2.6.13.1-ohio () (gcc version 3.4.6) #1 Tue Mar 27
>> 16:53:06 CEST 2012
>>
>> root at fritz:/# cat /proc/cpuinfo
>> system type             : MIPS OHIO
>> processor               : 0
>> cpu model               : MIPS 4KEc V4.8
>> BogoMIPS                : 211.35
>> wait instruction        : yes
>> microsecond timers      : yes
>> tlb_entries             : 16
>> extra interrupt vector  : yes
>> hardware watchpoint     : yes
>> VCED exceptions         : not available
>> VCEI exceptions         : not available
>>
>> [ Start ltrace session ]
>>
>> root at fritz:/# ls -l /var/tmp/ltrace /var/tmp/etc/ltrace.conf
>> -rw-r--r--    1 root     root         15598 Sep  2 15:49
>> /var/tmp/etc/ltrace.conf
>> -rwxr-xr-x    1 root     root        297220 Sep  2 15:49 /var/tmp/ltrace
>>
>> root at fritz:/# ldd /var/tmp/ltrace
>>         not a dynamic executable
>>
>> root at fritz:/# /var/tmp/ltrace --version
>> ltrace version 0.7.0-git.
>> Copyright (C) 1997-2009 Juan Cespedes <cespedes at debian.org>.
>> This is free software; see the GNU General Public Licence
>> version 2 or later for copying conditions.  There is NO warranty.
>>
>> root at fritz:/# ps w | grep d[s]ld
>>   621 root         0 RWN  [kdsld_token]
>>   575 root      4000 S    dsld -g -i -n
>>
>> root at fritz:/# /var/tmp/ltrace --config=/var/tmp/etc/ltrace.conf -p $(pidof dsld)
>> --- SIGSTOP (Stopped (signal)) ---
>> --- SIGSTOP (Stopped (signal)) ---
>>
>> root at fritz:/# /var/tmp/ltrace --config=/var/tmp/etc/ltrace.conf /sbin/dsltest
>> unexpected breakpoint at 0x2acaf3d8
>> unexpected breakpoint at 0x2acaf3d8
>> unexpected breakpoint at 0x2acaf3d8
>> unexpected breakpoint at 0x2acaf3d8
>> unexpected breakpoint at 0x2acaf3d8
>> unexpected breakpoint at 0x2acaf3d8
>> unexpected breakpoint at 0x2acaf3d8
>> unexpected breakpoint at 0x2acaf3d8
>> unexpected breakpoint at 0x2acaf3d8
>> unexpected breakpoint at 0x2acaf3d8
>> unexpected breakpoint at 0x2acaf3d8
>> unexpected breakpoint at 0x2acaf3d8
>> +++ exited (status 3) +++
>
> Could you compile a trivial binary and see if that happens to work?  As
> in:
>
> $ echo 'int main() { puts("blah"); }' | gcc -x c -
> $ ltrace ./a.out
>

Here we go...

[ Build-Host ]

$ ./toolchain/build/mipsel_gcc-4.6.3_uClibc-0.9.32.1/mipsel-linux-uclibc/bin/mipsel-linux-uclibc-gcc
-v
Using built-in specs.
COLLECT_GCC=./toolchain/build/mipsel_gcc-4.6.3_uClibc-0.9.32.1/mipsel-linux-uclibc/bin/mipsel-linux-uclibc-gcc
COLLECT_LTO_WRAPPER=/home/wearefam/src/freetz/freetz-git/toolchain/build/mipsel_gcc-4.6.3_uClibc-0.9.32.1/mipsel-linux-uclibc/bin/../libexec/gcc/mipsel-linux-uclibc/4.6.3/lto-wrapper
Target: mipsel-linux-uclibc
Configured with:
/home/cam/freetz/source/toolchain-mipsel_gcc-4.6.3_uClibc-0.9.32.1/gcc-4.6.3/configure
--prefix=/home/cam/freetz/toolchain/build/mipsel_gcc-4.6.3_uClibc-0.9.32.1/mipsel-linux-uclibc
--with-sysroot=/home/cam/freetz/toolchain/build/mipsel_gcc-4.6.3_uClibc-0.9.32.1/mipsel-linux-uclibc/usr/
--build=i386-pc-linux-gnu --host=i386-pc-linux-gnu
--target=mipsel-linux-uclibc --enable-languages=c,c++ --enable-shared
--enable-threads --with-gmp=/home/cam/freetz/tools/build
--with-mpfr=/home/cam/freetz/tools/build
--with-mpc=/home/cam/freetz/tools/build --with-gnu-ld
--disable-__cxa_atexit --disable-libgomp --disable-libmudflap
--disable-multilib --disable-tls --disable-fixed-point
--with-float=soft --enable-cxx-flags=-msoft-float --disable-libssp
--with-march=4kc --disable-nls --with-mips-plt --disable-decimal-float
Thread model: posix
gcc version 4.6.3 (GCC)

$ echo 'int main() { puts("blah"); }' |
./toolchain/build/mipsel_gcc-4.6.3_uClibc-0.9.32.1/mipsel-linux-uclibc/bin/mipsel-linux-uclibc-gcc
-x c -

$ scp -v -p a.out root at 192.168.178.1:/var/tmp

$ ssh root at 192.168.178.1

[ SSH session ]

root at fritz:/var/tmp# ls -l ltrace ltrace.conf a.out
-rwxr-xr-x    1 root     root          5550 Sep  3 19:21 a.out
-rwxr-xr-x    1 root     root        267980 Sep  3 18:42 ltrace
-rw-r--r--    1 root     root         15598 Sep  3 18:42 ltrace.conf

root at fritz:/var/tmp# ./ltrace --config=ltrace.conf ./a.out
blah
+++ exited (status 5) +++

Regards,
- Sedat -

P.S.: "a.out" file attached!

> Thank you,
> PM
-------------- next part --------------
A non-text attachment was scrubbed...
Name: a.out
Type: application/octet-stream
Size: 5550 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/ltrace-devel/attachments/20120903/2d31d208/attachment.obj>


More information about the Ltrace-devel mailing list