nvidia OpenGL and lib{thr,kse} related crash

Daniel Eischen eischen at pcnet.com
Wed Jun 11 07:55:48 PDT 2003


On Wed, 11 Jun 2003, Alexander Nedotsukov wrote:

> Alexander Kabaev wrote:
> 
> >On Tue, 10 Jun 2003 10:49:11 -0400 (EDT)
> >Daniel Eischen <eischen at pcnet.com> wrote:
> >
> >  
> >
> >>I think something is hosed on your end...  pthread_key_create()
> >>does not call pthread_main_np (nor vice-versa) in libkse.
> >>glxinfo works fine with both libkse and libthr here.  I don't
> >>have any nvidia hardware.
> >>
> Daniel, I tought it may be not related to specific hardware. Nvidia 
> provides they own libGL.so.1 library wich probably may make use of 
> pthread stuff  in way lib{kse,thr} not expected.
> 
> >>    
> >>
> >Alexander  simply does not have debugging symbols in his libkse library.
> >Otherwise his backtarce would lock differently.
> >
> Ok.  This one with debug symbols in libkse.
> 
> #0  _get_curthread () at /usr/src/lib/libpthread/thread/thr_kern.c:1818
> 1818            return (_ksd_curthread);
> (gdb) where
> #0  _get_curthread () at /usr/src/lib/libpthread/thread/thr_kern.c:1818
> #1  0x2821fba7 in _pthread_key_create (key=0x2813c220,
>     destructor=0x28122c90 <__nvsym15484+240>) at 
> /usr/src/lib/libpthread/thread/thr_spec.c:60
> #2  0x28122b58 in __nvsym15249 () from /usr/X11R6/lib/libGL.so.1
> #3  0x28052b16 in _rtld () from /usr/libexec/ld-elf.so.1
> 
> And this one with 'setenv  __GL_SINGLE_THREADED 1'
> 
> Loaded symbols for /usr/libexec/ld-elf.so.1
> #0  _get_curthread () at /usr/src/lib/libpthread/thread/thr_kern.c:1818
> 1818            return (_ksd_curthread);
> (gdb) where
> #0  _get_curthread () at /usr/src/lib/libpthread/thread/thr_kern.c:1818
> #1  0x282243f7 in _thr_rtld_set_flag (mask=1) at 
> /usr/src/lib/libpthread/thread/thr_rtld.c:87
> #2  0x28055f16 in rlock_acquire () from /usr/libexec/ld-elf.so.1
> #3  0x28052d4a in _rtld_bind () from /usr/libexec/ld-elf.so.1
> #4  0x28052791 in _rtld_bind_start () from /usr/libexec/ld-elf.so.1
> #5  0x28052b16 in _rtld () from /usr/libexec/ld-elf.so.1

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.

-- 
Dan Eischen

Index: thr_spec.c
===================================================================
RCS file: /opt/FreeBSD/cvs/src/lib/libpthread/thread/thr_spec.c,v
retrieving revision 1.19
diff -u -r1.19 thr_spec.c
--- thr_spec.c	18 Apr 2003 05:04:16 -0000	1.19
+++ thr_spec.c	11 Jun 2003 14:52:49 -0000
@@ -57,7 +57,11 @@
 int
 _pthread_key_create(pthread_key_t *key, void (*destructor) (void *))
 {
-	struct pthread *curthread = _get_curthread();
+	struct pthread *curthread;
+
+	if (_thr_initial == NULL)
+		_libpthread_init(NULL);
+	curthread = _get_curthread();
 
 	/* Lock the key table: */
 	THR_LOCK_ACQUIRE(curthread, &_keytable_lock);




More information about the freebsd-threads mailing list