Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 4 Jul 2014 10:47:05 -0700
From:      David Wolfskill <david@catwhisker.org>
To:        Hans Petter Selasky <hps@selasky.org>
Cc:        stable@freebsd.org
Subject:   Re: r268244 (stable/9) seems to break "sysctl hw.ncpu"
Message-ID:  <20140704174705.GS6056@albert.catwhisker.org>
In-Reply-To: <53B6E218.5070009@selasky.org>
References:  <20140704123901.GR6056@albert.catwhisker.org> <53B6E218.5070009@selasky.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--hc1Ad1NXUysMDyjB
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Fri, Jul 04, 2014 at 07:19:20PM +0200, Hans Petter Selasky wrote:
> On 07/04/14 14:39, David Wolfskill wrote:
> > After building & installing @r268208 (yesterday), "sysctl hw.ncpu"
> > reports a number (e.g., "2" for my laptop).
> >
> > After building & installing @r268244 (today)...
> >
> > freebeast(9.3-P)[5] sysctl hw.ncpu | hd
> > 00000000  68 77 2e 6e 63 70 75 3a  20 0a                    |hw.ncpu: .|
> > 0000000a
> > freebeast(9.3-P)[6]
> >
> > After reverting r268244, then "cd /usr/src/sbin/sysctl && make && make
> > install":
> >
> > g1-252(9.3-P)[8] sysctl hw.ncpu | hd
> > 00000000  68 77 2e 6e 63 70 75 3a  20 32 0a                 |hw.ncpu:
> > 2.|
> > 0000000b
> > g1-252(9.3-P)[9]
> >
> >
> > I note that I also track stable/10 and head (on different slices;
> > daily) on the machine; haven't seen similar behavior in either
> > environment.
> ...
>=20
> I cannot reproduce this. Using the same kernel and running sysctl from.=
=20
> My patch to 9-stable will not affect printing of integers. 9-stable and=
=20
> 10-stable and current "sysctl" code all gives the same result over here=
=20
> with 9-stable kernel:
>=20
> sysctl -n hw.ncpu | hd
> 00000000  32 0a                                             |2.|
>=20
> sysctl hw.ncpu | hd
> 00000000  68 77 2e 6e 63 70 75 3a  20 32 0a                 |hw.ncpu: 2.|
>=20
> Can you tell me exactly what kernel version you are using, "uname -a"=20
> and which version of "sysctl" with which version of the kernel is=20
> failing, so that I can reproduce.
>=20
> Thank you!
> ...

/usr/src is:

g1-252(9.3-P)[1] svn info /usr/src/
Path: /usr/src
Working Copy Root Path: /usr/src
URL: file:///svn/freebsd/src/base/stable/9
Relative URL: ^/stable/9
Repository Root: file:///svn/freebsd/src/base
Repository UUID: ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Revision: 268249
Node Kind: directory
Schedule: normal
Last Changed Author: hselasky
Last Changed Rev: 268244
Last Changed Date: 2014-07-03 23:05:39 -0700 (Thu, 03 Jul 2014)

g1-252(9.3-P)[2] uname -a
FreeBSD g1-252.catwhisker.org 9.3-PRERELEASE FreeBSD 9.3-PRERELEASE #46  r2=
68244M/268249:903500: Fri Jul  4 04:52:48 PDT 2014     root@g1-252.catwhisk=
er.org:/usr/obj/usr/src/sys/CANARY  i386
g1-252(9.3-P)[3]=20


I was able to see the behavior without changing the kernel -- and
indeed, I was able to run the stable/10 version of /sbin/sysctl
under stable/9 without problems:

g1-252(9.3-P)[3] which sysctl
/sbin/sysctl
g1-252(9.3-P)[4] ls -lT `!!`
ls -lT `which sysctl`
-r-xr-xr-x  1 root  wheel  14500 Jul  4 10:35:55 2014 /sbin/sysctl
g1-252(9.3-P)[5] !$ hw.ncpu | hd
`which sysctl` hw.ncpu | hd
00000000  68 77 2e 6e 63 70 75 3a  20 0a                    |hw.ncpu: .|
0000000a
g1-252(9.3-P)[6] `which sysctl.OK` hw.ncpu | hd
00000000  68 77 2e 6e 63 70 75 3a  20 32 0a                 |hw.ncpu: 2.|
0000000b
g1-252(9.3-P)[7] /S3/sbin/sysctl hw.ncpu | hd
00000000  68 77 2e 6e 63 70 75 3a  20 32 0a                 |hw.ncpu: 2.|
0000000b
g1-252(9.3-P)[8] file /S3/sbin/sysctl
/S3/sbin/sysctl: ELF 32-bit LSB executable, Intel 80386, version 1 (FreeBSD=
), dynamically linked (uses shared libs), for FreeBSD 10.0 (1000709), strip=
ped
g1-252(9.3-P)[9] file /sbin/sysctl
/sbin/sysctl: ELF 32-bit LSB executable, Intel 80386, version 1 (FreeBSD), =
dynamically linked (uses shared libs), for FreeBSD 9.2 (902512), stripped
g1-252(9.3-P)[10]=20

