Project

General

Profile

Bug #176

mdrun segfaults with qmmm

Added by Alexey Shvetsov almost 12 years ago. Updated over 11 years ago.

Status:
Closed
Priority:
Normal
Category:
mdrun
Target version:
Affected version - extra info:
Affected version:
Difficulty:
uncategorized
Close

Description

Created an attachment (id=255)
Valgrind memeory info

Program received signal SIGSEGV, Segmentation fault.
0x080caf3c in rvec_sub (a=0x82cc158, b=0x642a3c98, c=0x82e2648) at /home/alexxy/gromacs/gmx/include/vec.h:283
283 x=a[XX]-b[XX];
(gdb) bt
#0 0x080caf3c in rvec_sub (a=0x82cc158, b=0x642a3c98, c=0x82e2648) at /home/alexxy/gromacs/gmx/include/vec.h:283
#1 0x080cae93 in update_QMMM_coord (x=0x82ca310, fr=0x82d99b0, qm=0x82e2570, mm=0x82e26e8) at /home/alexxy/gromacs/gmx/src/mdlib/qmmm.c:248
#2 0x080cd15f in update_QMMMrec (cr=0x82ad398, fr=0x82d99b0, x=0x82ca310, md=0x82e2718, box=0x82b24b4, top=0x82b2060)
at /home/alexxy/gromacs/gmx/src/mdlib/qmmm.c:940
#3 0x080b1184 in do_force (fplog=0x82afd18, cr=0x82ad398, inputrec=0x82b1418, step=0, nrnb=0x82b1830, wcycle=0x82b1218, top=0x82b2060,
grps=0x82afff0, box=0x82b24b4, x=0x82ca310, f=0x82d5af0, buf=0x82d1e28, mdatoms=0x82e2718, ener=0x82b1e38, fcd=0x82afe98, lambda=0,
graph=0x82b2658, bStateChanged=1, bNS=1, bNBFonly=0, bDoForces=1, fr=0x82d99b0, mu_tot=0xbff45708, bGatherOnly=0, t=0, field=0x0,
edyn=0x82ae828) at /home/alexxy/gromacs/gmx/src/mdlib/sim_util.c:419
#4 0x0805e3d5 in do_md (log=0x82afd18, cr=0x82ad398, nfile=24, fnm=0x8294900, bVerbose=0, bCompact=1, ddxyz=0xbff45bfc, ddcsx=0x0, ddcsy=0x0,
ddcsz=0x0, vsite=0x0, stepout=100, ir=0x82b1418, grps=0x82afff0, top_global=0x82b2060, ener=0x82b1e38, fcd=0x82afe98,
state_global=0x82b24a0, f=0x82d5af0, buf=0x82d1e28, mdatoms=0x82e2718, nrnb=0x82b1830, wcycle=0x82b1218, graph=0x82b2658, edyn=0x82ae828,
fr=0x82d99b0, repl_ex_nst=0, repl_ex_seed=-1, Flags=512) at /home/alexxy/gromacs/gmx/src/kernel/md.c:917
#5 0x0805bf7a in mdrunner (cr=0x82ad398, nfile=24, fnm=0x8294900, bVerbose=0, bCompact=1, ddxyz=0xbff45bfc, dd_node_order=1, rdd=0, ddcsx=0x0,
ddcsy=0x0, ddcsz=0x0, nstepout=100, edyn=0x82ae828, repl_ex_nst=0, repl_ex_seed=-1, Flags=512)
at /home/alexxy/gromacs/gmx/src/kernel/md.c:357
#6 0x08060b2b in main (argc=1, argv=0xbff45cc4) at /home/alexxy/gromacs/gmx/src/kernel/mdrun.c:302
(gdb) p XX
$1 = 0
(gdb) p *a
$2 = 1.1572631347625357
(gdb) p *b
Cannot access memory at address 0x642a3c98
(gdb) up
#1 0x080cae93 in update_QMMM_coord (x=0x82ca310, fr=0x82d99b0, qm=0x82e2570, mm=0x82e26e8) at /home/alexxy/gromacs/gmx/src/mdlib/qmmm.c:248
248 rvec_sub(x[qm->indexQM[i]],fr->shift_vec[qm->shiftQM[i]],qm->xQM[i]);
(gdb) quit
The program is running. Exit anyway? (y or n) y

