Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Warning: acros/: Fatal IO error: client killed

Hi,

I 've created the following function, which create layouts:

def createLayoutView(mode=1, tech='', cell_name='myCell') :
    cellview = pya.Application.instance().main_window().create_layout(tech, mode)

    active_layout = pya.CellView().active().layout()
    cell = active_layout.create_cell(cell_name)

    pya.CellView().active().cell = pya.CellView().active().layout().top_cell()
# createLayoutView

The layout created by this function works fine when I instantiate in it a pcell from the "Basic" library, but if I try to instantiate a pcell from my custom 'myLib' library, then the KLayout crashes with the following error:

Warning: acros/: Fatal IO error: client killed

If the layout is created by hand (File -> New Layout -> ...) I can instantiate my pcells from "myLib" as expected.

I feel that may be a KLayout check somewhere, that it isn't satisfied with something in this function and causes the crash, or layouts created this way need something more to accept other than 'Basic' library pcells. Currently, I don't have any other info to provide.

I'm using the latest 0.25.9 release.

Chris

Comments

  • Hi Chris,

    the function can be written a bit shorter, but basically it's correct. There isn't much difference between what you do and what the internal function does.

    I suspect that maybe the problem is related to your library, specifically technology association. Is your library associated with a technology and is that the technology you use for "tech"?

    Matthias

  • Hi Matthias,

    Currently, I haven't associated my PCell library with a technology, I want to finish every flow without tech-dependencies. The "tech" argument is for future reference and implementation. As documentation mentions:

    If the technology name is not a valid technology name, the default technology will be used.

    I do some digging in my code also, and I think that with this way may some exceptions not triggered, leading KLayout to crash - not hundred percent sure for this yet, or if that is even possible. I have to continue debugging my code, although, it doesn't feel right because the same implementation works fine when the layout is created by hand.

    Side question: What is the main difference between the LayoutView.create_layout() and the above way MainWindow.create_layout(). For test purposes I tried to use this method too, unsuccessfully though.

  • edited July 3

    I think that I was able to confirm that really that was the case. Surprisingly, Error Handling do not work if the layout is created by code. A "workaround" that seems to work for now is to add finally keyword:

    try:
     ...
    except:
     ...
    finally:
     pass
    

    I'm not sure what is causing the crash but I think that it should be reviewed in the future.

    Chris

  • edited July 3

    Hi Chris,

    thanks for this information. Where precisely do you need to set the try/except bracket? I can investigate then whether and why exceptions have negative effects.

    Regards,

    Matthias

  • The simplest function that also helped me find this issue is the following:

    def is_number(item) :
        ''' Description:
        Checks if the given 'item' represents a number.
        ---
        returns: Boolean status [True|False]
        '''
        try:
            float(item)
            return True
        except :
            pass
        #finally:
        #   pass
        # try
    
        try:
            unicodedata.numeric(item)
            return True
        except :
            pass
        #finally:
        #   pass
        # try
    
        return False
    # is_number
    

    Try to reproduce it by calling this function, nested from an other, from inside of coerce_parameters_impl. Please note that, if you create the layout by hand, KLayout crash will will not happen.

    Chris

Sign In or Register to comment.