Crash changing a LayerPropertiesNode

edited June 2010 in KLayout Development
When I run the following routine where view is LayoutView

def change_layer_properties_node( view, gds_layer, name )
properties_iterator = view.begin_layers
while properties_iterator != view.end_layers
properties = properties_iterator.current
if properties.source_layer( true ) == gds_layer
new_properties = properties.dup
new_properties.name = name
RBA::MessageBox::info( "Layer Info","Changine #{properties.name} to #{name}", RBA::MessageBox::b_ok )

view.set_layer_properties( properties_iterator, new_properties )
end
properties_iterator = properties_iterator.next
end
end

I crash if I take out the MessageBox line. If I click really quickly on the OK in the message box I will crash after just changing 3 or 4 layer names. However if I click slowly, I can get through my entire list. When I crash (under OS X 10.6.4) I get the following message

/Applications/klayout.app/Contents/MacOS/klayout -rm hello_world.rb
./hello_world.rb:46: [BUG] Segmentation fault
ruby 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0]

Abort trap

I am running KLayout 0.20.2

Oliver

Comments

  • edited November -1

    Hi Oliver,

    I tried to reproduce the problem on Ubuntu but have not been successful to do so.

    As a wild guess, I'd try to stray in calls to "view.update_content" because that should synchronize all the internal states. I'd try to insert at least one call after "set_layer_properties".

    Are you able to create a stack trace and send that to me via the email address listed on the contacts page?

    Best regards,

    Matthias

  • edited November -1
    I am having trouble reproducing it this evening. When it happens again, I will send more debug info.

    BTW I tried the update_content and that did not help this weekend.

    Oliver
  • edited November -1

    Hi Oliver,

    I'll look at the stack trace if you happen to get one. I don't have experience with the OS X version myself but so far I felt there is no much difference between Linux and OS X.

    Your descriptions indicates that it might be a problem with the asynchronous drawing thread. If you put KLayout into the synchronous mode (use -x on the command line), there is no such thread and that should avoid the problem, although that's not a real solution ...

    Best regards,

    Matthias

Sign In or Register to comment.