Bug #326
genbox segfault
Description
genbox in gromacs 4.0.4 segfaults:
....
Checking Protein-Solvent overlap: tested 1 pairs, removed 6 atoms.
Checking Solvent-Solvent overlap: tested 0 pairs, removed 0 atoms.
[New Thread 0x7ffff7fc26f0 (LWP 11916)]
ram received signal SIGSEGV, Segmentation fault.
0x000000354b67cf72 in __libc_realloc (oldmem=0x618af0, bytes=2456) at malloc.c:3691
3691 ar_ptr = arena_for_chunk(oldp);
This occurs when trying
genbox -ci methanol.gro -nmol 343 -o conf.gro -box 2.84 2.84 2.84
History
#1 Updated by Jussi Lehtola over 11 years ago
Created an attachment (id=373)
Methanol coordinate file
#2 Updated by Berk Hess over 11 years ago
I can not reproduce this segv.
Could you check if 4.0.5 has the same problem?
If so, could you install valgrind and run genbox in valgrind:
valgrind genbox -ci ...
redirect the output,
do grep ==
on the output and put that on bugzilla?
Thanks,
Berk
#3 Updated by Jussi Lehtola over 11 years ago
Created an attachment (id=376)
Grep'd output of valgrind of genbox 4.0.5
#4 Updated by Berk Hess over 11 years ago
Could you try the fix below for 4.0.5?
Thanks,
Berk
RCS file: /home/gmx/cvs/gmx/src/mdlib/force.c,v
retrieving revision 1.181.2.7
diff r1.181.2.7 force.c
1219c1219
< if (fr->cg_cm == NULL && !DOMAINDECOMP) {
--
if (ncg_mtop(mtop) > fr->cg_nalloc && !DOMAINDECOMP) {
1222c1222
< snew(fr->cg_cm,fr->cg_nalloc);
---
srenew(fr->cg_cm,fr->cg_nalloc);
#5 Updated by Jussi Lehtola over 11 years ago
Created an attachment (id=377)
Remaining memory leaks
#6 Updated by Jussi Lehtola over 11 years ago
The patch fixes the segfault, but there is some memory still leaked. Attached log of valgrind --leak-check=full.
#7 Updated by Berk Hess over 11 years ago
I fixed this bug for 4.0.6 and 4.1.
Gromacs is (unfortunately) full of memory leaks.
But this is only due to data structures not being properly freed
when programs finish, it therefore has no effect on memory usage.
Thanks for reporting and testing this,
Berk