From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Anand Dixit Newsgroups: gmane.lisp.guile.user Subject: Re: seg fault with repeated function calls from C? Date: Tue, 16 Dec 2008 09:17:15 -0800 Message-ID: <1229447835.11638.3.camel@home-desktop> References: <1229408522.10718.11.camel@home-desktop> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7BIT X-Trace: ger.gmane.org 1229448011 23811 80.91.229.12 (16 Dec 2008 17:20:11 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 16 Dec 2008 17:20:11 +0000 (UTC) To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Tue Dec 16 18:21:15 2008 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LCdb8-0001bj-MZ for guile-user@m.gmane.org; Tue, 16 Dec 2008 18:20:42 +0100 Original-Received: from localhost ([127.0.0.1]:58688 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LCdZw-0003bM-M8 for guile-user@m.gmane.org; Tue, 16 Dec 2008 12:19:28 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LCdSD-00035q-1p for guile-user@gnu.org; Tue, 16 Dec 2008 12:11:29 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LCdSB-000340-1A for guile-user@gnu.org; Tue, 16 Dec 2008 12:11:28 -0500 Original-Received: from [199.232.76.173] (port=45702 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LCdSA-00033n-Op for guile-user@gnu.org; Tue, 16 Dec 2008 12:11:26 -0500 Original-Received: from brmea-mail-4.sun.com ([192.18.98.36]:39900) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LCdSA-0000U8-3N for guile-user@gnu.org; Tue, 16 Dec 2008 12:11:26 -0500 Original-Received: from fe-amer-09.sun.com ([192.18.109.79]) by brmea-mail-4.sun.com (8.13.6+Sun/8.12.9) with ESMTP id mBGHBOZc009626 for ; Tue, 16 Dec 2008 17:11:24 GMT Original-Received: from conversion-daemon.mail-amer.sun.com by mail-amer.sun.com (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007)) id <0KBZ00601AEJQL00@mail-amer.sun.com> (original mail from Anand.Dixit@Sun.COM) for guile-user@gnu.org; Tue, 16 Dec 2008 10:11:24 -0700 (MST) Original-Received: from [192.168.2.4] ([64.9.237.132]) by mail-amer.sun.com (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007)) with ESMTPSA id <0KBZ004YMBQMLKD0@mail-amer.sun.com> for guile-user@gnu.org; Tue, 16 Dec 2008 10:11:17 -0700 (MST) In-reply-to: <1229408522.10718.11.camel@home-desktop> X-Mailer: Evolution 2.22.3.1 X-detected-operating-system: by monty-python.gnu.org: Solaris 9 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:7003 Archived-At: Resending to the group.My apologies if you receive it twice but I didn't see the post in the archives. - Anand On Mon, 2008-12-15 at 22:22 -0800, Anand Dixit wrote: > Hi all, > I am calling a guile function from my C code. Its a fairly straight > forward implementation. However, as I keep calling this function a > number of times, it breaks at some point with a segmentation fault. Here > is the relevant portion : > > int tmp,count=10000; > for (tmp=1;tmp func_symbol = scm_c_lookup("EsourceFn"); > func = scm_variable_ref(func_symbol); > ret=scm_call_4(func,scm_int2num(i),scm_int2num(j),scm_int2num(k),scm_double2num(currentTime)); > retValue = scm_num2double(ret,0,"fdtd"); > printf("Value from guile is tmp=%d %g\n",tmp,retValue); > } > > The break point in one case was after 4000+ calls. I was able to > localize the point of failure to the "scm_call_4" line. Any clue would > be greatly appreciated. > > Thanks, > - Anand >