From owner-freebsd-threads@FreeBSD.ORG Wed Jun 11 09:14:44 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 67CC237B401 for ; Wed, 11 Jun 2003 09:14:44 -0700 (PDT) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id B8CBC43F3F for ; Wed, 11 Jun 2003 09:14:43 -0700 (PDT) (envelope-from eischen@pcnet.com) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mail.pcnet.com (8.12.8/8.12.1) with ESMTP id h5BGEgNc014854; Wed, 11 Jun 2003 12:14:42 -0400 (EDT) Date: Wed, 11 Jun 2003 12:14:42 -0400 (EDT) From: Daniel Eischen To: Alexander Nedotsukov In-Reply-To: <3EE7481D.5020600@mail.ru> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: threads@freebsd.org Subject: Re: nvidia OpenGL and lib{thr,kse} related crash X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jun 2003 16:14:44 -0000 On Thu, 12 Jun 2003, Alexander Nedotsukov wrote: > Daniel Eischen wrote: > > >You can try this patch, but I don't really think that's the problem. > >I think %gs is getting clobbered. Apply patch to > >libpthread/thread/thr_spec.c. > > > > > > > Well, here is the result. > > Breakpoint 1, _pthread_key_create (key=0x2813c220, > destructor=0x28122c90 <__nvsym15484+240>) > at /usr/src/lib/libpthread/thread/thr_spec.c:62 > 62 if (_thr_initial == NULL) > (gdb) n > 64 curthread = _get_curthread(); > (gdb) info registers > eax 0x28237108 673411336 > ecx 0x0 0 > edx 0x0 0 > ebx 0x282374a4 673412260 > esp 0xbfbff998 0xbfbff998 > ebp 0xbfbff9b0 0xbfbff9b0 > esi 0x8059000 134582272 > edi 0x425 1061 > eip 0x2821fbb9 0x2821fbb9 > eflags 0x206 518 > cs 0x1f 31 > ss 0x2f 47 > ds 0x2f 47 > es 0x2f 47 > fs 0x2f 47 > gs 0x37 55 Yes, %gs is wrong. For a single CPU system, it should be 0x8f. For a dual CPU system, it could be either 0x8f or 0x97. If you breakpoint on libpthread_init() and look at %gs after it finishes, you can see that it should be set to one of the above values. After that point, the threads library doesn't touch %gs. Something is clobbering %gs. Either the kernel through compat signal syscalls, or the nvidia openGL or drivers (are the drivers kernel drivers, userland, or both?). -- Dan Eischen