Unable to use strace in embedded mips system

Dmitry V. Levin ldv at altlinux.org
Wed Aug 16 15:45:16 UTC 2017


On Wed, Aug 16, 2017 at 01:37:37PM +0000, Davide Palma wrote:
> Hello,
> I'm trying to strace an application directly in a real embedded MIPS32
> chipset that runs uclinux.
> 
> This is the toolchain I used to compile strace:
> david at devuan:~$ mipsel-buildroot-linux-uclibc-gcc -v
> Using built-in specs.
> COLLECT_GCC=/home/david/Downloads/buildroot-2017.05.2/output/host/usr/bin/mipsel-buildroot-linux-uclibc-gcc.br_real
> COLLECT_LTO_WRAPPER=/home/david/Downloads/buildroot-2017.05.2/output/host/usr/libexec/gcc/mipsel-buildroot-linux-uclibc/5.4.0/lto-wrapper
> Target: mipsel-buildroot-linux-uclibc
> Configured with: ./configure
> --prefix=/home/david/Downloads/buildroot-2017.05.2/output/host/usr
> --sysconfdir=/home/david/Downloads/buildroot-2017.05.2/output/host/etc
> --enable-static --target=mipsel-buildroot-linux-uclibc
> --with-sysroot=/home/david/Downloads/buildroot-2017.05.2/output/host/usr/mipsel-buildroot-linux-uclibc/sysroot
> --disable-__cxa_atexit --with-gnu-ld --disable-libssp --disable-multilib
> --with-gmp=/home/david/Downloads/buildroot-2017.05.2/output/host/usr
> --with-mpc=/home/david/Downloads/buildroot-2017.05.2/output/host/usr
> --with-mpfr=/home/david/Downloads/buildroot-2017.05.2/output/host/usr
> --with-pkgversion='Buildroot 2017.05.2' --with-bugurl=
> http://bugs.buildroot.net/ --disable-libquadmath --disable-libsanitizer
> --enable-tls --disable-libmudflap --enable-threads --without-isl
> --without-cloog --with-float=soft --disable-decimal-float
> --with-arch=mips32 --with-abi=32 --enable-languages=c
> --with-build-time-tools=/home/david/Downloads/buildroot-2017.05.2/output/host/usr/mipsel-buildroot-linux-uclibc/bin
> --enable-shared --disable-libgomp
> Thread model: posix
> gcc version 5.4.0 (Buildroot 2017.05.2)
> 
> 
> And this is what happens in the system:
> # ./strace -V
> strace -- version 4.15
> # ./strace -dv echo foo
> ./strace: ptrace_setoptions = 0x51
> ./strace: PTRACE_SEIZE doesn't work
> ./strace: new tcb for pid 323, active tcbs:1
> ./strace: [wait(0x00177f) = 323] WIFSTOPPED,sig=SIGSTOP
> ./strace: pid 323 has TCB_STARTUP, initializing it
> ./strace: setting opts 0x51 on pid 323
> ./strace: ignored SIGSTOP on pid 323
> ./strace: [wait(0x00857f) = 323] WIFSTOPPED,sig=133
> execve(./strace: process_vm_readv: Unknown error -89
> 0x7fad0a68, ./strace: process_vm_readv: Unknown error -89
> 0x7fad1ebc, ./strace: process_vm_readv: Unknown error -89
> 0x7fad1ec8./strace: [wait(0x04057f) = 323]
> WIFSTOPPED,sig=SIGTRAP,EVENT_EXEC (4)
> ./strace: [wait(0x00857f) = 323] WIFSTOPPED,sig=133
> ) = 0
> ./strace: [wait(0x00857f) = 323] WIFSTOPPED,sig=133
> ./strace: process_vm_readv: Unknown error -89
> mmap(
> //strace hangs up here, I press control c
> ./strace: cleanup: looking at pid 323
> ./strace: Process 323 detached
> ./strace: dropped tcb for pid 323, 0 remain
>  <detached ...>
> #
> 
> What do you suggest me to do?

-89 == -ENOSYS on mips; looks like syscall() function provided by libc
does not initialize errno properly.


-- 
ldv
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20170816/7d516795/attachment.bin>


More information about the Strace-devel mailing list