Skip to content

Layout.get_info segfaults on invalid index (python 3.11 module) #1464

Closed

Description

@sebastian-goeldi

If an invalid/non-existent layer index is passed to Layout.get_info(index) klayout segfaults. I would expect it to handle it a bit more graceful, either return None (python case) or throw an exception.

Test case:

>>> import klayout.db as kdb
>>> kdb.__version__
'0.28.11'
>>> ly = kdb.Layout()
>>> layer = ly.layer(1,0)
>>> linfo_valid = ly.get_info(layer)
>>> layer
0
>>> ly.get_info(1)
Segmentation fault (core dumped)

I know this is not a common case, but it should still not seg fault ;).

Activity

  1. added a commit that references this issue on Sep 2, 2023
  2. added this to the 0.28.12 milestone on Sep 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions