From owner-freebsd-current Mon Aug 20 8: 7:42 2001 Delivered-To: freebsd-current@freebsd.org Received: from ns5.pacific.net.au (ns5.pacific.net.au [203.143.252.30]) by hub.freebsd.org (Postfix) with ESMTP id AA6EB37B408; Mon, 20 Aug 2001 08:07:36 -0700 (PDT) (envelope-from mckay@thehub.com.au) Received: from dungeon.home (ppp199.dyn248.pacific.net.au [203.143.248.199]) by ns5.pacific.net.au (8.9.0/8.9.1) with ESMTP id BAA25079; Tue, 21 Aug 2001 01:07:33 +1000 (EST) Received: from dungeon.home (localhost [127.0.0.1]) by dungeon.home (8.11.3/8.11.1) with ESMTP id f7KF9RV26692; Tue, 21 Aug 2001 01:09:27 +1000 (EST) (envelope-from mckay) Message-Id: <200108201509.f7KF9RV26692@dungeon.home> To: "Daniel M. Eischen" Cc: mckay@thehub.com.au, current@FreeBSD.org, Peter Wemm Subject: Implications of stdio changes (was Re: cvs commit: src/include stdio.h src/lib/libc Makefilesrc/lib) References: In-Reply-To: from Daniel Eischen at "Tue, 14 Aug 2001 18:06:05 +0000" Date: Tue, 21 Aug 2001 01:09:27 +1000 From: Stephen McKay Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Tuesday, 14th August 2001, Daniel Eischen wrote: >> > So do we allow FILE to be extended only after bumping the library >> > version once (after 5.0-release)? And thereafter all extensions to >> > FILE do not need a version bump? >> >> We've already bumped libc for 5.x. Assuming this works ok, we shouldn't need >> any further bumps for extending FILE. > >True. I guess the real problem is the other libraries that reference >stdin, stdout, stderr. These need to be rebuilt with the new stdio.h >and libc in order to avoid any impact from future FILE changes. I might sound like the harbinger of doom, but you have to bump the major number on every library that uses stdio to solve the "FILE has changed size" problem. It's the same sort of problem that changing errno caused. That was "solved" by the switch to elf, which caused global recompilation. People are hoping to do this by just waiting. Eventually most libraries will experience a major version bump. Similarly, most useful programs will be recompiled (either against bumped libraries, or recompiled old ones). But some programs will not be recompiled, and will fail in mysterious ways. I often use really old binaries, so odds are it will happen to me. :-) To prevent old binaries from going bad, the libraries they link to must use the old version of stdio. Definite ideas of the offset in __sF of stdout and stderr are embeded in both the old programs, and the old libraries (and of course, the old version of stdio). If you recompile the libraries against the new stdio, you break the old binaries. The solution is to not do that. In short, when FILE changes size (and hence __sF offsets change), then every consumer(*) of stdio must be bumped. The recent __stdinp (and friends) addition prevents this problem happening again in the future, but does not solve the current problem of old binaries and old libraries knowing the internals of stdio. Stephen. (*) OK, technically only uses of "stdout" and "stderr" variables screw up when FILE changes size. Uses of macros (like getc variants that are sometimes macros) will screw up if offsets change, but that's easier to avoid. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message