SunnySuite / Sunny.jl

Spin dynamics and generalization to SU(N) coherent states
Other
86 stars 19 forks source link

Occasional segfaults when dipole-dipole interactions are enabled #65

Closed kbarros closed 1 year ago

kbarros commented 1 year ago

See discussion here: https://github.com/JuliaLang/julia/issues/48722

As a temporary workaround, we have disabled dipole-dipole interactions in unit tests that check for energy consistency. https://github.com/SunnySuite/Sunny.jl/commit/3d54b13249d67f2c0829809e89d0a5ebb9ed261d

kbarros commented 1 year ago

The underlying problem was that deepcopy is frequently memory unsafe, per Julia developers (this needs to be announced more broadly). Attempting to deecopy an FFTW plan was leading to a use-after-free, reported here https://github.com/JuliaMath/FFTW.jl/issues/261. In the future we will avoid all uses of deepcopy in Sunny.