Skip to content
This repository was archived by the owner on Jan 15, 2026. It is now read-only.
This repository was archived by the owner on Jan 15, 2026. It is now read-only.

Segfault with bad values of max_radial/max_angular #393

Description

@Luthaf

Another discovery by @bananenpampe. The following code segfaults:

from rascal.representations import SphericalInvariants

hypers = {
    "soap_type": "PowerSpectrum",
    "interaction_cutoff": 3,
    "radial_basis": "GTO",
    "max_radial": 0,
    "max_angular": 9,
    "gaussian_sigma_constant": 0.3,
    "gaussian_sigma_type": "Constant",
    "cutoff_function_type": "ShiftedCosine",
    "cutoff_smooth_width": 0.5,
    "normalize": True,
}

soap = SphericalInvariants(**hypers)

I think this should throw an error instead!


Other invalid combinations:

max_radial max_angular expected actual
1 0 OK OK
0 1 Error segfault
0 0 Error segfault
0 -1 Error segfault
1 -1 Error segfault
1 -3 Error std::bad_alloc
-1 1 Error std::bad_alloc

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions