[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: seg fault with repeated function calls from C?
From: |
Anand Dixit |
Subject: |
Re: seg fault with repeated function calls from C? |
Date: |
Tue, 16 Dec 2008 09:17:15 -0800 |
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<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
>