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

Segfault on CentOS7 on exit #203

Closed
klayoutmatthias opened this Issue Nov 28, 2018 · 2 comments

Comments

Projects
None yet
1 participant
@klayoutmatthias
Copy link
Collaborator

klayoutmatthias commented Nov 28, 2018

See discussion here: https://www.klayout.de/forum/discussion/comment/4820

Apparently the following happens:

  • KLayout will destroy all top level widgets on exit
  • But the QMultiInputContext plugin registers it's own QMenu (a top level widget)
  • When KLayout exists and the plugin tries to delete it's QMenu, a double delete happens and the segfault occurs.

Solution: KLayout should only delete those top level widgets it actually owns. This is difficult however, as these Widgets may be created from Ruby which shuts down after the application object has been destroyed.

@klayoutmatthias

This comment has been minimized.

Copy link
Collaborator Author

klayoutmatthias commented Nov 28, 2018

This is the code that creates the issue (layApplication.cc: 1476++):

  QWidgetList tl_widgets = topLevelWidgets ();
  for (QWidgetList::iterator w = tl_widgets.begin (); w != tl_widgets.end (); ++w) {
    delete *w;
  }

It is supposed to prevent the following issue:

1.) Open KLayout, run Macro Development IDE
2.) Enter: RBA::QPushButton::new("Push me").show
3.) A button appears
4.) Close KLayout without hitting the button -> segfault

The proposed fix is to delete top level widgets only if created by Ruby.

klayoutmatthias added a commit that referenced this issue Nov 28, 2018

@klayoutmatthias

This comment has been minimized.

Copy link
Collaborator Author

klayoutmatthias commented Nov 28, 2018

Fixed with the above commit. Will be released with the next minor release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment