Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segfault: finufft in multithreaded loop on Mac OS #63

Open
jkrimmer opened this issue Aug 22, 2024 · 0 comments
Open

Segfault: finufft in multithreaded loop on Mac OS #63

jkrimmer opened this issue Aug 22, 2024 · 0 comments

Comments

@jkrimmer
Copy link
Contributor

jkrimmer commented Aug 22, 2024

On Mac OS (arm64), I have encountered a segmentation fault with the following MWE, where the multi-threaded loop with single-threaded finufft crashes consistently. I have tried to replace the finufft library used by julia with a DUCC-FFT-based one without success. Hence, I conclude that this issue is orthogonal to #62.

using FFTW
using FINUFFT

iters = 1000
N = 1024

y = randn(ComplexF64, N)
x = randn(N)

@info "single-threaded loop, multi-threaded finufft"
for k in 1:iters
    nufft1d1(x, y, 1, 1e-8, N, nthreads=Threads.nthreads())
end
@info "multi-threaded loop, single-threaded finufft"
Threads.@threads for k in 1:iters
    nufft1d1(x, y, 1, 1e-8, N, nthreads=1)
end

Update

Even less code is required to reproduce this issue on my M3 Mac. Running the multi-threaded loop without calling finufft_makeplan before, does not crash right away. Then, I have to run the multi-threaded loop twice to reproduce the segmentation fault.

using FINUFFT
finufft_makeplan(1, [10;], 1, 1, 1e-6);
Threads.@threads for k in 1:1000
    finufft_makeplan(1, [10;], 1, 1, 1e-6);
end

julia v1.10.4
FINUFFT.jl v3.2.0
finufft_jll v2.2.0+2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant