You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Root cause: copy_locale() for nspin=4 wrote 4x the matrix size to uom_save,
reading beyond the locale matrix bounds (c[mm+size], c[mm+2*size], c[mm+3*size]).
The nspin=4 locale matrix already contains all spin components interleaved
in a single (2l+1)*2 x (2l+1)*2 matrix, so only one copy is needed.
This caused _Rb_tree heap corruption and segfault at iter=2 cal_occ_pw.
Fix: match zdy-tmp behavior - copy only once for nspin=4, matching the
existing copy_locale logic in zdy-tmp (dftu_occup.cpp:48-53).
Also disabled diagnostic prints that accessed locale[0][1] which doesn't
exist for nspin=4.
Test results:
- 223_PW_DFTU_S4_XY: 14 iter, -6364.27 eV (was: iter=2 crash)
- 224_PW_DFTU_S4_XY: 14 iter, -6364.27 eV (was: iter=2 crash)
- 264_PW_DFTU_DS_S4_XY: 15 iter, -6364.27 eV (was: iter=2 crash)
- 265_PW_DFTU_DS_S4_XYZ: 15 iter, -6364.27 eV (was: iter=2 crash)
- 261/262/263: no crash, iterating normally (were: immediate signal 6/11)
0 commit comments