Skip to content

Python module: segfault on exit when hierarchy iterators are alive #1327

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
klayoutmatthias opened this issue Apr 4, 2023 · 0 comments
Closed
Labels
Milestone

Comments

@klayoutmatthias
Copy link
Collaborator

This code makes Python / klayout module segfault on exit:

import klayout.db as kdb
ly = kdb.Layout()
cell = ly.create_cell("TOP")
parents = cell.each_parent_cell()

Root cause is the Python finalization code which first deletes the Layout and then the iterator pointing to is.

A simple workaround is to make sure the iterator ("parents") is removed before finalization:

import klayout.db as kdb
ly = kdb.Layout()
cell = ly.create_cell("TOP")
parents = cell.each_parent_cell()
...
parents = None
@klayoutmatthias klayoutmatthias added this to the 0.28.7 milestone Apr 4, 2023
klayoutmatthias added a commit that referenced this issue Apr 13, 2023
Issue #1327 fixed (segfault in pymod finalization code)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant