Crash with improper hybrid style none

Hello fellow lammps-users,

in using the improper style hybrid, i get a reproducible crash as soon as i set one improper_coeff to none.
The error is:
*** Error in ‘lmp_serial’: free(): invalid next size (fast): 0x000000000002915460 ***

This does not happen for dihedrals where i disable some interactions.
I reproduced this with lammps versions 23Nov13, 1Feb14 and 16Feb16, with or without modified Makefiles,
and on different machines. All are running more or less up to date versions of opensuse.
Any ideas? Any additional infos i can provide?

And as a general question:
Considering i only have two kinds of improper-interaction (interacting and non-interacting), is the hybrid+none
way of disabling the impropers i don’t want to calculate preferable to just passing a whole lot of zeros to the
improper-style?

Thanks in advance,
Sebastian

Hello fellow lammps-users,

in using the improper style hybrid, i get a reproducible crash as soon as i
set one improper_coeff to none.
The error is:
*** Error in 'lmp_serial': free(): invalid next size (fast):
0x000000000002915460 ***

This does not happen for dihedrals where i disable some interactions.
I reproduced this with lammps versions 23Nov13, 1Feb14 and 16Feb16, with or
without modified Makefiles,
and on different machines. All are running more or less up to date versions
of opensuse.
Any ideas? Any additional infos i can provide?

your description is not quoting the exact syntax, thus it is difficult
to make an accurate assessment.
it is usually beneficial for cases like yours to provide a minimal
(but complete) input deck that reproduces the issue.

And as a general question:
Considering i only have two kinds of improper-interaction (interacting and
non-interacting), is the hybrid+none
way of disabling the impropers i don't want to calculate preferable to just
passing a whole lot of zeros to the
improper-style?

it would be simpler to use wild cards in the improper_coeff command,
e.g for improper style harmonic:

improper_coeff * 0.0 0
improper_coeff 2 100.0 0.0

or even better, simply don't define the impropers that don't create forces.

axel.

Hello fellow lammps-users,

in using the improper style hybrid, i get a reproducible crash as soon as i
set one improper_coeff to none.
The error is:
*** Error in 'lmp_serial': free(): invalid next size (fast):
0x000000000002915460 ***

This does not happen for dihedrals where i disable some interactions.
I reproduced this with lammps versions 23Nov13, 1Feb14 and 16Feb16, with or
without modified Makefiles,
and on different machines. All are running more or less up to date versions
of opensuse.
Any ideas? Any additional infos i can provide?

your description is not quoting the exact syntax, thus it is difficult
to make an accurate assessment.
it is usually beneficial for cases like yours to provide a minimal
(but complete) input deck that reproduces the issue.

My input is as follows:

units real
dimension 3
newton on
boundary f p f

atom_style full
read_data inpgeom
special_bonds amber

improper_style hybrid cvff
improper_coeff 1 cvff 1.1 -1 2
improper_coeff 2 none
pair_style lj/cut/coul/cut 10.0
pair_coeff 1 1 0.015000 2.600713
pair_coeff 1 2 0.035917 3.000891
pair_coeff 2 2 0.086000 3.401070

dump mincust all custom 1 relax.dmp id element xs ys zs
dump_modify mincust element HS H1 HC HA CA C3 OS SH
minimize 1.0e-6 1.0e-6 1000 10000
undump mincust

It works flawlessly when using improper_style none, but as soon as one improper_coeff is none,
it crashes. Should i append the backtrace-informations?

And as a general question:
Considering i only have two kinds of improper-interaction (interacting and
non-interacting), is the hybrid+none
way of disabling the impropers i don't want to calculate preferable to just
passing a whole lot of zeros to the
improper-style?

it would be simpler to use wild cards in the improper_coeff command,
e.g for improper style harmonic:

improper_coeff * 0.0 0
improper_coeff 2 100.0 0.0

or even better, simply don't define the impropers that don't create forces.

axel.

I see, thanks. I just figured deactivating them completely via hybrid would be 'cleaner'.
Don't defining unfortunately creates more work, so i'll go with the former method.

Yours sincerely,
Sebastian

this is useless without the data file.
i cannot reproduce the memory corruption with a very minimal input, so
there seems to be something in your specific system setup that is
contributing to this condition.

axel.

ok, i’ve been able to construct a suitable input to reproduce this issue and then identified the bug and implemented a bugfix. the following one-line change is required to avoid the memory corruption.

diff --git a/src/improper_hybrid.cpp b/src/improper_hybrid.cpp
index 1a2a0bd…2b7d0cd 100644
— a/src/improper_hybrid.cpp
+++ b/src/improper_hybrid.cpp
@@ -76,7 +76,7 @@ void ImproperHybrid::compute(int eflag, int vflag)
for (m = 0; m < nstyles; m++) nimproperlist[m] = 0;
for (i = 0; i < nimproperlist_orig; i++) {
m = map[improperlist_orig[i][4]];

  • nimproperlist[m]++;
  • if (m >= 0) nimproperlist[m]++;
    }
    for (m = 0; m < nstyles; m++) {
    if (nimproperlist[m] > maximproper[m]) {

axel.

Thank you very much!