dgasmith / gau2grid

Fast computation of a gaussian and its derivative on a grid.
https://gau2grid.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
29 stars 15 forks source link

Crash in scf-property psi4 test when using 2.0 gau2grid with psi4 originally built against 1.3.x #57

Closed mbanck closed 5 years ago

mbanck commented 5 years ago

I got a bug report from the automatic testing infrastructure about psi4 and gau2grid, see https://ci.debian.net/data/autopkgtest/testing/amd64/p/psi4/3146850/log.gz

It seems psi4 crashed in libgg if it was originally built against 1.3.1 but is now dynamically linked to 2.0. This is possible as the SONAME did not change and might hint at the fact that it should have been changed?

Here is the backtrace:

    Nuclear repulsion energy..........................................PASSED
    SCF energy........................................................PASSED
    SCF DIPOLE X......................................................PASSED
    SCF DIPOLE Y......................................................PASSED
    SCF DIPOLE Z......................................................PASSED
    SCF QUADRUPOLE XX.................................................PASSED
    SCF QUADRUPOLE YY.................................................PASSED
    SCF QUADRUPOLE ZZ.................................................PASSED
    SCF QUADRUPOLE XY.................................................PASSED
    SCF QUADRUPOLE XZ.................................................PASSED
    SCF QUADRUPOLE YZ.................................................PASSED

Program received signal SIGSEGV, Segmentation fault.
gg_collocation_L0_deriv1 (npoints=npoints@entry=63, xyz=0x1c15630, xyz_stride=29971088, nprim=30494448, coeffs=0x1, exponents=0x1279180, center=0xee0ec0, order=14698288, phi_out=0x0, phi_x_out=0x1b171a0, 
    phi_y_out=0x1b62200, phi_z_out=0x1b6ea10) at ./obj-x86_64-linux-gnu/gau2grid_deriv1.c:80
80  ./obj-x86_64-linux-gnu/gau2grid_deriv1.c: No such file or directory.
(gdb) bt
#0  gg_collocation_L0_deriv1 (npoints=npoints@entry=63, xyz=0x1c15630, xyz_stride=29971088, nprim=30494448, coeffs=0x1, exponents=0x1279180, center=0xee0ec0, order=14698288, phi_out=0x0, phi_x_out=0x1b171a0, 
    phi_y_out=0x1b62200, phi_z_out=0x1b6ea10) at ./obj-x86_64-linux-gnu/gau2grid_deriv1.c:80
#1  0x00007ffff59447c0 in gg_collocation_deriv1 (L=L@entry=0, npoints=npoints@entry=63, xyz=xyz@entry=0x1c15630, xyz_stride=xyz_stride@entry=29971088, nprim=nprim@entry=30494448, coeffs=<optimized out>, 
    exponents=<optimized out>, center=<optimized out>, order=<optimized out>, phi_out=<optimized out>, phi_x_out=<optimized out>, phi_y_out=<optimized out>, phi_z_out=0x1b6ea10)
    at ./obj-x86_64-linux-gnu/gau2grid_helper.c:86
#2  0x00007ffff6f2ab7b in psi::BasisFunctions::compute_functions (this=0x1a76f10, block=...) at /build/psi4-3cv7JI/psi4-1.2.1/psi4/src/psi4/libfock/points.cc:705
#3  0x00007ffff6f2cf90 in psi::UKSFunctions::compute_points (this=this@entry=0x1a76f10, block=std::shared_ptr<class psi::BlockOPoints> (use count 4, weak count 0) = {...})
    at /usr/include/c++/8/ext/atomicity.h:96
#4  0x00007ffff6f6cd0d in psi::UV::compute_V (this=0x12dd250, ret=std::vector of length 2, capacity 2 = {...}) at /usr/include/c++/8/bits/shared_ptr.h:129
#5  0x00007ffff6e882ae in psi::scf::UHF::form_V (this=0x1463560) at /usr/include/c++/8/ext/atomicity.h:98
#6  0x00007ffff6e8d657 in psi::scf::UHF::form_G (this=0x1463560) at /build/psi4-3cv7JI/psi4-1.2.1/psi4/src/psi4/libscf_solver/uhf.cc:181
#7  0x00007ffff6e5b016 in psi::scf::HF::iterations (this=0x1463560) at /build/psi4-3cv7JI/psi4-1.2.1/psi4/src/psi4/libscf_solver/hf.cc:1645
#8  0x00007ffff6e50a09 in psi::scf::HF::compute_energy (this=0x1463560) at /build/psi4-3cv7JI/psi4-1.2.1/psi4/src/psi4/libscf_solver/hf.cc:490
#9  0x00007ffff635a75e in pybind11::cpp_function::cpp_function<double, psi::Wavefunction, , pybind11::name, pybind11::is_method, pybind11::sibling, char [41]>(double (psi::Wavefunction::*)(), pybind11::name const&, pybind11::is_method const&, pybind11::sibling const&, char const (&) [41])::{lambda(psi::Wavefunction*)#1}::operator()(psi::Wavefunction*) const (this=<optimized out>, this=<optimized out>, 
    c=<optimized out>) at /usr/include/pybind11/pybind11.h:72

The last lines in output.dat are:

  ==> DiskJK: Disk-Based J/K Matrices <==

    J tasked:                  Yes
    K tasked:                  Yes
    wK tasked:                  No
    Memory (MB):               375
    Schwarz Cutoff:          1E-12

    OpenMP threads:              1

  Minimum eigenvalue in the overlap matrix is 2.6982852745E-02.
  Using Symmetric Orthogonalization.

  SCF Guess: Generalized Wolfsberg-Helmholtz.

  ==> Iterations <==

                        Total Energy        Delta E     RMS |[F,P]|

This is with gau2grid 2.0.1, I just saw that 2.0.3 got released and I am going to upload it to Debian right now, but I assume chances are slim that it would be fixed by that?

dgasmith commented 5 years ago

1.x has a different API/ABI compared to 2.x. The Psi4 pin for old gau2grid must be less than 2.

mbanck commented 5 years ago

Then 2.x should ship a different library as well, like libgg.so.2 - SOVERSION is still 1 as was the case with 1.3.x

loriab commented 5 years ago

I can't recite the SONAME rules, but a bump to 2 sounds right to me. We can mint a v2.0.4