Possible parsing bug when -xx is passed on systems with virtual interfaces

Sulaiman AlIbrahim سليمان الإبراهيم sulaiman at kutometa.com
Fri May 6 11:14:14 UTC 2022


I'm using strace on a system with active virtual network devices. I noticed that strace reliably fails the moment a traced program attempts to access the network when I pass the -xx flag. strace prints the following message:

    strace: sprint_ifname: got unexpected return value 66 for snprintf(buf, 38, ("if_nametoindex(\"" "%s" "\")"), name_quoted)

The following steps should reproduce this issue in a fresh Debian 11 environment:

1. Ensure `strace`, `iproute2`, and `whois` are installed
2. Setup a new virtual Ethernet pair: `ip link add name testi0 type veth peer name testo0`
3. Bring both interfaces up: `ip link set testi0 up; ip link set testo0 up;`
4. Run whois through strace: `strace -f -xx whois example.com`

I want to note that strace works as expected if -xx is removed. I believe the issue might be caused by the presence of additional peer segments in the name of the veth devices (the '@...' in `testi0 at testo0` and `testo0 at testi0`).

Apologies if this is a known issue.


More information about the Strace-devel mailing list