Bug #1618
g_protonate segfaults unconditionally
Description
g_protonate segfaults on version 4.6.8 (shown below), but also on 5.0.2. I am unable to attempt it on 5.1 at the moment. Appears to be related to calling protonate(), located in src/kernel/genhydro.c
g_protonate -s ref_test.pdb -f test.xtc
...
Select group to process:
Group 0 ( System) has 398 elements
Group 1 ( Protein) has 398 elements
Group 2 ( Protein-H) has 398 elements
Group 3 ( C-alpha) has 50 elements
Group 4 ( Backbone) has 150 elements
Group 5 ( MainChain) has 200 elements
Group 6 ( MainChain+Cb) has 249 elements
Group 7 ( MainChain+H) has 200 elements
Group 8 ( SideChain) has 198 elements
Group 9 ( SideChain-H) has 198 elements
Select a group: 0
Selected 0: 'System'
Reading frame 0 time 1.000 Opening force field file /nethome/bjornf/gromacs/./gromacs/share/top/gmx2.ff/aminoacids.hdb
Opening force field file /nethome/bjornf/gromacs/./gromacs/share/top/gmx2.ff/atomtypes.atp
Atomtype 1
Opening force field file /nethome/bjornf/gromacs/./gromacs/share/top/gmx2.ff/aminoacids.n.tdb
Opening force field file /nethome/bjornf/gromacs/./gromacs/share/top/gmx2.ff/aminoacids.c.tdb
[1] 30440 segmentation fault (core dumped) ./gromacs/build/src/kernel/g_protonate -s ref_test.pdb -f test.xtc
Associated revisions
Remove infrastructure for gmx protonate
The front end was removed earlier.
Refs #1618
Change-Id: I0e58d3cb5451a4aabebdf3bc5920c088c1a3923f
History
#1 Updated by Erik Lindahl over 5 years ago
- Assignee set to Erik Lindahl
#2 Updated by Erik Lindahl over 5 years ago
- Status changed from New to In Progress
#3 Updated by Peter Kasson over 5 years ago
You're too fast! :) Was testing this one before I hopped on the flight last night, but I don't have a patch yet. Just got to the reproduce + trace stage. I'll go hunt some other bugs.
#4 Updated by Berk Hess over 5 years ago
Could this be related to the hackblock fix that Erik fixed recently (forgot the id's)?
Unfortunately there is no stack trace here.
#5 Updated by Erik Lindahl over 5 years ago
Unfortunately not, I already tested those fixes here!
Will paste debug session below.
#6 Updated by Erik Lindahl over 5 years ago
Process 72223 stopped * thread #1: tid = 0x1a5059, 0x00000001000bfc42 libgromacs.0.0.0.dylib`calc_all_pos(pdba=0x00000001024047b0, x=0x000000010301fa00, nab=0x0000000103011800, ab=0x0000000103007c00, bCheckMissing=0) + 210 at genhydro.c:389, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x8) frame #0: 0x00000001000bfc42 libgromacs.0.0.0.dylib`calc_all_pos(pdba=0x00000001024047b0, x=0x000000010301fa00, nab=0x0000000103011800, ab=0x0000000103007c00, bCheckMissing=0) + 210 at genhydro.c:389 386 for (j = 0; j < nab[i]; j += ab[i][j].nr) 387 { 388 /* check if we're adding: */ -> 389 if (ab[i][j].oname == NULL && ab[i][j].tp > 0) 390 { 391 bFoundAll = TRUE; 392 for (m = 0; (m < ab[i][j].nctl && bFoundAll); m++) (lldb) bt * thread #1: tid = 0x1a5059, 0x00000001000bfc42 libgromacs.0.0.0.dylib`calc_all_pos(pdba=0x00000001024047b0, x=0x000000010301fa00, nab=0x0000000103011800, ab=0x0000000103007c00, bCheckMissing=0) + 210 at genhydro.c:389, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x8) * frame #0: 0x00000001000bfc42 libgromacs.0.0.0.dylib`calc_all_pos(pdba=0x00000001024047b0, x=0x000000010301fa00, nab=0x0000000103011800, ab=0x0000000103007c00, bCheckMissing=0) + 210 at genhydro.c:389 frame #1: 0x00000001000be328 libgromacs.0.0.0.dylib`add_h_low(pdbaptr=0x00007fff5fbfd8b0, xptr=0x00007fff5fbfda30, nah=39, ah=0x000000010282a800, nterpairs=1, ntdb=0x0000000102402170, ctdb=0x0000000102402ea0, rN=0x0000000102402eb0, rC=0x0000000102402ec0, bCheckMissing=0, nabptr=0x00007fff5fbfe708, abptr=0x00007fff5fbfe710, bUpdate_pdba=0, bKeep_old_pdba=1) + 840 at genhydro.c:537 frame #2: 0x00000001000bdee5 libgromacs.0.0.0.dylib`add_h(pdbaptr=0x00007fff5fbfd8b0, xptr=0x00007fff5fbfda30, nah=39, ah=0x000000010282a800, nterpairs=1, ntdb=0x0000000102402170, ctdb=0x0000000102402ea0, rN=0x0000000102402eb0, rC=0x0000000102402ec0, bAllowMissing=1, nabptr=0x00007fff5fbfe708, abptr=0x00007fff5fbfe710, bUpdate_pdba=1, bKeep_old_pdba=1) + 261 at genhydro.c:778 frame #3: 0x00000001000bf6e7 libgromacs.0.0.0.dylib`protonate(atomsptr=0x00007fff5fbfdbf8, xptr=0x00007fff5fbfda30, protdata=0x00007fff5fbfe6f8) + 1191 at genhydro.c:891 frame #4: 0x00000001000dc93b libgromacs.0.0.0.dylib`gmx_protonate(argc=1, argv=0x00007fff5fbffaf8) + 2507 at protonate.c:200 frame #5: 0x0000000100149f74 libgromacs.0.0.0.dylib`gmx::(anonymous namespace)::CMainCommandLineModule::run(this=0x0000000102205c50, argc=5, argv=0x00007fff5fbffaf8) + 36 at cmdlinemodulemanager.cpp:119 frame #6: 0x00000001001492ed libgromacs.0.0.0.dylib`gmx::CommandLineModuleManager::run(this=0x00007fff5fbff9e0, argc=5, argv=0x00007fff5fbffaf8) + 813 at cmdlinemodulemanager.cpp:545 frame #7: 0x00000001000024f1 gmx`main(argc=6, argv=0x00007fff5fbffaf0) + 433 at gmx.cpp:58 frame #8: 0x00007fff959f15c9 libdyld.dylib`start + 1
#7 Updated by Gerrit Code Review Bot over 5 years ago
Gerrit received a related patchset '1' for Issue #1618.
Uploader: Erik Lindahl (erik.lindahl@gmail.com)
Change-Id: If57e250f0ffbe32bcc948d09b54b225db9724c35
Gerrit URL: https://gerrit.gromacs.org/4800
#8 Updated by Erik Lindahl over 5 years ago
While we might be able to fix gmx protonate, this tools appears to have been pretty much unused since the crashes go all the way back to 4.6. Since nobody has complained, I think it's better that we remove it and focus on a few high-quality tools. It was anyway mostly intended for united atom force fields when written a long time ago, and those are mostly deprecated today.
#9 Updated by Gerrit Code Review Bot over 5 years ago
Gerrit received a related patchset '1' for Issue #1618.
Uploader: Mark Abraham (mark.j.abraham@gmail.com)
Change-Id: I0e58d3cb5451a4aabebdf3bc5920c088c1a3923f
Gerrit URL: https://gerrit.gromacs.org/5011
Removed gmx protonate tool
This tool appears to have been largely unused, since
testing shows it crashes for a normal trajectory all
the way back to 4.6. Since it is only relevant for
united-atom force fields, we'll reduce the maintenance
load by simply removing it for now - it might reappear
in the future.
Refs #1618.
Change-Id: If57e250f0ffbe32bcc948d09b54b225db9724c35