spirit-code / spirit

Atomistic Spin Simulation Framework
http://spirit-code.github.io
MIT License
117 stars 52 forks source link

Segmentation fault when disabling DDI during simulation #631

Open FinnHoller opened 1 year ago

FinnHoller commented 1 year ago

I have downloaded the new Spirit-2.2.0 release (revision b739e4e06f31c) and noticed a bug in the cpp-ui (qt). Previously it was possible to tweak the Heisenberg Hamiltonian parameters, while running a simulation (tested for LLG and MC). In this new version this still seems possible, although less responsive. Only when enabling or disabling the dipole-dipole interaction, the program crashes with a segmentation fault.

I have compiled the code from source, with following options: cmake -DSPIRIT_USE_OPENMP=OFF ..

System information:

FinnHoller commented 1 year ago

I just tested and this does not happen in LLG when openMP is enabled. It still happens with MC.

GPMueller commented 1 year ago

I have the suspicion that the GUI might be passing a nullptr to the C API somewhere. Not sure when, but a few misuses of the C API in the GUIs seem to have crept in. On the develop branch I added a bunch of throw_if_nullptr checks around the arguments of the C API functions, which will generate a decent log message if the API is used incorrectly.

Could you try the develop branch to see whether the issue persists for you there?

FinnHoller commented 1 year ago

I have cloned and built the develop branch, but there are no logs when the segmentation fault happens, should these appear in the spirit log or on the standard output?

GPMueller commented 1 year ago

So the segfault still happens?

I'll try to reproduce this as soon as I can. In case it might be helpful please attach your input-config.

FinnHoller commented 1 year ago

Yes it does still happen.

This is the configuration I am using: test_cfg.txt

FinnHoller commented 1 year ago

I also got this error while changing the exchange interation during an LLG (solver: LBFGS_Atlas) simulation:

malloc(): unsorted double linked list corrupted
Segmentation fault