Psi4 crashes (Abort trap signal) with no information

I am trying to use Psi4 to do some optimization but I am running into errors with no helpful information to debug. I installed Psi4 through Conda (version 1.4a2.dev138+aa2bb28, py36hbc5f0ab_0 from psi4/label/dev). Files are listed below

Input file:

molecule { 
-1 1
N    1.105000    0.080000   -0.002000
O    0.484000   -0.993000   -0.081000
O    0.484000    1.153000    0.078000
O    2.347000    0.080000   -0.002000
}
set {
g_convergence GAU_LOOSE
geom_maxiter 5
}
memory 700MB
set_num_threads(1)
psi4_io.set_default_path("/scratch365/mquevill/psi4_scrdir")
for _ in range(1):
try:
  optimize('wb97x-d/6-31G*')
  break
except OptimizationConvergenceError:
  try:
    set opt_coordinates cartesian
    optimize('wb97x-d/6-31G*')
    break
  except OptimizationConvergenceError:
    pass
clean()

Command and error:

$ psi4 no3-opt_psi4.dat no3-opt.log
Performing finite difference calculations
 13 displacements needed ... 1 2 3 4 5 6 7 8 9 10 11 12 13
forrtl: error (76): Abort trap signal
Image              PC                Routine            Line        Source             
libgdma.so         00007F56AB33710F  for__signal_handl     Unknown  Unknown
libpthread-2.17.s  00007F56B6B18630  Unknown               Unknown  Unknown
libc-2.17.so       00007F56B6771387  gsignal               Unknown  Unknown
libc-2.17.so       00007F56B6772A78  abort                 Unknown  Unknown
core.cpython-36m-  00007F56AD8670D7  Unknown               Unknown  Unknown
core.cpython-36m-  00007F56ABEF49CD  Unknown               Unknown  Unknown
core.cpython-36m-  00007F56ABF138A1  Unknown               Unknown  Unknown
core.cpython-36m-  00007F56ABF31EDD  Unknown               Unknown  Unknown
python3.6          000055917B836E24  _PyCFunction_Fast     Unknown  Unknown
python3.6          000055917B8C564C  Unknown               Unknown  Unknown
python3.6          000055917B8E818A  _PyEval_EvalFrame     Unknown  Unknown
python3.6          000055917B893256  Unknown               Unknown  Unknown
python3.6          000055917B894231  Unknown               Unknown  Unknown
python3.6          000055917B8C5725  Unknown               Unknown  Unknown
python3.6          000055917B8E818A  _PyEval_EvalFrame     Unknown  Unknown
python3.6          000055917B8984F9  PyEval_EvalCodeEx     Unknown  Unknown
python3.6          000055917B89929C  PyEval_EvalCode       Unknown  Unknown
python3.6          000055917B93A8B4  Unknown               Unknown  Unknown
python3.6          000055917B93A94D  PyRun_StringFlags     Unknown  Unknown
python3.6          000055917B8E5B7E  Unknown               Unknown  Unknown
python3.6          000055917B836D61  _PyCFunction_Fast     Unknown  Unknown
python3.6          000055917B8C564C  Unknown               Unknown  Unknown
python3.6          000055917B8E818A  _PyEval_EvalFrame     Unknown  Unknown
python3.6          000055917B8984F9  PyEval_EvalCodeEx     Unknown  Unknown
python3.6          000055917B89929C  PyEval_EvalCode       Unknown  Unknown
python3.6          000055917B93A8B4  Unknown               Unknown  Unknown
python3.6          000055917B93ACB1  PyRun_FileExFlags     Unknown  Unknown
python3.6          000055917B93AEB3  PyRun_SimpleFileE     Unknown  Unknown
python3.6          000055917B93EA06  Py_Main               Unknown  Unknown
python3.6          000055917B80818E  main                  Unknown  Unknown
libc-2.17.so       00007F56B675D555  __libc_start_main     Unknown  Unknown
python3.6          000055917B8EEC82  Unknown               Unknown  Unknown

Output file (truncated):

...
Previous optimization step data not found.  Starting new optimization.

---Fragment 1 Intrafragment Coordinates---
 - Coordinate -           - BOHR/RAD -       - ANG/DEG -
 R(1,2)           =         2.347532           1.242260
 R(1,3)           =         2.347653           1.242324
 R(1,4)           =         2.347040           1.242000
 B(2,1,3)         =         2.094667         120.015552
 B(2,1,4)         =         2.094274         119.993065
 B(3,1,4)         =         2.094244         119.991362

Current energy   :      -280.2487067777

Generating empirical Hessian (Schlegel '84) for each fragment.
Taking RFO optimization step.
Going to follow RFO solution 1.
Using RFO vector 1.

Determining step-restricting scale parameter for RS-RFO.
Maximum step size allowed    0.50000

 Iter      |step|        alpha        rfo_root  
------------------------------------------------
    0     0.66575       1.00000           1
    1     0.54726       1.80933           1
    2     0.50579       2.25324           1
    3     0.50011       2.32363           1
    4     0.50000       2.32497           1
------------------------------------------------
Norm of target step-size    0.50000
Projected energy change by RFO approximation:        -0.1112436336

Back-transformation to cartesian coordinates...
Could not converge backtransformation.
Using first guess instead.

--- Internal Coordinate Step in ANG or DEG, aJ/ANG or AJ/DEG ---
 ---------------------------------------------------------------------------
   Coordinate                Previous        Force       Change         New 
   ----------                --------       ------       ------       ------
    1 R(1,2)          =      1.242260     0.155155   385.014962   386.257222
    2 R(1,3)          =      1.242324     0.154889   385.008267   386.250591
    3 R(1,4)          =      1.242000     0.157965   385.011927   386.253927
    4 B(2,1,3)        =    120.015552     0.013136  -119.667709     0.347843
    5 B(2,1,4)        =    119.993065     0.013156  -119.645236     0.347829
    6 B(3,1,4)        =    119.991362     0.013156  -119.643524     0.347838

I’m not seeing an obvious issue, so I suggest you simplify the input file until you stop encountering the error. Then add the lines back in and see if you can reproduce the error again. Then let us know what lines in the input file are responsible for the error!

In particular, it is extremely important to know whether you changing the threading or setting the default type is necessary to encounter the bug. Also try removing the -D from the functional. I have a vague recollection of the -D causing problems in some cases.

It seems that the problem here was calling optimize() before set opt_coordinates cartesian was causing the issue. The setup of this input file assumed that optimize() would throw an OptimizationConvergenceError, but caused a segfault instead.

The optimization completed properly after adjusting this (even with keeping -D in the functional).

I’m glad your optimization works now, but it’s disturbing that you even got a segmentation fault. I’ve managed to simplify the input file a bit, and I’m getting the same segmentation fault, even on the developer’s version of Psi4. I’ll figure out what line is causing the issue and then add this to our list of bugs, so that hopefully somebody can fix it. Thanks for the report!