(Note that my stable/10 is from sources:
g1-252(9.3-P)[10] svn info /S3/usr/src/
Path: /S3/usr/src
Working Copy Root Path: /S3/usr/src
URL: file:///svn/freebsd/src/base/stable/10
Relative URL: ^/stable/10
Repository Root: file:///svn/freebsd/src/base
Repository UUID: ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Revision: 268249
Node Kind: directory
Schedule: normal
Last Changed Author: hselasky
Last Changed Rev: 268243
Last Changed Date: 2014-07-03 23:03:54 -0700 (Thu, 03 Jul 2014)

g1-252(9.3-P)[11]=20

FreeBSD g1-252.catwhisker.org 10.0-STABLE FreeBSD 10.0-STABLE #1267  r26820=
6M/268208:1000710: Thu Jul  3 05:27:08 PDT 2014     root@g1-252.catwhisker.=
org:/common/S3/obj/usr/src/sys/CANARY  i386

in case that's useful.)

I tried restoring r268244, rebuilding sysctl with debugging & running
it under gdb to see what was going on, but I'm a couple decades out
of practice -- seems that some of the variables I wanted to print
had been optimized to registers or some such thing.

I'm sympathetic to the notion that the change *shouldn't* have this
effect... but I have empiricist tendencies. :-}

I'll be happy to experiment as time permits.  (Holiday over here,
so that means I work on house-maintenance.)

Peace,
david
--=20
David H. Wolfskill				david@catwhisker.org
Taliban: Evil cowards with guns afraid of truth from a 14-year old girl.

See http://www.catwhisker.org/~david/publickey.gpg for my public key.

--hc1Ad1NXUysMDyjB
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQJ8BAEBCgBmBQJTtuiXXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w
ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQ4RThEMDY4QTIxMjc1MDZFRDIzODYzRTc4
QTY3RjlDOERFRjQxOTNCAAoJEIpn+cje9Bk7zOYQAIsuXoOOlMqr34C/UPFQXrYY
vuinZwpAsWW1CQaCiMtMnPbTlBnfMBlaczBfxfozBcMMhPOsPz98XGJ4H1jYfc/z
f/ZbuRxtEI0VnmK5YR6Ge46Ec9JH77Av8ed4v/nFB7BF9Bio1Do2eJAarO5C+koF
BeOHNjPH8HLGufj/7KF0cXLIxzONArf7VZdRUqsrCUxVDwBenq7XQpvZ/TwigUfi
TrhmlV42WRmEYSIcC3yqxQa8lyqdaWc1DYTb5Gfe3WaXP+dyokNPWpT2tDf+mF1a
Kzn/JpxTHgjLPiKJwGKKGNTWYjl60skuHgyzwq4cUhE2J5VUaTXYmSzgFkkXSPxE
nou6uwzyG5fYIwABQE5Zf8jokC+aAmoiLf/EYwqtJEhQxubpYDD+11NvIjE5G0qM
WUCrV6e7mz3R3Lg7a+G4S4qxRNbXFYANDiHDwuckBJabnPsSsO7oWzAi2CGMnf/T
7UANQRhv2pYYf5Z90CFgHWgBWD872Ozazzl7GLYSzjlyRihHav3rJi5BxPAcqEoe
slqySynHf0ubIa4GfPNc/+6lfrHDGClCMYqlmJByOOLFz0srYx7vlkzKjeqHpgdE
lNsD9t76cxfLNYtSbX4btfkSl/yhTUbuH8dRIr8+PnlXWZHnZvPvkboH+8p/CD/k
ByJVKZuk60WbKeLDbyfl
=Sr4P
-----END PGP SIGNATURE-----

--hc1Ad1NXUysMDyjB--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20140704174705.GS6056>