From owner-cvs-src@FreeBSD.ORG Fri Jul 27 20:46:25 2007 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 817CC16A417; Fri, 27 Jul 2007 20:46:25 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from speedfactory.net (mail6.speedfactory.net [66.23.216.219]) by mx1.freebsd.org (Postfix) with ESMTP id CF9FA13C45E; Fri, 27 Jul 2007 20:46:24 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (unverified [66.23.211.162]) by speedfactory.net (SurgeMail 3.7b8) with ESMTP id 199423375 for multiple; Fri, 27 Jul 2007 16:55:17 -0400 Received: from localhost.corp.yahoo.com (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.13.8/8.13.8) with ESMTP id l6RKkIZP041792; Fri, 27 Jul 2007 16:46:20 -0400 (EDT) (envelope-from jhb@freebsd.org) From: John Baldwin To: Don Lewis Date: Fri, 27 Jul 2007 08:19:07 -0400 User-Agent: KMail/1.9.6 References: <200707271042.l6RAgKhZ082086@gw.catspoiler.org> In-Reply-To: <200707271042.l6RAgKhZ082086@gw.catspoiler.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200707270819.08197.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Fri, 27 Jul 2007 16:46:21 -0400 (EDT) X-Virus-Scanned: ClamAV 0.88.3/3784/Fri Jul 27 13:35:18 2007 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.0 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00, DATE_IN_PAST_06_12 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx X-Server: High Performance Mail Server - http://surgemail.com r=1653887525 Cc: cvs-src@freebsd.org, src-committers@freebsd.org, cvs-all@freebsd.org Subject: Re: cvs commit: src/sys/i386/i386 trap.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jul 2007 20:46:25 -0000 On Friday 27 July 2007 06:42:20 am Don Lewis wrote: > On 13 Jun, John Baldwin wrote: > > jhb 2007-06-13 22:37:48 UTC > > > > FreeBSD src repository > > > > Modified files: > > sys/i386/i386 trap.c > > Log: > > Don't clobber tf_err with the eva from a page fault as the page fault > > address is saved in ksi_addr already. > > > > PR: i386/101379 > > Submitted by: Tijl Coosemans : tijl ulyssis org > > > > Revision Changes Path > > 1.306 +0 -3 src/sys/i386/i386/trap.c > > This change appears to have broken the garbage collector in > ports/lang/pm3-base, which means that cvsup no longer works on -CURRENT. > The garbage collector uses the old sigvec() interface, and counts on > getting the fault address from the sc_err field in struct sigcontext, > which is copied from tf_err. > > The Modula-3 source code for the handler and the sigvec() call is in > pm3-1.1.15/libs/m3core/src/runtime/FreeBSD4/RTHeapDep.m3 under the port > work directory. Since Modula-3 compiler uses this code, the compiler is > bootstrapped from a version of this file that has already been > translated to i386 assembly language. The latter lives in > pm3-1.1.15/boot-FreeBSD4/m3core/FreeBSD4/RTHeapDep.ms. > > Modifying the assembly code to convert it to use sigaction() and to pull > the fault address out of the siginfo structure is left as an exercise > for someone more masochistic than me. Assuming wine doesn't use sigvec() this should work. I noticed while looking at this that ddb's backtrace had some special handling that assumes tf_err == faulting address as well. :-/ Index: machdep.c =================================================================== RCS file: /usr/cvs/src/sys/i386/i386/machdep.c,v retrieving revision 1.657 diff -u -r1.657 machdep.c --- machdep.c 6 Jun 2007 07:35:07 -0000 1.657 +++ machdep.c 27 Jul 2007 12:17:22 -0000 @@ -352,7 +352,12 @@ sf.sf_siginfo.si_sc.sc_pc = regs->tf_eip; sf.sf_siginfo.si_sc.sc_ps = regs->tf_eflags; sf.sf_siginfo.si_sc.sc_trapno = regs->tf_trapno; - sf.sf_siginfo.si_sc.sc_err = regs->tf_err; + + /* + * XXX: Some old binaries using sigvec() such as cvsup depend + * on this. + */ + sf.sf_siginfo.si_sc.sc_err = (register_t)ksi->ksi_addr; /* * If we're a vm86 process, we want to save the segment registers. -- John Baldwin