<p dir="ltr">Uclinux uses uclibc. Is strace supposed to work with it?</p>
<br><div class="gmail_quote"><div dir="ltr">On Mer 16 Ago 2017, 17:45 Dmitry V. Levin <<a href="mailto:ldv@altlinux.org">ldv@altlinux.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Wed, Aug 16, 2017 at 01:37:37PM +0000, Davide Palma wrote:<br>
> Hello,<br>
> I'm trying to strace an application directly in a real embedded MIPS32<br>
> chipset that runs uclinux.<br>
><br>
> This is the toolchain I used to compile strace:<br>
> david@devuan:~$ mipsel-buildroot-linux-uclibc-gcc -v<br>
> Using built-in specs.<br>
> COLLECT_GCC=/home/david/Downloads/buildroot-2017.05.2/output/host/usr/bin/mipsel-buildroot-linux-uclibc-gcc.br_real<br>
> COLLECT_LTO_WRAPPER=/home/david/Downloads/buildroot-2017.05.2/output/host/usr/libexec/gcc/mipsel-buildroot-linux-uclibc/5.4.0/lto-wrapper<br>
> Target: mipsel-buildroot-linux-uclibc<br>
> Configured with: ./configure<br>
> --prefix=/home/david/Downloads/buildroot-2017.05.2/output/host/usr<br>
> --sysconfdir=/home/david/Downloads/buildroot-2017.05.2/output/host/etc<br>
> --enable-static --target=mipsel-buildroot-linux-uclibc<br>
> --with-sysroot=/home/david/Downloads/buildroot-2017.05.2/output/host/usr/mipsel-buildroot-linux-uclibc/sysroot<br>
> --disable-__cxa_atexit --with-gnu-ld --disable-libssp --disable-multilib<br>
> --with-gmp=/home/david/Downloads/buildroot-2017.05.2/output/host/usr<br>
> --with-mpc=/home/david/Downloads/buildroot-2017.05.2/output/host/usr<br>
> --with-mpfr=/home/david/Downloads/buildroot-2017.05.2/output/host/usr<br>
> --with-pkgversion='Buildroot 2017.05.2' --with-bugurl=<br>
> <a href="http://bugs.buildroot.net/" rel="noreferrer" target="_blank">http://bugs.buildroot.net/</a> --disable-libquadmath --disable-libsanitizer<br>
> --enable-tls --disable-libmudflap --enable-threads --without-isl<br>
> --without-cloog --with-float=soft --disable-decimal-float<br>
> --with-arch=mips32 --with-abi=32 --enable-languages=c<br>
> --with-build-time-tools=/home/david/Downloads/buildroot-2017.05.2/output/host/usr/mipsel-buildroot-linux-uclibc/bin<br>
> --enable-shared --disable-libgomp<br>
> Thread model: posix<br>
> gcc version 5.4.0 (Buildroot 2017.05.2)<br>
><br>
><br>
> And this is what happens in the system:<br>
> # ./strace -V<br>
> strace -- version 4.15<br>
> # ./strace -dv echo foo<br>
> ./strace: ptrace_setoptions = 0x51<br>
> ./strace: PTRACE_SEIZE doesn't work<br>
> ./strace: new tcb for pid 323, active tcbs:1<br>
> ./strace: [wait(0x00177f) = 323] WIFSTOPPED,sig=SIGSTOP<br>
> ./strace: pid 323 has TCB_STARTUP, initializing it<br>
> ./strace: setting opts 0x51 on pid 323<br>
> ./strace: ignored SIGSTOP on pid 323<br>
> ./strace: [wait(0x00857f) = 323] WIFSTOPPED,sig=133<br>
> execve(./strace: process_vm_readv: Unknown error -89<br>
> 0x7fad0a68, ./strace: process_vm_readv: Unknown error -89<br>
> 0x7fad1ebc, ./strace: process_vm_readv: Unknown error -89<br>
> 0x7fad1ec8./strace: [wait(0x04057f) = 323]<br>
> WIFSTOPPED,sig=SIGTRAP,EVENT_EXEC (4)<br>
> ./strace: [wait(0x00857f) = 323] WIFSTOPPED,sig=133<br>
> ) = 0<br>
> ./strace: [wait(0x00857f) = 323] WIFSTOPPED,sig=133<br>
> ./strace: process_vm_readv: Unknown error -89<br>
> mmap(<br>
> //strace hangs up here, I press control c<br>
> ./strace: cleanup: looking at pid 323<br>
> ./strace: Process 323 detached<br>
> ./strace: dropped tcb for pid 323, 0 remain<br>
>  <detached ...><br>
> #<br>
><br>
> What do you suggest me to do?<br>
<br>
-89 == -ENOSYS on mips; looks like syscall() function provided by libc<br>
does not initialize errno properly.<br>
<br>
<br>
--<br>
ldv<br>
</blockquote></div>