-
Notifications
You must be signed in to change notification settings - Fork 49
Closed
Milestone
Description
Dear authors,
I have found that the following simple program crashes (segfault) when compiled and linked against NFFT 3.3.2.
#include "nfft3.h"
int main(void) {
int N[] = {8}; /* Works for >= 9 */
int M = 10;
nfft_plan p;
nfft_init(&p, 1, N, M);
for(int i = 0; i < M; ++i) {
p.x[i] = -0.5 + (double)i / M;
p.f[i][0] = 1.0; /* Memory corruption? */
p.f[i][1] = 0.0;
}
if(p.flags & PRE_ONE_PSI) nfft_precompute_one_psi(&p);
nfft_check(&p);
nfft_adjoint(&p); /* Segfault if M <= 6 */
nfft_vpr_complex(p.f_hat, p.N_total, "adjoint nfft, vector f_hat");
nfft_finalize(&p); /* Segfault if M > 6 */
return 0;
}Some remarks are to be made about the program.
- It successfully runs to completion if
Nis 9 or larger; - For
M <= 6the segmentation fault occurs innfft_adjoint(); - For larger
Mit occurs innfft_finalize(); - There is no crash if
p.fis untouched.
Is this a bug or am I just misusing NFFT?
Metadata
Metadata
Assignees
Labels
No labels