Gmx densmap gives invalid next size error

GROMACS version:2021.2
GROMACS modification: No
I am using gmx densmap. It gives an error (posted below) for one particular frame (18520) and works great for the rest of the trajectory. I outputted that frame and checked it, and it looks fine.

command -
gmx densmap -f md_all_protein_clustered_center_fitted.xtc -s protein_pbc_mol-with_chainIDs.pdb -n polyq_jb6.ndx -od -bin 0.05 -aver y -b 18520 -e 18520

Error:

Reading frame       1 time 18520.000   *** Error in `gmx': free(): invalid next size (normal): 0x00000000020685a0 ***
======= Backtrace: =========
/lib64/libc.so.6(+0x81329)[0x7facb840b329]
/opt/gromacs/2021.2/bin/../lib64/libgromacs.so.6(_Z11xdr3dfcoordP3XDRPfPiS1_+0xea2)[0x7facba91c592]
/opt/gromacs/2021.2/bin/../lib64/libgromacs.so.6(+0xbbb50f)[0x7facba96f50f]
/opt/gromacs/2021.2/bin/../lib64/libgromacs.so.6(_Z13read_next_xtcP8t_fileioiPlPfPA3_fS4_S2_Pb+0x9d)[0x7facba96f7bd]
/opt/gromacs/2021.2/bin/../lib64/libgromacs.so.6(_Z15read_next_framePK16gmx_output_env_tP11t_trxstatusP10t_trxframe+0x174)[0x7facba96b5d4]
/opt/gromacs/2021.2/bin/../lib64/libgromacs.so.6(_Z11read_next_xPK16gmx_output_env_tP11t_trxstatusPfPA3_fS6_+0x1a)[0x7facba96c1ca]
/opt/gromacs/2021.2/bin/../lib64/libgromacs.so.6(_Z11gmx_densmapiPPc+0xc70)[0x7facba39ef50]
/opt/gromacs/2021.2/bin/../lib64/libgromacs.so.6(_ZN3gmx24CommandLineModuleManager3runEiPPc+0x262)[0x7facba1cce42]
gmx[0x40890c]
/lib64/libc.so.6(__libc_start_main+0xf5)[0x7facb83ac555]
gmx[0x40896d]

======= Memory map: ========
00400000-00433000 r-xp 00000000 103:02 138899774                         /opt/gromacs/2021.2/bin/gmx
00632000-00633000 r--p 00032000 103:02 138899774                         /opt/gromacs/2021.2/bin/gmx
00633000-00635000 rw-p 00033000 103:02 138899774                         /opt/gromacs/2021.2/bin/gmx
00635000-00636000 rw-p 00000000 00:00 0 
01e2b000-02104000 rw-p 00000000 00:00 0                                  [heap]
7faca4000000-7faca4021000 rw-p 00000000 00:00 0 
7faca4021000-7faca8000000 ---p 00000000 00:00 0 
7facab0bb000-7facab3ef000 rw-p 00000000 00:00 0 
7facab6de000-7facab71d000 r-xp 00000000 103:02 7916369                   /opt/gcc/8.3.0/lib64/libquadmath.so.0.0.0
7facab71d000-7facab91c000 ---p 0003f000 103:02 7916369                   /opt/gcc/8.3.0/lib64/libquadmath.so.0.0.0
7facab91c000-7facab91d000 r--p 0003e000 103:02 7916369                   /opt/gcc/8.3.0/lib64/libquadmath.so.0.0.0
7facab91d000-7facab91e000 rw-p 0003f000 103:02 7916369                   /opt/gcc/8.3.0/lib64/libquadmath.so.0.0.0
7facab91e000-7facab920000 r-xp 00000000 103:02 134383612                 /usr/lib64/libXau.so.6.0.0
7facab920000-7facabb20000 ---p 00002000 103:02 134383612                 /usr/lib64/libXau.so.6.0.0
7facabb20000-7facabb21000 r--p 00002000 103:02 134383612                 /usr/lib64/libXau.so.6.0.0
7facabb21000-7facabb22000 rw-p 00003000 103:02 134383612                 /usr/lib64/libXau.so.6.0.0
7facabb22000-7facabc41000 r-xp 00000000 103:02 137853495                 /usr/lib64/libgfortran.so.3.0.0
7facabc41000-7facabe41000 ---p 0011f000 103:02 137853495                 /usr/lib64/libgfortran.so.3.0.0
7facabe41000-7facabe42000 r--p 0011f000 103:02 137853495                 /usr/lib64/libgfortran.so.3.0.0
7facabe42000-7facabe44000 rw-p 00120000 103:02 137853495                 /usr/lib64/libgfortran.so.3.0.0
7facabe44000-7facabe6b000 r-xp 00000000 103:02 134383669                 /usr/lib64/libxcb.so.1.1.0
7facabe6b000-7facac06a000 ---p 00027000 103:02 134383669                 /usr/lib64/libxcb.so.1.1.0
7facac06a000-7facac06b000 r--p 00026000 103:02 134383669                 /usr/lib64/libxcb.so.1.1.0
7facac06b000-7facac06c000 rw-p 00027000 103:02 134383669                 /usr/lib64/libxcb.so.1.1.0
7facac06c000-7facac070000 r-xp 00000000 103:02 134383247                 /usr/lib64/libuuid.so.1.3.0
7facac070000-7facac26f000 ---p 00004000 103:02 134383247                 /usr/lib64/libuuid.so.1.3.0
7facac26f000-7facac270000 r--p 00003000 103:02 134383247                 /usr/lib64/libuuid.so.1.3.0
7facac270000-7facac271000 rw-p 00004000 103:02 134383247                 /usr/lib64/libuuid.so.1.3.0
7facac271000-7facae53d000 r-xp 00000000 103:02 157708892                 /usr/lib64/libopenblas-r0.3.3.so
7facae53d000-7facae73c000 ---p 022cc000 103:02 157708892                 /usr/lib64/libopenblas-r0.3.3.so
7facae73c000-7facae740000 r--p 022cb000 103:02 157708892                 /usr/lib64/libopenblas-r0.3.3.so
7facae740000-7facae75a000 rw-p 022cf000 103:02 157708892                 /usr/lib64/libopenblas-r0.3.3.so
7facae75a000-7facae765000 rw-p 00000000 00:00 0 
7facae765000-7facae8d2000 r-xp 00000000 103:02 157260790                 /usr/lib64/libfftw3f.so.3.3.2
7facae8d2000-7facaead1000 ---p 0016d000 103:02 157260790                 /usr/lib64/libfftw3f.so.3.3.2
7facaead1000-7facaeadd000 r--p 0016c000 103:02 157260790                 /usr/lib64/libfftw3f.so.3.3.2
7facaeadd000-7facaeade000 rw-p 00178000 103:02 157260790                 /usr/lib64/libfftw3f.so.3.3.2
7facbb51b000-7facbb530000 rw-p 00000000 00:00 0 
7facbb530000-7facbb552000 r-xp 00000000 103:02 134383123                 /usr/lib64/ld-2.17.so
7facbb556000-7facbb5bd000 rw-p 00000000 00:00 0 
7facbb713000-7facbb723000 rw-p 00000000 00:00 0 
7facbb74c000-7facbb751000 rw-p 00000000 00:00 0 
7facbb751000-7facbb752000 r--p 00021000 103:02 134383123                 /usr/lib64/ld-2.17.so
7facbb752000-7facbb753000 rw-p 00022000 103:02 134383123                 /usr/lib64/ld-2.17.so
7facbb753000-7facbb754000 rw-p 00000000 00:00 0 
7fff08867000-7fff08889000 rw-p 00000000 00:00 0                          [stack]
7fff089dd000-7fff089e0000 r--p 00000000 00:00 0                          [vvar]
7fff089e0000-7fff089e1000 r-xp 00000000 00:00 0                          [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0                  [vsyscall]
Aborted

Hi! You are using a GROMACS version that is no longer supported. Does the error occur if you use a more recent version, at least 2023.4, preferably 2024.1?

I just checked and the same error exists on the new versions of GROMACS (both 2023.4 and 2024.1).

Thanks. Then we’ll have a look at it. Would you be able to provide the files somewhere? Could you even open an issue at Issues · GROMACS / GROMACS · GitLab?