Skip to content

Naively implementing Element on arbitrary object causes segfault. #207

Closed
@TimAWescott

Description

@TimAWescott

I don't know if it's possible to build a fence around the underlying problem that kept #143 from being accepted, but I just ran into it, or something that looks like it, while attempting to return an array of structures.

See the example. Basically, I looked at the documentation and did the obvious for SomeStruct and Element, and ended up with a segfault generating machine.

Assuming that the underlying problem that causes a segfault in PyFinalizeEx can't be fixed, it would be nice if the documentation for Element had some verbiage along the lines of "don't do this, you'll be sorry". Better, if it's achievable, would be a way to generate a build-time fault if you try.

Reproducible example:

example.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions