Date: Sun, 15 Aug 2004 14:58:38 +0100 From: Doug Rabson <dfr@nlsystems.com> To: Daniel Eischen <deischen@freebsd.org> Cc: freebsd-current@freebsd.org Subject: Re: New nvidia drivers available Message-ID: <200408151458.38437.dfr@nlsystems.com> In-Reply-To: <Pine.GSO.4.43.0408150945430.15123-100000@sea.ntplx.net> References: <Pine.GSO.4.43.0408150945430.15123-100000@sea.ntplx.net>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sunday 15 August 2004 14:47, Daniel Eischen wrote: > On Sun, 15 Aug 2004, Doug Rabson wrote: > > > Same error message here when starting neverball. If I map > > > libpthread->libc_r it's working again. > > > > > > xawtv also stopped working. Fortunately setting -xvport manually > > > did fix that. > > > > This might be because libGL calls libpthread's version of open() > > before libpthread has initialised properly. This patch might fix it > > - it fixes neverball's map compiler for me but I haven't actually > > run neverball itself. > > > > Index: thr_open.c > > =================================================================== > > RCS file: /home/ncvs/src/lib/libpthread/thread/thr_open.c,v > > retrieving revision 1.16 > > diff -u -r1.16 thr_open.c > > --- thr_open.c 9 Dec 2003 02:20:56 -0000 1.16 > > +++ thr_open.c 15 Aug 2004 09:19:42 -0000 > > @@ -45,11 +45,15 @@ > > int > > __open(const char *path, int flags,...) > > { > > - struct pthread *curthread = _get_curthread(); > > + struct pthread *curthread; > > int ret; > > int mode = 0; > > va_list ap; > > > > + if (_thr_initial == NULL) > > + _libpthread_init(NULL); > > + > > + curthread = _get_curthread(); > > I thought the C++ style constructor in thr_autoinit.c is supposed > to take care of things like this? The problem is that there is no particular ordering for constructors. In the case with neverball, the C++ constructor in libGL which initialises OpenGL ran first and quite reasonably tried to call open(2). This was intercepted by libpthread, which hadn't yet had its constructor called.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200408151458.38437.dfr>