mdrun.dump.log.10957 (198 KB) mdrun.dump.log.10957 Valgrind memeory info Alexey Shvetsov, 11/15/2007 10:25 PM
topol.tpr (116 KB) topol.tpr tpr of box of water from examples with 1 QM water molecule Alexey Shvetsov, 11/16/2007 10:27 PM
conf.gro (28.6 KB) conf.gro conf.gro Alexey Shvetsov, 11/19/2007 03:48 PM
grompp.mdp (9.24 KB) grompp.mdp grompp.mdp Alexey Shvetsov, 11/19/2007 03:48 PM
index.ndx (4.3 KB) index.ndx index.ndx Alexey Shvetsov, 11/19/2007 03:49 PM
topol.top (87 Bytes) topol.top topol.top Alexey Shvetsov, 11/19/2007 03:49 PM

History

#1 Updated by Alexey Shvetsov almost 12 years ago

looks like a bug of memmroy allocation

dirty hack to fix it

on line 760 in src/mdlib/qmmm.c
change from

snew(qm_i_particles,QMMMlist_sr.nri);

to

snew(qm_i_particles,QMMMlist_sr.nri*2);

thanks

btw i find this bug something about two days ago after cvs up
PS I try to write qmmm interface from gromacs to gamess-us

#2 Updated by Alexey Shvetsov almost 12 years ago

this bug related to x86 arch
on x86_64 all works ok

#3 Updated by David van der Spoel almost 12 years ago

(In reply to comment #0)

Created an attachment (id=255) [details]
Valgrind memeory info
/home/alexxy/gromacs/gmx/src/kernel/mdrun.c:302
(gdb) p XX
$1 = 0
(gdb) p *a
$2 = 1.1572631347625357
(gdb) p *b
Cannot access memory at address 0x642a3c98
(gdb) up
#1 0x080cae93 in update_QMMM_coord (x=0x82ca310, fr=0x82d99b0, qm=0x82e2570,
mm=0x82e26e8) at /home/alexxy/gromacs/gmx/src/mdlib/qmmm.c:248
248
rvec_sub(x[qm->indexQM[i]],fr->shift_vec[qm->shiftQM[i]],qm->xQM[i]);

From this it seems that qm->shiftQM[i] must be out of range (0-26). Could you please print it as well? And i and qm->indexQM[i] as well?

It could be that your proposed solution prevents this other array from being overwritten.

#4 Updated by Alexey Shvetsov almost 12 years ago

