Skip to content
This repository was archived by the owner on Feb 26, 2025. It is now read-only.
This repository was archived by the owner on Feb 26, 2025. It is now read-only.

Lifetime issues with mut.Morphology constructing sections with raw pointers to itself #161

@mgeplf

Description

@mgeplf

Constructs like this:
Section(this, _counter, section_) (where this is mut::Morphology` - from)

This means that a raw pointer is stored here that has a different lifetime than Morphology.

This causes a use after free if the Morphology is dtor'd before the sections that have been created are removed, for example:

from morphio.mut import Morphology
m = Morphology('simple.swc')
s = m.root_sections[0]
del m # ~mut.Morphology() called
print(s.children) # use after free

Note, this is different than #29

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