openmopac/mopac

Segfault on INDO calculation

Closed this issue · 4 comments

Describe the bug

forrtl: severe (174): SIGSEGV, segmentation fault occurred
Image PC Routine Line Source
libmopac.so.1 00007FD16C637B69 for__signal_handl Unknown Unknown
libc.so.6 00007FD16B1EF520 Unknown Unknown Unknown
libmopac.so.1 00007FD16B6B4C40 scfmat_ Unknown Unknown
libmopac.so.1 00007FD16B749A13 iter_ Unknown Unknown
libmopac.so.1 00007FD16B6936F9 compfg_ Unknown Unknown
libmopac.so.1 00007FD16B668F8D run_mopac_ Unknown Unknown
mopac 0000000000401320 Unknown Unknown Unknown
mopac 00000000004012B2 Unknown Unknown Unknown
libc.so.6 00007FD16B1D6D90 Unknown Unknown Unknown
libc.so.6 00007FD16B1D6E40 __libc_start_main Unknown Unknown
mopac 00000000004011BE Unknown Unknown Unknown

To Reproduce
I'm running INDO calculation on system with 300 - 500 atoms. I have successfully run on below ~350 atoms. Above that, I started to see the segfault immediately after execute the mopac operation.

MOPAC executable

  • Using pre-built executable
  • Compiled my own executable

Operating system

  • Linux
  • Mac
  • Windows
  • Other (specify below)

Additional context
Add any other context about the problem here. (e.g. Linux distribution if that might be relevant)

As a preliminary note, I have reproduced this INDO problem with random large molecules that I have lying around, so it does appear to be generic and only dependent on the size of the molecule.

I am now having a hard time reproducing this problem in a debug setting that would allow me to fix it. I reproduce your crash with the pre-built executable on Mac, but I don't get a crash with the pre-built executable on Linux. I don't get crashes on either OS with debug flags. Could you provide some examples, so that I can check if they crash on my Linux test environment?

While it isn't impossible to fix this without debug flags, it is much less efficient. More information may help me narrow this down faster.

Thanks for looking into this. These are some of the samples: samples.zip. I am able to run on a somewhat small molecule (AAA.mop). I got segfault for the rest of the samples.

Unfortunately, I lost track of this issue last year (got sick & took a long vacation right after), and I'm trying to clean up the list of issues right now.

On further inspection, these are probably out-of-memory crashes. I get crashes on the larger examples in restricted-memory environments, but they are running (slowly) in environments with a large amount of memory. The larger examples here are using over 3 GB of memory. You can reduce the size of the problem by restricting the set of active orbitals in the excitation space using the MAXCI or C.A.S. keywords. Please feel free to reactivate this issue if you are still getting crashes even when the memory usage is reduced or you are in a large-memory environment.

There isn't really a graceful way to handle out-of-memory errors in Fortran unless the program is made aware of the memory limits in advance. MOPAC has sensible defaults and barriers to prevent extremely large amounts of memory from being used, but large CI calculations can get very memory intensive.