Hi Romain, Does it still happen if you call fftw_cleanup? http://www.fftw.org/fftw3_doc/Using-Plans.html
Cheers, piem On 14/10/2010 18:40, Romain Beauxis wrote:
Package: libfftw3-3 Version: 3.2.2-1 Severity: important Tags: upstream Hi ! There seems to be a memory leak when doing a 1d transform. To reproduce, you can use the following code, adapted from the manual [1]: 8<------------------------------------>8 #include<fftw3.h> #include<stdlib.h> #define N 100 #define SEED 123456789 int main (int argc, char *argv[]) { fftw_complex *in, *out; fftw_plan p; in = (fftw_complex*) fftw_malloc(sizeof(fftw_complex) * N); out = (fftw_complex*) fftw_malloc(sizeof(fftw_complex) * N); int i; for (i = 0; i< N; i++) { in[i][0] = rand(); in[i][1] = rand(); out[i][0] = rand(); out[i][1] = rand(); } p = fftw_plan_dft_1d(N, in, out, FFTW_FORWARD, FFTW_ESTIMATE); fftw_execute(p); /* repeat as needed */ fftw_destroy_plan(p); fftw_free(in); fftw_free(out); exit(0); } 8<------------------------------------>8 When run with valgrind --leak-check=full --show-reachable=yes ./test_fftw_memleakc It shows tons of leaks of the form: ==11476== 40 bytes in 1 blocks are still reachable in loss record 38 of 73 ==11476== at 0x4C244E8: malloc (vg_replace_malloc.c:236) ==11476== by 0x4E3D871: fftw_malloc_plain (in /usr/lib/libfftw3.so.3.2.4) ==11476== by 0x4E416F8: fftw_mksolver (in /usr/lib/libfftw3.so.3.2.4) ==11476== by 0x4E49E2F: fftw_dft_vrank_geq1_register (in /usr/lib/libfftw3.so.3.2.4) ==11476== by 0x4E41737: fftw_solvtab_exec (in /usr/lib/libfftw3.so.3.2.4) ==11476== by 0x4E44DA2: fftw_dft_conf_standard (in /usr/lib/libfftw3.so.3.2.4) ==11476== by 0x4F0BCB8: fftw_configure_planner (in /usr/lib/libfftw3.so.3.2.4) ==11476== by 0x4F10563: fftw_the_planner (in /usr/lib/libfftw3.so.3.2.4) ==11476== by 0x4F0BAED: fftw_mkapiplan (in /usr/lib/libfftw3.so.3.2.4) ==11476== by 0x4F101A5: fftw_plan_many_dft (in /usr/lib/libfftw3.so.3.2.4) ==11476== by 0x4F0F678: fftw_plan_dft (in /usr/lib/libfftw3.so.3.2.4) ==11476== by 0x4F0F425: fftw_plan_dft_1d (in /usr/lib/libfftw3.so.3.2.4) Romain [1]: http://www.fftw.org/fftw3_doc/Complex-One_002dDimensional-DFTs.html#Complex-One_002dDimensional-DFTs -- System Information: Debian Release: squeeze/sid APT prefers unstable APT policy: (500, 'unstable'), (1, 'experimental') Architecture: amd64 (x86_64) Kernel: Linux 2.6.32-4-amd64 (SMP w/2 CPU cores) Locale: LANG=fr_FR.UTF8, LC_CTYPE=fr_FR.UTF8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/bash Versions of packages libfftw3-3 depends on: ii libc6 2.11.2-6 Embedded GNU C Library: Shared lib libfftw3-3 recommends no packages. Versions of packages libfftw3-3 suggests: pn libfftw3-dev<none> (no description available) -- no debconf information
-- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org