From owner-freebsd-stable Sat Oct 5 11:23:17 2002 Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6D91137B401 for ; Sat, 5 Oct 2002 11:23:16 -0700 (PDT) Received: from poincare.matf.bg.ac.yu (poincare.matf.bg.ac.yu [147.91.66.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9891A43E7B for ; Sat, 5 Oct 2002 11:23:13 -0700 (PDT) (envelope-from a.samardzic@matf.bg.ac.yu) Received: from pera.home (modem2.matf.bg.ac.yu [147.91.66.36]) by poincare.matf.bg.ac.yu (8.12.2/8.12.2) with ESMTP id g95INpjJ005429 for ; Sat, 5 Oct 2002 20:23:52 +0200 Received: from pera.home (localhost.home [127.0.0.1]) by pera.home (8.12.3/8.12.3) with ESMTP id g95IN4jr000691 for ; Sat, 5 Oct 2002 20:23:04 +0200 (CEST) (envelope-from aco@pera.home) Received: (from aco@localhost) by pera.home (8.12.3/8.12.3/Submit) id g95IN2dR000690 for freebsd-stable@FreeBSD.ORG; Sat, 5 Oct 2002 20:23:02 +0200 (CEST) Date: Sat, 5 Oct 2002 20:23:01 +0200 From: "Aleksandar B. Samardzic" To: freebsd-stable@FreeBSD.ORG Subject: XFree86 and threads Message-ID: <20021005202301.A672@pera.home> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i X-Operating-System: FreeBSD 4.6-RELEASE X-PGP-Key: http://www.matf.bg.ac.yu/~a.samardzic/public_key.ascii X-PGP-Fingerprint: A343 7990 DF74 1314 6CCD B46D 5189 4598 C5AD CA36 Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG I learned hard way (digging through XFree86 sources) that in order to have OpenGL programs properly rendered on FreeBSD 4.6-RELEASE I have to link with reentrant version of standard C library (libc_r). Eventually, problem was located in __glXGetCurrentContext() function in xc/xc/lib/GL/glx directory of XFree86 source distribution. Right there, xthread_key_create() function, that is in turn actually pthread_key_create(), doesn't properly create thread key that should be used to store rendering context with thread. When trying to get rendering context using this key later in code, no valid context is retrieved and GLX requests are not propagated to server. Strange is that pthread_key_create() returns 0, i.e. success indicator. Now, got two questions: 1. Is anywhere in documentation mentioned that OpenGL programs (actually, all X11 programs) have to be linked with libc_r (I wasn't able to found something alike)? 2. Is above pthread_key_create() behavior a bug? Thanks. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message