From owner-freebsd-ports@FreeBSD.ORG Sat Jul 10 20:41:06 2010 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0C197106566B for ; Sat, 10 Jul 2010 20:41:06 +0000 (UTC) (envelope-from rhurlin@gwdg.de) Received: from amailer.gwdg.de (amailer.gwdg.de [134.76.10.18]) by mx1.freebsd.org (Postfix) with ESMTP id 849658FC15 for ; Sat, 10 Jul 2010 20:41:05 +0000 (UTC) Received: from p578b68b8.dip0.t-ipconnect.de ([87.139.104.184] helo=krabat.raven.hur) by mailer.gwdg.de with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.69) (envelope-from ) id 1OXgr8-0005cg-NL; Sat, 10 Jul 2010 22:41:03 +0200 Message-ID: <4C38DAD8.6040608@gwdg.de> Date: Sat, 10 Jul 2010 22:40:56 +0200 From: Rainer Hurling User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; de-DE; rv:1.9.1.10) Gecko/20100626 Thunderbird/3.0.5 MIME-Version: 1.0 To: Henry Hu References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Authenticated: Id:rhurlin X-Spam-Level: - Cc: freebsd-ports@freebsd.org Subject: Re: stellarium crashes on 9.0-CURRENT X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Jul 2010 20:41:06 -0000 On 10.07.2010 22:19 (UTC+1), Henry Hu wrote: > Hello, Hello Henry, > I'm using FreeBSD 8.0-STABLE, and I'm suffering from the problem. > After days of debugging, I still cannot make out the problem. > However, there is a solution to me: run with __GL_SINGLE_THREADED=1 > e.g. run: > env __GL_SINGLE_THREADED=1 stellarium > It was segfaulting before, and now it works! thank you for your answer. I can confirm that stellarium with this variable set works on 9.0-CURRENT too. > My stacktrace: > [Switching to LWP 100190] > 0x29f44260 in pthread_mutexattr_setkind_np () from /lib/libthr.so.3 > (gdb) where > #0 0x29f44260 in pthread_mutexattr_setkind_np () from /lib/libthr.so.3 > #1 0x299d0ba3 in glXChooseVisual () from /usr/local/lib/libGL.so.1 > #2 0x00000002 in ?? () > #3 0x00000000 in ?? () > #4 0x29e284fd in atoi () from /lib/libc.so.7 > #5 0x00000000 in ?? () > #6 0x28615d70 in ?? () > #7 0x2ac1a890 in ?? () from /usr/local/lib/libGLcore.so.1 > #8 0x00000003 in ?? () > #9 0xbfbfe4a8 in ?? () > #10 0xbfbfdf18 in ?? () > #11 0x2adcf2c5 in _nv012glcore () from /usr/local/lib/libGLcore.so.1 > #12 0x28615d70 in ?? () > #13 0xbfbfe4a8 in ?? () > #14 0xbfbfdf18 in ?? () > #15 0x299b76db in glXChooseVisual () from /usr/local/lib/libGL.so.1 > #16 0x29a055dc in ?? () from /usr/local/lib/libGL.so.1 > (gdb) > > Generally, it seems like that the program crashed before main. > > According to where I found the environment variable(in NVIDIA > Accelerated Linux Driver Set README and Installation Guide): > [quote] > > Q. OpenGL applications crash and print out the following warning: > > > WARNING: Your system is running with a buggy dynamic loader. > This may cause crashes in certain applications. If you > experience crashes you can try setting the environment > variable __GL_SINGLE_THREADED to 1. For more information > please consult the FREQUENTLY ASKED QUESTIONS section in > the file /usr/share/doc/NVIDIA_GLX-1.0/README.txt. > > > > A. The dynamic loader on your system has a bug which will cause applications > > linked with pthreads, and that dlopen() libGL multiple times, to crash. > This bug is present in older versions of the dynamic loader. Distributions > that shipped with this loader include but are not limited to Red Hat Linux > 6.2 and Mandrake Linux 7.1. Version 2.2 and later of the dynamic loader are > known to work properly. If the crashing application is single threaded then > setting the environment variable '__GL_SINGLE_THREADED' to "1" will prevent > the crash. In the bash shell you would enter: > > % export __GL_SINGLE_THREADED=1 > > and in csh and derivatives use: > > % setenv __GL_SINGLE_THREADED 1 > > Previous releases of the NVIDIA Accelerated Linux Driver Set attempted to > work around this problem. Unfortunately the workaround caused problems with > other applications and was removed after version 1.0-1541. > > [/quote] > I found that stellarium is linked with pthreads, and according to my debugging, > this problem may be related to dlopen. > However, I tried to write a program which uses pthread and dlopens > libGL multiple times, > but it did not crash. > Is this a problem related to our dynamic loader? Or is this a problem > of the nvidia drivers? Sorry, but I have no knowledge about the actual loader (did it change in the last month?). > I remember that once stellarium was running successfully with nvidia's > driver. So something must > have changed. Yes, I was running previous versions (before 10.0.2) of stellarium with nvidia-driver. Your workaround helps so far, but of course it would be nice to have a general solution. As I mentioned in my initial mail, other OpenGL programs like astro/celestia etc. work like a charm. Many thanks again, Rainer