Possible parsing bug when -xx is passed on systems with virtual interfaces
Eugene Syromyatnikov
evgsyr at gmail.com
Fri May 6 22:22:43 UTC 2022
On Fri, May 6, 2022 at 7:06 PM Sulaiman AlIbrahim سليمان الإبراهيم
<sulaiman at kutometa.com> wrote:
>
> 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`).
My guess would be that commit v5.15~1[1] is missing. Does the issue
appear with strace 5.15 or newer?
[1] https://gitlab.com/strace/strace/-/commit/e27b06773eaf
--
Eugene Syromyatnikov
mailto:evgsyr at gmail.com
xmpp:esyr at jabber.{ru|org}
More information about the Strace-devel
mailing list