Skip to content
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 · 3 comments
Closed

Segfault on CentOS7 on exit #203

klayoutmatthias opened this issue Nov 28, 2018 · 3 comments

Comments

@klayoutmatthias
Copy link
Collaborator

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
Copy link
Collaborator Author

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
Copy link
Collaborator Author

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

@catrlica
Copy link

I have install 0.28.5 and I get this error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants