From owner-freebsd-current Thu Jan 11 13:24:13 1996 Return-Path: owner-current Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id NAA21289 for current-outgoing; Thu, 11 Jan 1996 13:24:13 -0800 (PST) Received: from austin.polstra.com (austin.polstra.com [206.213.73.10]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id NAA21263 Thu, 11 Jan 1996 13:24:06 -0800 (PST) Received: from austin.polstra.com (jdp@localhost) by austin.polstra.com (8.6.12/8.6.12) with ESMTP id NAA13258; Thu, 11 Jan 1996 13:23:36 -0800 Message-Id: <199601112123.NAA13258@austin.polstra.com> To: Bruce Evans cc: uh@NU.cs.fsu.edu, freebsd-current@FreeBSD.org, j@uriah.heep.sax.de, nate@FreeBSD.org Subject: Re: make world In-reply-to: Your message of "Thu, 11 Jan 1996 18:51:10 +1100." <199601110751.SAA32761@godzilla.zeta.org.au> Date: Thu, 11 Jan 1996 13:23:35 -0800 From: John Polstra Sender: owner-current@FreeBSD.org Precedence: bulk Bruce wrote: > >I took a quick look at the sources of "install". It looks like, with the > >options above, that install does this: > > > * unlinks the old version of /usr/libexec/ld.so > > * copies the new version into /usr/libexec/ld.so > > * runs /usr/bin/strip (itself dynamically-linked) on /usr/libexec/ld.so > > >Now, looking at the sources to "strip", it seems that it opens its file > >read/write, and modifies it in place. > > This shouldn't matter if ld.so is not run while it is being installed, But since "strip" is dynamically-linked, "ld.so" is _guaranteed_ to be running during the strip. > and the strip step is probably safe at all times since it doesn't > move the text or data blocks. I agree, in principle. But I have personally seen anomalies a couple of times on my system, right after replacing ld.so or a shared library, and they have looked very much like the problem that the original poster reported. I suspect that there are bugs in the VM system that can cause problems if you alter a file that is currently mapped and being executed. > >Here's the safest way I've found to install a new version of ld.so on a > >running system (taken from a shell script that I use): > >... > >I'm going to modify the Makefile for ld.so to do something like this, > >right away. Which I did. A few hours later, phk repaired a problem in it :-(. Well, it took him 2 tries, so I guess I don't feel too bad. > Erm, in -current, just use `install -C'. It does everything (except the > fschg :-() atomically as a side effect of avoiding clobbering the file > metadata if the file data hasn't changed. You're right, that looks like it should work fine. (I even ran a ktrace on it, just to be sure.) What is your advice? Do you think I should go ahead and change the Makefile to use "install -C" now? Would this lead to another hiccup similar to what happened when the new "rpcgen" came along? I _think_ that "install" is rebuilt and installed _before_ "ld.so", when you do a "make world". Is that right? If so, then changing to "install -C" should cause no problems for anybody. -- John Polstra jdp@polstra.com John D. Polstra & Co., Inc. Seattle, Washington USA "Self-knowledge is always bad news." -- John Barth