From: Anand Dixit <Anand.Dixit@Sun.COM>
To: guile-user@gnu.org
Subject: seg fault with repeated function calls from C?
Date: Mon, 15 Dec 2008 22:22:02 -0800 [thread overview]
Message-ID: <1229408522.10718.11.camel@home-desktop> (raw)
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<count;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
next reply other threads:[~2008-12-16 6:22 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-16 6:22 Anand Dixit [this message]
2008-12-16 17:17 ` seg fault with repeated function calls from C? Anand Dixit
2008-12-16 20:08 ` Ludovic Courtès
2008-12-17 0:23 ` Anand Dixit
2008-12-17 10:28 ` Neil Jerram
2008-12-16 22:23 ` Andy Wingo
2008-12-17 0:46 ` Anand Dixit
2008-12-17 2:46 ` Anand Dixit
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1229408522.10718.11.camel@home-desktop \
--to=anand.dixit@sun.com \
--cc=guile-user@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).