KSE/ia64 broken

Marcel Moolenaar marcel at xcllnt.net
Thu Nov 20 02:35:47 PST 2003


On Wed, Nov 19, 2003 at 04:27:51PM -0500, Daniel Eischen wrote:
> On Sun, 16 Nov 2003, Marcel Moolenaar wrote:
> 
> > The memory block is clobbered by a ucontext_t. This may be the result
> > of the kernel doing the upcall (though indirectly I would suspect).
> 
> Any more on this.  I haven't been able to find anything
> on our end.

Another piece of the puzzle. If you apply the attached patch, KSE
works with rev 1.18 of thr_spinlock.c. I have to analyze how this
makes a difference, but my first guess is that the syscall results
in an upcall and a context switch (be it to the same thread). This
sanitizes internal state and prevents corruption. More tomorrow...

-- 
 Marcel Moolenaar	  USPA: A-39004		 marcel at xcllnt.net
-------------- next part --------------
Index: pthread_md.h
===================================================================
RCS file: /home/ncvs/src/lib/libpthread/arch/ia64/include/pthread_md.h,v
retrieving revision 1.11
diff -u -r1.11 pthread_md.h
--- pthread_md.h	19 Sep 2003 23:28:13 -0000	1.11
+++ pthread_md.h	20 Nov 2003 10:07:37 -0000
@@ -35,7 +35,10 @@
 
 #define	KSE_STACKSIZE		16384
 
-#define	THR_GETCONTEXT(ucp)	_ia64_save_context(&(ucp)->uc_mcontext)
+#define	THR_GETCONTEXT(ucp)	do {				\
+		__sys_write(1, "X\n", 2);			\
+		_ia64_save_context(&(ucp)->uc_mcontext);	\
+	} while (0)
 #define	THR_SETCONTEXT(ucp)	PANIC("THR_SETCONTEXT() now in use!\n")
 
 #define	PER_THREAD


More information about the freebsd-threads mailing list