(In reply to comment #3)

From this it seems that qm->shiftQM[i] must be out of range (0-26). Could you
please print it as well? And i and qm->indexQM[i] as well?

It could be that your proposed solution prevents this other array from being
overwritten.

Program received signal SIGSEGV, Segmentation fault.
0x080c631c in rvec_sub (a=0x82b8888, b=0x642903c8, c=0x82ced78) at /home/alexxy/gromacs/gmx/include/vec.h:283
283 x=a[XX]-b[XX];
(gdb) bt
#0 0x080c631c in rvec_sub (a=0x82b8888, b=0x642903c8, c=0x82ced78) at /home/alexxy/gromacs/gmx/include/vec.h:283
#1 0x080c6273 in update_QMMM_coord (x=0x82b6a40, fr=0x82c60e0, qm=0x82ceca0, mm=0x82cee18) at /home/alexxy/gromacs/gmx/src/mdlib/qmmm.c:248
#2 0x080c8553 in update_QMMMrec (cr=0x829c398, fr=0x82c60e0, x=0x82b6a40, md=0x82cee48, box=0x829ec34, top=0x829e7e0)
at /home/alexxy/gromacs/gmx/src/mdlib/qmmm.c:940
#3 0x080a88a3 in do_force (fplog=0x829c428, cr=0x829c398, inputrec=0x829db98, step=0, nrnb=0x829dfb0, wcycle=0x829d998, top=0x829e7e0,
grps=0x829d4e0, box=0x829ec34, x=0x82b6a40, f=0x82c2220, buf=0x82be558, mdatoms=0x82cee48, ener=0x829e5b8, fcd=0x829c590, lambda=0,
graph=0x829edc8, bStateChanged=1, bNS=1, bNBFonly=0, bDoForces=1, fr=0x82c60e0, mu_tot=0xbf9ac978, bGatherOnly=0, t=0, field=0x0,
edyn=0x829c3d0) at /home/alexxy/gromacs/gmx/src/mdlib/sim_util.c:417
#4 0x08059259 in do_md (log=0x829c428, cr=0x829c398, nfile=24, fnm=0x82887c0, bVerbose=0, bCompact=1, ddxyz=0xbf9ace5c, ddcsx=0x0, ddcsy=0x0,
ddcsz=0x0, vsite=0x0, stepout=100, ir=0x829db98, grps=0x829d4e0, top_global=0x829e7e0, ener=0x829e5b8, fcd=0x829c590,
state_global=0x829ec20, f=0x82c2220, buf=0x82be558, mdatoms=0x82cee48, nrnb=0x829dfb0, wcycle=0x829d998, graph=0x829edc8, edyn=0x829c3d0,
fr=0x82c60e0, repl_ex_nst=0, repl_ex_seed=-1, Flags=512) at /home/alexxy/gromacs/gmx/src/kernel/md.c:917
#5 0x08056e32 in mdrunner (cr=0x829c398, nfile=24, fnm=0x82887c0, bVerbose=0, bCompact=1, ddxyz=0xbf9ace5c, dd_node_order=1, rdd=0, ddcsx=0x0,
ddcsy=0x0, ddcsz=0x0, nstepout=100, edyn=0x829c3d0, repl_ex_nst=0, repl_ex_seed=-1, Flags=512)
at /home/alexxy/gromacs/gmx/src/kernel/md.c:358
#6 0x0805ba10 in main (argc=1, argv=0xbf9acf24) at /home/alexxy/gromacs/gmx/src/kernel/mdrun.c:302
(gdb) p XX
$1 = 0
(gdb) p *a
$2 = 1.1572631347625357
(gdb) p *b
Cannot access memory at address 0x642903c8
(gdb) up
#1 0x080c6273 in update_QMMM_coord (x=0x82b6a40, fr=0x82c60e0, qm=0x82ceca0, mm=0x82cee18) at /home/alexxy/gromacs/gmx/src/mdlib/qmmm.c:248
248 rvec_sub(x[qm->indexQM[i]],fr->shift_vec[qm->shiftQM[i]],qm->xQM[i]);
(gdb) p qm->shiftQM[i]
$3 = 1138045264
(gdb) p i
$4 = 2
(gdb) p qm->indexQM[i]
$5 = 323

#5 Updated by David van der Spoel almost 12 years ago

OK, that's what I expected. Did you have problems when running without valgrind as well?

Could you please upload a tpr file that has this problem and some specs about the hardware you are running on?

#6 Updated by Alexey Shvetsov almost 12 years ago

Created an attachment (id=256)
tpr of box of water from examples with 1 QM water molecule

It seems to me that this bug related to x86 arh only
Tested on x86 dual cpu machine (dual Pentium3 Xeon 1000) running Gentoo linux
and IBM TinkPad X31 (Pentium M 1.4 ) running Gentoo

But i cant reproduce this bug on x86_64 hardware running 64bit Linux distributions

#7 Updated by David van der Spoel almost 12 years ago

And which QM program are you using? Or is this with your Gamess interface?

#8 Updated by Alexey Shvetsov almost 12 years ago

This results with Gamess-US
but for now it is't working... It only generates run input gamess file and run gamess... Now i try get gradients and coordinates from gamess-us output files...

