Segmentation fault when accessing uninitialised members/properties of derived type
Apologies for the bad title, it's hard to explain. Key context is this comment: !24 (comment 1692876430). Searching for "seg fault" in tests/test-data/derived_type/test_module.py will show where the error is hit.
In short, when we have a derived type as an attribute, if we try and access that attribute before the attribute has been set, we can get a segmentation fault and Python crashes. I think the segmentation fault makes sense because we're trying to access a null pointer or an unassigned bit of memory, but I'm not really sure.
To close this issue
- Investigate what is causing this segmentation fault
- Decide whether we can somehow catch/prevent this error
- If we can, catch the error
- If we can't, put a note in the code about how this error can come up and what the solution can be (if we can't catch the error, I'm not sure we can do better than this)