From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:34926) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RKuq1-0004pp-C3 for qemu-devel@nongnu.org; Mon, 31 Oct 2011 12:35:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RKupz-0001Te-Bf for qemu-devel@nongnu.org; Mon, 31 Oct 2011 12:35:53 -0400 Received: from mx1.redhat.com ([209.132.183.28]:14435) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RKupz-0001TR-32 for qemu-devel@nongnu.org; Mon, 31 Oct 2011 12:35:51 -0400 Date: Mon, 31 Oct 2011 16:36:04 +0000 From: "Daniel P. Berrange" Message-ID: <20111031163604.GH27570@redhat.com> References: <4E9D42D4.9070901@suse.de> <0B40C867-80E6-4FE1-A346-CAA807378745@logician.com> <4EADD380.1020100@web.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] Problem under OSX Lion: GThread-ERROR **: GThread system may only be initialized once Reply-To: "Daniel P. Berrange" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Juan Pineda Cc: aliguori@us.ibm.com, qemu-devel@nongnu.org, Andreas =?utf-8?Q?F=C3=A4rber?= On Mon, Oct 31, 2011 at 09:25:26AM -0700, Juan Pineda wrote: > The current Qemu master branch crashes under OSX with a GThread error. > Commenting out vlc.c line 2188 (call to g_thread_init) allows it to run > successfully. As a general rule all calls to 'g_thread_init(NULL)' should be protected by a conditional thus: if (!g_thread_supported()) g_thread_init(NULL); Even though QEMU calls g_thread_init() very early in main(), there is always the possibility that some library QEMU links to, has got an ELF initializer, triggering before main(), which calls g_thread_init(). NB on GLib versions >= 2.24, g_thread_init() is a no-op if called more than once[1], but for sake of compatibility QEMU ought to use the conditonal check. Regards, Daniel [1] The reason for this change is that GObject itself actually calls g_thread_init() secretly too. -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|