mdrun failed during setup as you can see in valgrind dump

I have just added defenitions for gamess-us in qmmm.c
all interface code in qm_gamess_us.c

#9 Updated by David van der Spoel almost 12 years ago

Since this is a modified version of gromacs the question is whether it can be reproduced with "standard" gromacs as well? Or, in other words, did you change any code that is executed before this crashes?

#10 Updated by Alexey Shvetsov almost 12 years ago

(In reply to comment #9)

Since this is a modified version of gromacs the question is whether it can be
reproduced with "standard" gromacs as well? Or, in other words, did you change
any code that is executed before this crashes?

I didnt change any code that executed before crash
gromacs crashes at setup stage
before it executes any of my functions
it crashe only on x86 32bit linux
on x86_64 and 64bit linux it works

well, i can try to peproduce this bug this mopac interface

#11 Updated by Gerrit Groenhof almost 12 years ago

Instead ot fpr, could you send me input files: ndx,gro,top and mdp?

Thanks,

Gerri

#12 Updated by Alexey Shvetsov almost 12 years ago

Created an attachment (id=261)
conf.gro

#13 Updated by Alexey Shvetsov almost 12 years ago

Created an attachment (id=262)
grompp.mdp

#14 Updated by Alexey Shvetsov almost 12 years ago

Created an attachment (id=263)
index.ndx

#15 Updated by Alexey Shvetsov almost 12 years ago

Created an attachment (id=264)
topol.top

#16 Updated by Gerrit Groenhof almost 12 years ago

The bOpt option is not working, so I switched it off. It worked only in the 3.1 versions. I hope you do not rely on this feature?

gerrit

#17 Updated by Alexey Shvetsov almost 12 years ago

(In reply to comment #16)

The bOpt option is not working, so I switched it off. It worked only in the
3.1 versions. I hope you do not rely on this feature?

gerrit

hmm, what QMMM options works?

#18 Updated by Gerrit Groenhof almost 12 years ago

Only the ones that set the level of QM theory. All optimizations and dynamics are performed by the gromacs routines. We are still working on implementing methods to find critical points, including TS's

Gerrit

hmm, what QMMM options works?

#19 Updated by Alexey Shvetsov almost 12 years ago

(In reply to comment #18)

Only the ones that set the level of QM theory. All optimizations and dynamics
are performed by the gromacs routines. We are still working on implementing
methods to find critical points, including TS's

Gerrit

Ok.
Btw can you provide some tests to verify that qmmm interface works? I think I get gmmm for gamess-us working this week.

#20 Updated by Gerrit Groenhof almost 12 years ago

Ok.
Btw can you provide some tests to verify that qmmm interface works? I think I
get gmmm for gamess-us working this week.

Great. I send you some inputs later by email.

I just compiled on our last 32 bit machine, but I did not experience the problems you described.

Gerrit

#21 Updated by Alexey Shvetsov almost 12 years ago

(In reply to comment #20)

Great. I send you some inputs later by email.

I just compiled on our last 32 bit machine, but I did not experience the
problems you described.

Gerrit

Thanks =)

#22 Updated by Berk Hess almost 12 years ago

Note that Alexey is using the CVS head branch.
I think I did not break anything there when not using domain decomposition,
but there can always be a small bug somewhere.

Berk.

#23 Updated by David van der Spoel over 11 years ago

Can we close this bug as "works for me"?

#24 Updated by Alexey Shvetsov over 11 years ago

(In reply to comment #23)

Can we close this bug as "works for me"?

Yes
Now it works
at least with two last my checkouts of cvs
=)

#25 Updated by Alexey Shvetsov over 11 years ago

Btw
where can i send patches for qmmm-gamess_us when i feel that they'll be ready for use?

#26 Updated by Gerrit Groenhof over 11 years ago

I think we can close this bug then.

Alex, you cane send the source files to me by email when they are ready.

Gerrit

Also available in: Atom PDF