From owner-freebsd-current Sun Jan 26 11:25:54 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id LAA19871 for current-outgoing; Sun, 26 Jan 1997 11:25:54 -0800 (PST) Received: from meter.eng.uci.edu (root@meter.eng.uci.edu [128.200.85.3]) by freefall.freebsd.org (8.8.5/8.8.5) with ESMTP id LAA19864 for ; Sun, 26 Jan 1997 11:25:51 -0800 (PST) Received: from newport.ece.uci.edu by meter.eng.uci.edu (8.8.5) id LAA11422; Sun, 26 Jan 1997 11:25:49 -0800 (PST) Received: from localhost by newport.ece.uci.edu (8.8.5) id LAA06985; Sun, 26 Jan 1997 11:25:47 -0800 (PST) Message-Id: <199701261925.LAA06985@newport.ece.uci.edu> To: dg@root.com cc: current@freebsd.org Subject: Re: exec bug In-reply-to: Your message of "Sun, 26 Jan 1997 04:01:01 PST." <199701261201.EAA06656@root.com> Date: Sun, 26 Jan 1997 11:25:46 -0800 From: Steven Wallace Sender: owner-current@freebsd.org X-Loop: FreeBSD.org Precedence: bulk > The only solution I can think of at the moment to this problem would be to >change the code to do a read of the file header into a malloced buffer. The >overhead for this would be very (unacceptably) high, however. What do you think of my alternate solution: When the first page of a program is mapped, it should be possible to determine if this page exists already in physical memory. If it does, no problemo! On the other hand, if it does not, immediately bring this page into memory by reading from disk. If this read fails, then return an error condition. Otherwise, we now know the page is resident in memory and there will be no problems when the header is checked. The idea here is we do not need to wait for a page fault in exec_aout_imgact() a few lines of code away. We know it will happen very soon so proceed almost as if a fault had occurred by bringing the page into memory. That way if it fails, we know where we are at so we can gracefully discontinue exec rather than a panic. Steven Steven