<!doctype html>
<html>
<head>
<meta charset="UTF-8">
</head>
<body>
<div class="mail-detail-content plain-text noI18n colorQuoted simple-mail" role="complementary" aria-label="Possible parsing bug when -xx is passed on systems with virtual interfaces">
<div>
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:
</div>
<br>
<div>
strace: sprint_ifname: got unexpected return value 66 for snprintf(buf, 38, ("if_nametoindex(\"" "%s" "\")"), name_quoted)
</div>
<br>
<div>
The following steps should reproduce this issue in a fresh Debian 11 environment:
</div>
<br>
<div>
1. Ensure `strace`, `iproute2`, and `whois` are installed
</div>
<div>
2. Setup a new virtual Ethernet pair: `ip link add name testi0 type veth peer name testo0`
</div>
<div>
3. Bring both interfaces up: `ip link set testi0 up; ip link set testo0 up;`
</div>
<div>
4. Run whois through strace: `strace -f -xx whois example.com`
</div>
<br>
<div>
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@testo0` and `testo0@testi0`).
</div>
<br>
<div>
Apologies if this is a known issue.
</div>
</div>
</body>
</html>