Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 19 Sep 2002 00:18:48 -0700 (PDT)
From:      Julian Elischer <julian@elischer.org>
To:        Daniel Eischen <eischen@pcnet1.pcnet.com>
Cc:        Edwin Culp <eculp@encontacto.net>, current@FreeBSD.ORG
Subject:   Re: slapd dumping core with today's current.
Message-ID:  <Pine.BSF.4.21.0209190012470.10489-100000@InterJet.elischer.org>
In-Reply-To: <Pine.GSO.4.10.10209190240370.3372-100000@pcnet1.pcnet.com>

next in thread | previous in thread | raw e-mail | index | archive | help



On Thu, 19 Sep 2002, Daniel Eischen wrote:

> On Wed, 18 Sep 2002, Julian Elischer wrote:
> 
> > threads is broken right now..
> > due to a miscommunicatin,. the kernel and the threads library have
> > a disagreement regarding something..
> > Unfortunatly the person to slap up over this is offline for  aday or
> > so..
> > please be patient for a day or so (we hope).
> 
> I think it's because libc_r has been disconnected from the
> build:
> 
>   revision 1.143
>   date: 2002/09/17 07:32:36;  author: peter;  state: Exp;  lines: +1 -1
>   Add i386 to the list of architectures that libc_r is broken on.  This
>   effectively removes pppctl from the build for now.  It only compiles on
>   alpha now (now ironic).
> 
> And the i386 mcontext_t is now bigger because we account for the
> newer SSE (?) format FP register sets.  Older libc_r's used ucontext_t's
> that were smaller and manually save and restore FP state into
> areas of ucontext_t which mc_len and mc_fpformat now occupy.

so does that code still exist?

> The kernel uses these to validate a context and returns an
> error if these fields aren't valid.

so, we need to change the kernel too right?

> 
> The fix is to remove the two calls to FP_SAVE_UC and FP_RESTORE_UC
> in libc_r/uthread/uthread_kern.c.  And to also hook libc_r back
> into the build (src/lib/Makefile).

If we remove the calls, is the original code still present?
or did that get removed?

> 
> Libc_r patch included (which my mailer will probably mangle).
> 
> -- 
> Dan Eischen
> 
> Index: pthread_private.h
> ===================================================================
> RCS file: /opt/d/CVS/src/lib/libc_r/uthread/pthread_private.h,v
> retrieving revision 1.73
> diff -u -r1.73 pthread_private.h
> --- pthread_private.h	29 Aug 2002 23:06:06 -0000	1.73
> +++ pthread_private.h	19 Sep 2002 06:53:57 -0000
> @@ -75,16 +75,6 @@
>  #define	SET_STACK_JB(jb, stk)	(jb)[0]._jb[2] = (int)(stk)
>  #define	SET_STACK_SJB(sjb, stk)	(sjb)[0]._sjb[2] = (int)(stk)
>  #define	SET_STACK_UC(ucp, stk)	(ucp)->uc_mcontext.mc_esp = (int)(stk)
> -#define	FP_SAVE_UC(ucp)		do {			\
> -	char	*fdata;					\
> -	fdata = (char *) (ucp)->uc_mcontext.mc_fpregs;	\
> -	__asm__("fnsave %0": :"m"(*fdata));		\
> -} while (0)
> -#define	FP_RESTORE_UC(ucp)	do {			\
> -	char	*fdata;					\
> -	fdata = (char *) (ucp)->uc_mcontext.mc_fpregs;	\
> -	__asm__("frstor %0": :"m"(*fdata));		\
> -} while (0)
>  #define SET_RETURN_ADDR_JB(jb, ra)	(jb)[0]._jb[0] = (int)(ra)
>  #elif	defined(__alpha__)
>  #include <machine/reg.h>
> @@ -94,8 +84,6 @@
>  #define	SET_STACK_JB(jb, stk)	(jb)[0]._jb[R_SP + 4] = (long)(stk)
>  #define	SET_STACK_SJB(sjb, stk)	(sjb)[0]._sjb[R_SP + 4] = (long)(stk)
>  #define	SET_STACK_UC(ucp, stk)	(ucp)->uc_mcontext.mc_regs[R_SP] = (unsigned long)(stk)
> -#define	FP_SAVE_UC(ucp)
> -#define	FP_RESTORE_UC(ucp)
>  #define SET_RETURN_ADDR_JB(jb, ra) do {			\
>  	(jb)[0]._jb[2] = (long)(ra);			\
>  	(jb)[0]._jb[R_RA + 4] = (long)(ra);		\
> Index: uthread_kern.c
> ===================================================================
> RCS file: /opt/d/CVS/src/lib/libc_r/uthread/uthread_kern.c,v
> retrieving revision 1.42
> diff -u -r1.42 uthread_kern.c
> --- uthread_kern.c	29 Aug 2002 00:44:11 -0000	1.42
> +++ uthread_kern.c	19 Sep 2002 06:53:55 -0000
> @@ -113,8 +113,6 @@
>  
>  	/* Check if this function was called from the signal handler: */
>  	if (ucp != NULL) {
> -		/* XXX - Save FP registers? */
> -		FP_SAVE_UC(ucp);
>  		called_from_handler = 1;
>  		DBG_MSG("Entering scheduler due to signal\n");
>  	}
> @@ -156,9 +154,6 @@
>  		if (ucp == NULL)
>  			return;
>  		else {
> -			/* XXX - Restore FP registers? */
> -			FP_RESTORE_UC(ucp);
> -
>  			/*
>  			 * Set the process signal mask in the context; it
>  			 * could have changed by the handler.
> 
> 
> 


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0209190012470.10489-100000>