unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* seg fault with repeated function calls from C?
@ 2008-12-16  6:22 Anand Dixit
  2008-12-16 17:17 ` Anand Dixit
  0 siblings, 1 reply; 8+ messages in thread
From: Anand Dixit @ 2008-12-16  6:22 UTC (permalink / raw)
  To: guile-user

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





^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2008-12-17 10:28 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-16  6:22 seg fault with repeated function calls from C? Anand Dixit
2008-12-16 17:17 ` 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

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).