hybrid/overlay segmentation fault with nb3b/harmonic

Just wanted to report that I’m getting a segmentation fault when trying to use the new nb3b/harmonic in hybrid overlay. I’m using it in combination with buck/coul/long , I can provide the script just didn’t want to clutter this message.

I’m using the Ubuntu repository LAMMPS 12 Aug 2013 version and receiving the following:

[DellVostro-V131:08638] *** Process received signal ***
[DellVostro-V131:08638] Signal: Segmentation fault (11)
[DellVostro-V131:08638] Signal code: Address not mapped (1)
[DellVostro-V131:08638] Failing at address: (nil)
[DellVostro-V131:08638] [ 0] /lib/x86_64-linux-gnu/libpthread.so.0(+0xfcb0) [0x7f4cb04b6cb0]
[DellVostro-V131:08638] [ 1] /lib/x86_64-linux-gnu/libc.so.6(fgets+0x1e) [0x7f4cb0156fee]
[DellVostro-V131:08638] [ 2] lammps-daily(_ZN9LAMMPS_NS16PairNb3bHarmonic9read_fileEPc+0x4ee) [0xdccb5e]
[DellVostro-V131:08638] [ 3] lammps-daily(_ZN9LAMMPS_NS16PairNb3bHarmonic5coeffEiPPc+0x1fe) [0xdcd29e]
[DellVostro-V131:08638] [ 4] lammps-daily(_ZN9LAMMPS_NS17PairHybridOverlay5coeffEiPPc+0x1a4) [0xa9ffe4]
[DellVostro-V131:08638] [ 5] lammps-daily(_ZN9LAMMPS_NS5Input15execute_commandEv+0xc1e) [0x810b7e]
[DellVostro-V131:08638] [ 6] lammps-daily(_ZN9LAMMPS_NS5Input4fileEv+0x2c2) [0x811802]
[DellVostro-V131:08638] [ 7] lammps-daily(main+0x49) [0x521aa9]
[DellVostro-V131:08638] [ 8] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xed) [0x7f4cb010976d]
[DellVostro-V131:08638] [ 9] lammps-daily() [0x525851]
[DellVostro-V131:08638] *** End of error message ***
Segmentation fault (core dumped)

Just wanted to report that I'm getting a segmentation fault when trying to
use the new nb3b/harmonic in hybrid overlay. I'm using it in combination
with buck/coul/long , I can provide the script just didn't want to clutter
this message.

if you reduce your input to the absolute minimum that is required to
reproduce the segfault, then it is no clutter, but would be required
to track this down. alternatively, you can change an input that is
bundled with LAMMPS and post the modification.

axel.

Just wanted to report that I'm getting a segmentation fault when trying to
use the new nb3b/harmonic in hybrid overlay. I'm using it in combination
with buck/coul/long , I can provide the script just didn't want to clutter
this message.

if you reduce your input to the absolute minimum that is required to
reproduce the segfault, then it is no clutter, but would be required
to track this down. alternatively, you can change an input that is
bundled with LAMMPS and post the modification.

no more need. the segfault has no relation to hybrid/overlay but is a
genuine bug in nb3b/harmonic, which - incidentally - i am to blame
for.

here is the fix:

diff --git a/src/USER-MISC/pair_nb3b_harmonic.cpp b/src/USER-MISC/pair_nb3b_harm
index bc3953f..db1e816 100644
--- a/src/USER-MISC/pair_nb3b_harmonic.cpp
+++ b/src/USER-MISC/pair_nb3b_harmonic.cpp
@@ -326,7 +326,7 @@ void PairNb3bHarmonic::read_file(char *file)

   FILE *fp = NULL;
   if (comm->me == 0) {
- FILE *fp = open_potential(file);
+ fp = open_potential(file);
     if (fp == NULL) {
       char str[128];
       sprintf(str,"Cannot open nb3b/harmonic potential file %s",file);

axel.

Axel,

Thanks for the fix!

-Stefan

will be in next patch … thanks

Steve