Segmentation fault - C++ Power of Troy

Hey folks, I’ve got a segmentation fault error when running my code for the Power of Troy exercise. I’ve looked around on forums but I’m struggling to understand what it might mean. Does anyone have any pointers (no pun intended)?

The compiler output is:

make[2]: *** [CMakeFiles/test_power-of-troy.dir/build.make:70: CMakeFiles/test_power-of-troy] Segmentation fault (core dumped)
make[1]: *** [CMakeFiles/Makefile2:122: CMakeFiles/test_power-of-troy.dir/all] Error 2
make: *** [Makefile:91: all] Error 2

I initially compiled the code successfully but it didn’t pass all of the tests because I was initialising the smart pointers too early - which meant that an initialised human instance/object did not return a nullptr for human.possession, human.own_power and human.influenced_by (hope that makes sense!?).

Wrote the following code and got the segmentation error:

[header file]

struct human {
    std::unique_ptr<artifact> possession;
    std::shared_ptr<power> own_power;
    std::shared_ptr<power> influenced_by;
};
[.cpp file]

void give_new_artifact(human& human, std::string new_artifact) {

    human.possession = std::make_unique<artifact>(artifact{new_artifact});  

}

void manifest_power(human& human, std::string new_power) {

    human.own_power = std::make_shared<power>(power{new_power});

}

void use_power(human& caster, human& target) {

    auto power_impact = caster.own_power->effect;
    target.influenced_by = std::make_shared<power>(power{power_impact});
  
}