From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: rixed@happyleptic.org Newsgroups: gmane.lisp.guile.user,gmane.lisp.guile.bugs Subject: Re: Problem compiling related to block-growth-factor fluid Date: Mon, 21 Nov 2011 14:35:06 +0100 Message-ID: <20111121133506.GA31636@ccellier.rd.securactive.lan> References: <20111121092607.GA26768@ccellier.rd.securactive.lan> <20111121104333.GA17397@ccellier.rd.securactive.lan> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="uAKRQypu60I7Lcqm" X-Trace: dough.gmane.org 1321882535 28925 80.91.229.12 (21 Nov 2011 13:35:35 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 21 Nov 2011 13:35:35 +0000 (UTC) Cc: bug-guile@gnu.org To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Mon Nov 21 14:35:28 2011 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RSU1v-0000oO-LA for guile-user@m.gmane.org; Mon, 21 Nov 2011 14:35:27 +0100 Original-Received: from localhost ([::1]:45185 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RSU1v-0007vL-7W for guile-user@m.gmane.org; Mon, 21 Nov 2011 08:35:27 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:45990) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RSU1m-0007v0-Np for guile-user@gnu.org; Mon, 21 Nov 2011 08:35:24 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RSU1h-00089s-4l for guile-user@gnu.org; Mon, 21 Nov 2011 08:35:18 -0500 Original-Received: from eneide.happyleptic.org ([213.251.171.101]:34413) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RSU1g-00089l-UG; Mon, 21 Nov 2011 08:35:13 -0500 Original-Received: from extranet.securactive.org ([82.234.213.170] helo=ccellier.rd.securactive.lan) by eneide.happyleptic.org with esmtp (Exim 4.72) (envelope-from ) id 1RSU8Z-0003Wy-P9; Mon, 21 Nov 2011 14:42:19 +0100 Original-Received: from rixed by ccellier.rd.securactive.lan with local (Exim 4.72) (envelope-from ) id 1RSU1a-0008Fm-JF; Mon, 21 Nov 2011 14:35:06 +0100 Mail-Followup-To: rixed@happyleptic.org, guile-user@gnu.org, bug-guile@gnu.org Content-Disposition: inline In-Reply-To: <20111121104333.GA17397@ccellier.rd.securactive.lan> User-Agent: Mutt/1.5.20 (2009-06-14) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 213.251.171.101 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:8966 gmane.lisp.guile.bugs:5931 Archived-At: --uAKRQypu60I7Lcqm Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Here is a minimal example reproducing the problem. Note that it only fails the first time (when scheme.scm is compiled). Note: I put bug-guile on CC, hoping it will not trash the attachments, because with this example I'm starting to believe there is something wrong going on. --uAKRQypu60I7Lcqm Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=Makefile CFLAGS += $(shell guile-config compile) -std=c99 LDLIBS += $(shell guile-config link) -lpthread all: main clean: rm -f *.o main --uAKRQypu60I7Lcqm Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="scheme.scm" (define-module (test)) (use-modules (system base compile)) (define prog '(lambda (a b c) (+ a b c))) (define (f) (compile prog) (display "done\n")) --uAKRQypu60I7Lcqm Content-Type: text/x-csrc; charset=us-ascii Content-Disposition: attachment; filename="main.c" #include #include #include static void *eval_string(void *str) { SCM module = scm_c_resolve_module("guile-user"); (void)scm_c_eval_string_in_module(str, module); return NULL; } static void *do_call_f(void *name) { SCM module = scm_c_resolve_module("test"); SCM proc_var = scm_c_module_lookup(module, name); SCM proc = scm_variable_ref(proc_var); (void)scm_call_0(proc); return NULL; } void *thread(void *arg) { (void)arg; scm_with_guile(do_call_f, "f"); return NULL; } int main(void) { pthread_t pt; scm_with_guile(eval_string, "(load \"scheme.scm\")"); pthread_create(&pt, NULL, thread, NULL); pthread_join(pt, NULL); return 0; } --uAKRQypu60I7Lcqm--