From owner-p4-projects@FreeBSD.ORG Sun Jun 8 18:27:54 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 88FFC37B404; Sun, 8 Jun 2003 18:27:53 -0700 (PDT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2FAAA37B401 for ; Sun, 8 Jun 2003 18:27:53 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 56E1E43FE1 for ; Sun, 8 Jun 2003 18:27:52 -0700 (PDT) (envelope-from marcel@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h591Rq0U021924 for ; Sun, 8 Jun 2003 18:27:52 -0700 (PDT) (envelope-from marcel@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h591Rpgi021921 for perforce@freebsd.org; Sun, 8 Jun 2003 18:27:51 -0700 (PDT) Date: Sun, 8 Jun 2003 18:27:51 -0700 (PDT) Message-Id: <200306090127.h591Rpgi021921@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to marcel@freebsd.org using -f From: Marcel Moolenaar To: Perforce Change Reviews Subject: PERFORCE change 32829 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jun 2003 01:27:54 -0000 http://perforce.freebsd.org/chv.cgi?CH=32829 Change 32829 by marcel@marcel_nfs on 2003/06/08 18:27:02 Avoid the possibility that we're trying to send a signal to the process as the result of a fault in the gateway page. If this happens, the fault happens either in epc_sigtramp() or break_sigtramp() and generally means that the register stack space is exhausted or the backing store pointer is invalid. Either way, the fault got triggered while sending a signal to the process and sending a signal to the process because of that is bound to cause exactly the same: a fault, followed by a signal, followed by a fault followed by nausea. Keep a debug printf() in here so that we'll know if and when this kicks in. Affected files ... .. //depot/projects/ia64/sys/ia64/ia64/machdep.c#77 edit Differences ... ==== //depot/projects/ia64/sys/ia64/ia64/machdep.c#77 (text+ko) ==== @@ -831,11 +831,26 @@ int oonstack; td = curthread; + tf = td->td_frame; + + /* + * Bail out if we're sending a signal due to a fault in the gateway + * page. If that happens, we were trying to send a signal but the + * backing store address was invalid. Trying to send a signal in that + * case will not work. + * Note that the test for region 5 is a bit sloppy, but does not + * give false positives. + */ + if ((tf->tf_special.iip >> 61) == 5) { + printf("XXX: Fault in gateway page. Cannot send signal.\n"); + sigexit(td, SIGSEGV); + return; + } + p = td->td_proc; PROC_LOCK_ASSERT(p, MA_OWNED); psp = p->p_sigacts; mtx_assert(&psp->ps_mtx, MA_OWNED); - tf = td->td_frame; sp = tf->tf_special.sp; oonstack = sigonstack(sp); sbs = 0;