Hi Martin
I tried your FFT stuff. Here is my report:
1. I observed similar behaviour as you did (on my Linux machine with
R-1.4.1)
2. Changing from malloc to S_alloc seems to remove the problem (see
attachment).
I remember I had a similar problem long time ago (which caused me to
change from malloc to S_alloc everywhere) when calling the same function
twice (as you have). As far as I remember this problem was present on
Linux but not on Solaris. I could try running your test functions on
Solaris, but first I have to install a new R-version there (R-1.3.0 is
probably too old for this ?).
Hope this sheds a little light on the problem, but we are not there yet
(I do not understand the reason for the difference between S_alloc and
malloc).
Ole
Martin.Schlather@uni-bayreuth.de wrote:>
> Hi,
>
> I have problems when calling fft_factor and fft_work directly in my
> C-code. Martin Maechler already told me that I should not do this --
> anyway, the code works fine if the length of the vector is a multiple
> of 2,3,5.
> If the length of the vector has different form I get, in some cases, a
> segmentation fault when work and iwork are freed (I use C's malloc to
> allocate memory for work and iwork). No or less problems occur if I
> allocate more memory than stated in src/appl/fft.c.
>
> However R's fft in called in R does not fail.
>
> I would be grateful if anybody would tell me why this happens or to
> which fact I did not pay attention.
> Please find attached the package containing the relevant files.
> Details can be found in tests/test.R
>
> Many thanks in advance.
> Martin
>
> --
> Martin Schlather email: Martin.Schlather@uni-bayreuth.de
> Abteilung Bodenphysik phone: +49 (0)921 55 2193
> Univ. Bayreuth Fax : +49 (0)921 55 2246
> D -- 95440 Bayreuth, Germany http://www.geo.uni-bayreuth.de/~martin/
>
> ------------------------------------------------------------------------
> Name: FFT_0.0.0.tar.gz
> FFT_0.0.0.tar.gz Type: Unix Tape Archive (application/x-tar)
> Encoding: base64
--
Ole F. Christensen
Department of Mathematics and Statistics
Fylde College, Lancaster University
Lancaster, LA1 4YF, England