Project

General

Profile

Bug #326

genbox segfault

Added by Jussi Lehtola over 10 years ago. Updated over 10 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Erik Lindahl
Category:
analysis tools
Target version:
Affected version - extra info:
Affected version:
Difficulty:
uncategorized
Close

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

methanol.gro (334 Bytes) methanol.gro Methanol coordinate file Jussi Lehtola, 05/20/2009 12:30 PM
valgrind2.log (10.4 KB) valgrind2.log Grep'd output of valgrind of genbox 4.0.5 Jussi Lehtola, 05/26/2009 09:49 AM
valgrind2.log (4.48 KB) valgrind2.log Remaining memory leaks Jussi Lehtola, 05/26/2009 11:39 AM

History

#1 Updated by Jussi Lehtola over 10 years ago

Created an attachment (id=373)
Methanol coordinate file

#2 Updated by Berk Hess over 10 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 10 years ago

Created an attachment (id=376)
Grep'd output of valgrind of genbox 4.0.5

#4 Updated by Berk Hess over 10 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 10 years ago

Created an attachment (id=377)
Remaining memory leaks

#6 Updated by Jussi Lehtola over 10 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 10 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

Also available in: Atom PDF