From owner-freebsd-alpha Mon Jan 21 12:22:20 2002 Delivered-To: freebsd-alpha@freebsd.org Received: from duke.cs.duke.edu (duke.cs.duke.edu [152.3.140.1]) by hub.freebsd.org (Postfix) with ESMTP id 9640337B445 for ; Mon, 21 Jan 2002 12:21:29 -0800 (PST) Received: from grasshopper.cs.duke.edu (grasshopper.cs.duke.edu [152.3.145.30]) by duke.cs.duke.edu (8.9.3/8.9.3) with ESMTP id PAA17284; Mon, 21 Jan 2002 15:21:29 -0500 (EST) Received: (from gallatin@localhost) by grasshopper.cs.duke.edu (8.11.6/8.9.1) id g0LKKxF35404; Mon, 21 Jan 2002 15:20:59 -0500 (EST) (envelope-from gallatin@cs.duke.edu) From: Andrew Gallatin MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15436.30762.981497.880698@grasshopper.cs.duke.edu> Date: Mon, 21 Jan 2002 15:20:58 -0500 (EST) To: Bernd Walter Cc: freebsd-alpha@FreeBSD.ORG Subject: Re: 4.5-RC panic In-Reply-To: <20020121172920.U58301@cicely8.cicely.de> References: <20020121035556.D58301@cicely8.cicely.de> <15436.8686.765933.505738@grasshopper.cs.duke.edu> <20020121172920.U58301@cicely8.cicely.de> X-Mailer: VM 6.75 under 21.1 (patch 12) "Channel Islands" XEmacs Lucid Sender: owner-freebsd-alpha@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org I finally upgraded my crashbox to 4.5RC & I was able to duplicate the problem here. I think I've fixed it with the following patch -- I like it better than the first one because it is less complex & should be faster in the common case. I've also tested it w/an old copy of tcsh that calls the old sigreturn, so I don't think I've messed up signals. Comments? Cheers, Drew Index: machdep.c =================================================================== RCS file: /home/ncvs/src/sys/alpha/alpha/machdep.c,v retrieving revision 1.68.2.15 diff -u -r1.68.2.15 machdep.c --- machdep.c 13 Dec 2001 19:18:00 -0000 1.68.2.15 +++ machdep.c 21 Jan 2002 20:10:19 -0000 @@ -1570,9 +1570,6 @@ struct pcb *pcb; unsigned long val; - if (((struct osigcontext*)uap->sigcntxp)->sc_regs[R_ZERO] == 0xACEDBADE) - return osigreturn(p, (struct osigreturn_args *)uap); - ucp = uap->sigcntxp; pcb = &p->p_addr->u_pcb; @@ -1583,9 +1580,19 @@ /* * Fetch the entire context structure at once for speed. + * Note that struct osigcontext is smaller than a ucontext_t, + * so even if copyin() faults, we may have actually gotten a complete + * struct osigcontext. */ - if (copyin((caddr_t)ucp, (caddr_t)&uc, sizeof(ucontext_t))) - return (EFAULT); + if (copyin((caddr_t)ucp, (caddr_t)&uc, sizeof(ucontext_t))) { + if (((struct osigcontext*)&uc)->sc_regs[R_ZERO] == 0xACEDBADE) + return osigreturn(p, (struct osigreturn_args *)uap); + else + return (EFAULT); + } + + if (((struct osigcontext*)&uc)->sc_regs[R_ZERO] == 0xACEDBADE) + return osigreturn(p, (struct osigreturn_args *)uap); /* * Restore the user-supplied information To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-alpha" in the body of the message