Skip to content

Avoid segfault when accessing dangling Python objects #136

@lcpt

Description

@lcpt

The problem goes as follows:

  • You put some XC nodes or elements or anything like that in a Python list node_list= [n1, n2, n3, n4]
  • For whatever reason, the node n3 must be removed from the model, so the C++ counterpart of the n3 Python object is deleted. The n3 Python object and the third item of the node_list list become dangling references.
  • Any attempt to access either n3 or node_list[2] results in a segmentation fault condition and the program crashes.

Maybe there is a way of informing boost.python about the deletion of the C++ objects, so n3 and node_list[2] can return None.

To look into:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions