Re: SIGSEGV in lots of processes (head i386 _at_r237440)

From: Konstantin Belousov <kostikbel_at_gmail.com>
Date: Fri, 22 Jun 2012 18:22:16 +0300
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.
> > 
> > I finally gave it a "3-fingered salute", [Ctl-Alt-Del], and init
> > appeared to enter a non-terminating SIGSEGV loop.
> > 
> > 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).
> > 
> > Anyway, I thought I'd mention this in case it might help someone.
> > 
> > The typescript from the "svn update" and the resulting build may be
> > found at <http://www/~david/FreeBSD/head_r237440.txt>.
> This is on i386, right ?
> 
> Can you boot single-user and just type date in the shell ?
> Does it segfault ?
> 
> 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
_at__at_ -469,7 +469,8 _at__at_ osendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
 	}
 
 	regs->tf_esp = (int)fp;
-	regs->tf_eip = PS_STRINGS - szosigcode;
+	regs->tf_eip = p->p_sysent->sv_sigcode_base + szsigcode -
+	    szosigcode;
 	regs->tf_eflags &= ~(PSL_T | PSL_D);
 	regs->tf_cs = _ucodesel;
 	regs->tf_ds = _udatasel;
_at__at_ -596,7 +597,8 _at__at_ freebsd4_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
 	}
 
 	regs->tf_esp = (int)sfp;
-	regs->tf_eip = PS_STRINGS - szfreebsd4_sigcode;
+	regs->tf_eip = p->p_sysent->sv_sigcode_base + szsigcode -
+	    szfreebsd4_sigcode;
 	regs->tf_eflags &= ~(PSL_T | PSL_D);
 	regs->tf_cs = _ucodesel;
 	regs->tf_ds = _udatasel;
_at__at_ -747,7 +749,7 _at__at_ sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
 	}
 
 	regs->tf_esp = (int)sfp;
-	regs->tf_eip = PS_STRINGS - *(p->p_sysent->sv_szsigcode);
+	regs->tf_eip = p->p_sysent->sv_sigcode_base;
 	regs->tf_eflags &= ~(PSL_T | PSL_D);
 	regs->tf_cs = _ucodesel;
 	regs->tf_ds = _udatasel;

Received on Fri Jun 22 2012 - 13:22:41 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:28 UTC