openmopac/mopac

Segfault with symmetry calculations

Closed this issue · 1 comments

SYMMETRY PM7 EPS=78.4 GEO_REF="r-salsolinolium.arc" GEO_DAT="alt-intermediate.mop" CHARGE=1 GEO-OK PRECISE GNORM=0 (or just SYMMETRY GEO_REF="r-salsolinolium.arc" GEO_DAT="alt-intermediate.mop") gives

At line 123 of file /tmp/mop2/mopac/src/input/getsym.F90 (unit = 25, file = '/tmp/gfortrantmp5AcM1r')
Fortran runtime error: Sequential READ or WRITE not allowed after EOF marker, possibly use REWIND or BACKSPACE

Error termination. Backtrace:
#0  0x7fbf7014ebfa
#1  0x7fbf7014f685
#2  0x7fbf7015025b
#3  0x7fbf70387dcd
#4  0x7fbf70589811
#5  0x7fbf70593e1d
#6  0x7fbf7044a047
#7  0x555ab13320a7
#8  0x7fbf6ff90d09
#9  0x555ab13320d9
#10  0xffffffffffffffff

Latest github pull as usual.
To reproduce, one can use https://github.com/openmopac/mopac/files/8936624/saddle-alt.zip
I think I am using the keyword not as intended (with geo_ref and geo_dat), but a meaningful error message would be appopriate

The SYMMETRY keyword is poorly named and might not do what you think it does (see the manual entry), and it doesn't work with GEO_REF. This combination of keywords immediately exits after reporting as much to me on MacOS, but I am getting the same crash as you on Linux. It seems like the parsing of the extra SYMMETRY data block is a bit fragile and needs more error traps, which I have just added and will imminently merge.