From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chris Vine Newsgroups: gmane.lisp.guile.user Subject: Re: libguile thread safety Date: Sat, 4 Jan 2014 09:50:24 +0000 Message-ID: <20140104095024.62df60d0@bother.homenet> References: <20140103233407.36382e5f@bother.homenet> <8738l41p8r.fsf@netris.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1388829039 31170 80.91.229.3 (4 Jan 2014 09:50:39 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 4 Jan 2014 09:50:39 +0000 (UTC) Cc: guile-user@gnu.org To: Mark H Weaver Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Sat Jan 04 10:50:45 2014 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VzNsS-0003XZ-Pq for guile-user@m.gmane.org; Sat, 04 Jan 2014 10:50:44 +0100 Original-Received: from localhost ([::1]:53707 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VzNsS-0008Cz-DA for guile-user@m.gmane.org; Sat, 04 Jan 2014 04:50:44 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58947) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VzNsB-0008Cu-4D for guile-user@gnu.org; Sat, 04 Jan 2014 04:50:32 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VzNs5-0005C2-P8 for guile-user@gnu.org; Sat, 04 Jan 2014 04:50:27 -0500 Original-Received: from smtpout2.wanadoo.co.uk ([80.12.242.42]:55914 helo=smtpout.wanadoo.co.uk) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VzNs5-0005By-IB for guile-user@gnu.org; Sat, 04 Jan 2014 04:50:21 -0500 Original-Received: from bother.homenet ([95.146.112.60]) by mwinf5d26 with ME id 9lqL1n0061JEVaP03lqLJc; Sat, 04 Jan 2014 10:50:20 +0100 Original-Received: from bother.homenet (localhost [127.0.0.1]) by bother.homenet (Postfix) with ESMTP id 5E3EA88504; Sat, 4 Jan 2014 09:50:24 +0000 (GMT) In-Reply-To: <8738l41p8r.fsf@netris.org> X-Mailer: Claws Mail 3.9.2 (GTK+ 2.24.22; i686-pc-linux-gnu) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 80.12.242.42 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:10970 Archived-At: On Fri, 03 Jan 2014 20:59:16 -0500 Mark H Weaver wrote: > Chris Vine writes: > > I am having problems using libguile in a multi-threaded environment, > > which boils down to the following small test case, which fails with > > a segmentation fault with guile-2.0.9: > > I've recently noticed that the module loading process in Guile is not > thread safe. I hope to fix this in the next month or two, but for now > I'd recommend that one thread should initialize Guile and load the > modules that will be needed, before allowing multiple threads to enter > Guile mode. Mark, OK. From my exchanges with Panicz Maciej Godek it appears that none of scm_with_guile(), scm_init_guile() and scm_c_eval_string() initialize in a thread safe way on the first call. That may be connected with the module system, or something else (the test case does not explicitly load any modules). If you land anything which you would like me to test, let me know. Chris