Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Another COMPAT_* question



On Tue, 19 Feb 2013, Paul Goyette wrote:

I've got this one image which is available only as a binary, and it is a statically linked NetBSD-4.0 image

        dnetc.x86_64: ELF 64-bit LSB executable, x86-64, version 1 (SYSV),
        statically linked, for NetBSD 4.0, stripped

If I run this on a 6.99.17 kernel built from today's sources, and that kernel includes COMPAT_40, COMPAT_50, and COMPAT_60, the image starts up correctly.

However, if I boot a kernel which is identical except for those three COMPAT_* options, and then I modload the compat module, the same image fails. Using ktrace, it would seem that there is some sysctl variable missing from the compat module.

 1043      1 dnetc.x86_64 CALL  compat_50_gettimeofday(0x7f7fffffd670,0)
 1043      1 dnetc.x86_64 RET   compat_50_gettimeofday 0
1043 1 dnetc.x86_64 CALL __sysctl(0x7f7fffffd6a0,2,0x7f7fffffd680,0x7f7fffffd698,0,0) 1043 1 dnetc.x86_64 RET __sysctl -1 errno 2 No such file or directory
 1043      1 dnetc.x86_64 CALL  write(2,0x7f7fffffcd10,0x24)
 1043      1 dnetc.x86_64 GIO   fd 2 wrote 36 bytes
      "dnetc: Unable to initialize timers.\n"
 1043      1 dnetc.x86_64 RET   write 36/0x24
 1043      1 dnetc.x86_64 CALL  exit(0xffffffff)


Is there any reasonable way to figure out which sysctl variable is missing?

Well, this was easy!

With each kernel booted, I simply used 'sysctl -ad' to get a listing of all the variables. Then a diff showed me that the only ones missing from the loaded-module was kern.oboottime and net.oroute.stats

Now the real question begs, should the compat module provide either or both of these sysctl()s?


-------------------------------------------------------------------------
| Paul Goyette     | PGP Key fingerprint:     | E-mail addresses:       |
| Customer Service | FA29 0E3B 35AF E8AE 6651 | paul at whooppee.com    |
| Network Engineer | 0786 F758 55DE 53BA 7731 | pgoyette at juniper.net |
| Kernel Developer |                          | pgoyette at netbsd.org  |
-------------------------------------------------------------------------


Home | Main Index | Thread Index | Old Index