From owner-freebsd-current Tue Nov 26 13:39:51 2002 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5D6D537B401 for ; Tue, 26 Nov 2002 13:39:49 -0800 (PST) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id C7A7C43EBE for ; Tue, 26 Nov 2002 13:39:48 -0800 (PST) (envelope-from eischen@pcnet1.pcnet.com) Received: from localhost (eischen@localhost) by mail.pcnet.com (8.12.3/8.12.1) with ESMTP id gAQLdg9w017077; Tue, 26 Nov 2002 16:39:42 -0500 (EST) Date: Tue, 26 Nov 2002 16:39:42 -0500 (EST) From: Daniel Eischen To: Marc Recht Cc: Daniel Eischen , freebsd-current@FreeBSD.ORG Subject: Re: PATCH - changing libc_r to use *context() In-Reply-To: <16330000.1038336929@leeloo.intern.geht.de> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Tue, 26 Nov 2002, Marc Recht wrote: > > I'd like some feedback on whether some heavy threaded apps (GNOME, > > OpenOffice, Java, etc) have any problems with this patch before > > asking re@ for commit permission. BTW, it also needs testing on > > alpha. > I tried it on i386 (athon-xp) and every app I've tried stalled/locked or > crashed right away. Mozilla gives me: > The program '' received an X Window System error. > This probably reflects a bug in the program. > The error was 'BadValue (integer parameter out of range for operation)'. > (Details: serial 4773 error_code 2 request_code 53 minor_code 0) > (Note to programmers: normally, X errors are reported asynchronously; > that is, you will receive the error a while after causing it. > To debug your program, run it with the --sync command line > option to change this behavior. You can then get a meaningful > backtrace from your debugger if you break on the gdk_x_error() function.) Damn, I think I found a problem. Perhaps it might be what's causing your problem. Do you have I686_CPU defined in your kernel? If so can you either try it with a kernel without I686_CPU or with CPU_DISABLE_SSE? The kernel doesn't align the FPU registers (context) properly. Actually, neither does anything in userland because the machine contexts lack align directives. You can also try modifying the patched uthread_kern.c, function _thread_kern_sched(). There's a section about halfway down that looks something like this: /* * Return to the interrupted context. We are careful * not to use the context saved in the thread because * we may have been interrupted by another signal which * would have destroyed it. This context is saved by * the kernel on the thread's stack so it is safe from * nested signals. */ ucp->uc_sigmask = _process_sigmask; THR_SETCONTEXT(ucp); PANIC("Resume from setcontext in _thread_kern_sched"); } else { do { Change the THR_SETCONTEXT(ucp) to sigreturn(ucp). -- Dan Eischen To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message