From owner-freebsd-current@FreeBSD.ORG Fri Jun 22 15:22:41 2012 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8020B106566C for ; Fri, 22 Jun 2012 15:22:41 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 029F48FC14 for ; Fri, 22 Jun 2012 15:22:40 +0000 (UTC) Received: from skuns.kiev.zoral.com.ua (localhost [127.0.0.1]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id q5MFMGRD005476; Fri, 22 Jun 2012 18:22:16 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5) with ESMTP id q5MFMG2K043376; Fri, 22 Jun 2012 18:22:16 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5/Submit) id q5MFMG22043375; Fri, 22 Jun 2012 18:22:16 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 22 Jun 2012 18:22:16 +0300 From: Konstantin Belousov To: David Wolfskill , current@freebsd.org Message-ID: <20120622152216.GG2337@deviant.kiev.zoral.com.ua> References: <20120622134959.GT1874@albert.catwhisker.org> <20120622141020.GF2337@deviant.kiev.zoral.com.ua> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="xNzB6LhEaj9ZrCy/" Content-Disposition: inline In-Reply-To: <20120622141020.GF2337@deviant.kiev.zoral.com.ua> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.0 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: Subject: Re: SIGSEGV in lots of processes (head i386 @r237440) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jun 2012 15:22:41 -0000 --xNzB6LhEaj9ZrCy/ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jun 22, 2012 at 05:10:20PM +0300, Konstantin Belousov wrote: > On Fri, Jun 22, 2012 at 06:49:59AM -0700, David Wolfskill wrote: > > Just updated my laptop's head slice from r237378 to r237440; while > > it did manage to get to multi-user mode, I was only able to login as > > root, and whenever I tried to do much of anything, the sell (csh) exited > > with a SIGSEGV. > >=20 > > I finally gave it a "3-fingered salute", [Ctl-Alt-Del], and init > > appeared to enter a non-terminating SIGSEGV loop. > >=20 > > My build machine is still building the kernel; assuming(!) I see similar > > behavior on that, I should be able to poke around a bit, as I have a > > serial console on it (though I'll be remote from it, as I'll be at > > work). > >=20 > > Anyway, I thought I'd mention this in case it might help someone. > >=20 > > The typescript from the "svn update" and the resulting build may be > > found at . > This is on i386, right ? >=20 > Can you boot single-user and just type date in the shell ? > Does it segfault ? >=20 > If yes, does setting sysctl kern.timecounter.fast_gettime to 0 fix > segfault from date(1) ? Ok, I probably can guess the cause. I suppose that 'date' does not segfaults. Please try the following (which I forgot to commit). Sorry. diff --git a/sys/i386/i386/machdep.c b/sys/i386/i386/machdep.c index f0546b0..30efecd 100644 --- a/sys/i386/i386/machdep.c +++ b/sys/i386/i386/machdep.c @@ -469,7 +469,8 @@ osendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask) } =20 regs->tf_esp =3D (int)fp; - regs->tf_eip =3D PS_STRINGS - szosigcode; + regs->tf_eip =3D p->p_sysent->sv_sigcode_base + szsigcode - + szosigcode; regs->tf_eflags &=3D ~(PSL_T | PSL_D); regs->tf_cs =3D _ucodesel; regs->tf_ds =3D _udatasel; @@ -596,7 +597,8 @@ freebsd4_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset= _t *mask) } =20 regs->tf_esp =3D (int)sfp; - regs->tf_eip =3D PS_STRINGS - szfreebsd4_sigcode; + regs->tf_eip =3D p->p_sysent->sv_sigcode_base + szsigcode - + szfreebsd4_sigcode; regs->tf_eflags &=3D ~(PSL_T | PSL_D); regs->tf_cs =3D _ucodesel; regs->tf_ds =3D _udatasel; @@ -747,7 +749,7 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask) } =20 regs->tf_esp =3D (int)sfp; - regs->tf_eip =3D PS_STRINGS - *(p->p_sysent->sv_szsigcode); + regs->tf_eip =3D p->p_sysent->sv_sigcode_base; regs->tf_eflags &=3D ~(PSL_T | PSL_D); regs->tf_cs =3D _ucodesel; regs->tf_ds =3D _udatasel; --xNzB6LhEaj9ZrCy/ Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAk/kjagACgkQC3+MBN1Mb4iPoACgs79U06M46XxkJkL3zHusChqA nkMAnRI1K/MX7mZK1t6ICamO43jWdeU1 =MZA6 -----END PGP SIGNATURE----- --xNzB6LhEaj9ZrCy/--