tech-net archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: COMPAT_50 vs NET_RT_IFLIST
On Fri, 26 Apr 2019, Paul Goyette wrote:
On Thu, 25 Apr 2019, Mouse wrote:
I have, at work, a program, designed and written under 5.2 [...].
I just now tried running this, with the associated 5.2 userland
fragments, under an 8.0 kernel [...].
Let me know if there's any way I can help.
About all I can think of at the moment would be to try 5.2 userland
with an 8.0 kernel, with a particular focus on network interfaces
(things like ifconfig -l, ifconfig -au, etc). Either replace a 5.2
system's kernel with an 8.0 kernel or run a 5.2 userland chrooted on an
8.0 system, those are how I'd try it.
I don't _think_ anything I've done to the system is relevant here, but
it would be nice to have that confirmed-or-refuted before I (or anyone
else for that matter) starts chasing after it. The turnkey system in
question does require some changes in order to run, and it's possible,
albeit unlikely, that something else slipped in.
I'm going to try to find the time to pull over completely stock 5.2 and
try that, but (a) it may take some time for me to scrape up the round
tuits for that and (b) relatively independent attempts to reproduce it
would be nice in any case.
Well, I'm not super-familiar with setting up test environments using
chroot, but I was unable to get a qemu install of 5.2 (seems that
recent qemu doesn't deal well with piixide driver). So I created a
new directory, and unpacked the 5.2 base.tgz distribution set in it.
I then did a chroot to the new directory, and tried to run ifconfig.
The results are not what I expected. First, I verified that I had
all the right pieces inside the chroot directory - everything looks
good - at least its all from the right year!
# ls -l /sbin/ifconfig
-r-xr-xr-x 1 0 20 114557 Nov 28 2012 /sbin/ifconfig
# ldd /sbin/ifconfig
/sbin/ifconfig:
-lutil.7 => /lib/libutil.so.7
-lc.12 => /lib/libc.so.12
-lprop.0 => /lib/libprop.so.0
# ls -l /lib/libutil.so*
lrwxrwxr-x 1 0 20 15 Nov 28 2012 /lib/libutil.so -> libutil.so.7.15
lrwxrwxr-x 1 0 20 15 Nov 28 2012 /lib/libutil.so.7 -> libutil.so.7.15
-r--r--r-- 1 0 20 96585 Nov 28 2012 /lib/libutil.so.7.15
# ls -l /lib/libc.so*
lrwxrwxr-x 1 0 20 14 Nov 28 2012 /lib/libc.so -> libc.so.12.164
lrwxrwxr-x 1 0 20 14 Nov 28 2012 /lib/libc.so.12 -> libc.so.12.164
-r--r--r-- 1 0 20 1317667 Nov 28 2012 /lib/libc.so.12.164
# ls -l /lib/libprop*
lrwxrwxr-x 1 0 20 14 Nov 28 2012 /lib/libprop.so -> libprop.so.0.7
lrwxrwxr-x 1 0 20 14 Nov 28 2012 /lib/libprop.so.0 -> libprop.so.0.7
-r--r--r-- 1 0 20 82138 Nov 28 2012 /lib/libprop.so.0.7
But, ifconfig fails to run:
# ifconfig -l
ifconfig: getifaddrs: No such file or directory
# ifconfig -a
ifconfig: getifaddrs: No such file or directory
FWIW, this is running on a -current host (8.99.37, from yesterday), and
with the compat_50 (and above) modules loaded.
# modstat | grep compat
compat_50 exec filesys - 0 - compat_60
compat_60 exec filesys a 1 - compat_70
compat_70 exec filesys a 1 - compat_80
compat_80 exec filesys a 1 - -
compat_util misc builtin - 0 - -
# uname -a
NetBSD speedy.whooppee.com 8.99.37 NetBSD 8.99.37 (SPEEDY 2019-04-24 23:45:06
UTC) #0: Thu Apr 25 09:00:09 UTC 2019
paul%speedy.whooppee.com@localhost:/build/netbsd-local/obj/amd64/sys/arch/amd64/compile/SPEEDY
amd64
Digging just a little bit deeper with ktrace/kdump, I find
7806 1 ifconfig CALL __sysctl(0x7f7fff5d66d0,6,0,0x7f7fff5d66e8,0,0)
7806 1 ifconfig RET __sysctl -1 errno 2 No such file or directory
7806 1 ifconfig CALL write(2,0x7f7fff5d5ce0,0xa)
7806 1 ifconfig GIO fd 2 wrote 10 bytes
"ifconfig: "
7806 1 ifconfig RET write 10/0xa
7806 1 ifconfig CALL write(2,0x7f7fff5d5dc0,0xa)
7806 1 ifconfig GIO fd 2 wrote 10 bytes
"getifaddrs"
7806 1 ifconfig RET write 10/0xa
7806 1 ifconfig CALL write(2,0x774133de753f,2)
7806 1 ifconfig GIO fd 2 wrote 2 bytes
": "
7806 1 ifconfig RET write 2
7806 1 ifconfig CALL issetugid
7806 1 ifconfig RET issetugid 0
7806 1 ifconfig CALL issetugid
7806 1 ifconfig RET issetugid 0
7806 1 ifconfig CALL open(0x7f7fff5d5900,0,0)
7806 1 ifconfig NAMI "/usr/share/nls/nls.alias.db"
7806 1 ifconfig RET open -1 errno 2 No such file or directory
So looks to me like the sysctl() call is failing.
+--------------------+--------------------------+-----------------------+
| Paul Goyette | PGP Key fingerprint: | E-mail addresses: |
| (Retired) | FA29 0E3B 35AF E8AE 6651 | paul%whooppee.com@localhost |
| Software Developer | 0786 F758 55DE 53BA 7731 | pgoyette%netbsd.org@localhost |
+--------------------+--------------------------+-----------------------+
Home |
Main Index |
Thread Index |
Old Index