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

GzSpinBox causes the Qt Scene Graph to crash on macOS #542

Closed
srmainwaring opened this issue May 31, 2023 · 2 comments
Closed

GzSpinBox causes the Qt Scene Graph to crash on macOS #542

srmainwaring opened this issue May 31, 2023 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@srmainwaring
Copy link
Contributor

srmainwaring commented May 31, 2023

Environment

  • OS Version: macOS, qt@5 5.15.8_3
  • Source or binary build? either

Description

  • Expected behavior: GUI plugins that use GzSpinBox should work correctly.
  • Actual behavior: The GUI application crashes. The error occurs on the Qt scene graph render thread.

Steps to reproduce

  1. Update and upgrade brew. This will install qt@5 5.15.8_3.
  2. Run gz sim -g shapes.sdf
  3. Open the Component Inspector (if not already opened)

Output

See gazebosim/gz-sim#1987.

The problem appears to be a conflict between QtQuickControls 1.4 and QtQuickControls 2.2. Both versions have a SpinBox but the behaviour is very different. The version in QtQuickControls 2.2 is for integer values only.

The QML documentation suggests an approach to use the controls for floats, but it is badly flawed and will not work for the use cases needed in gz-sim. A reimplementation of a spin box for doubles is needed. Docs and discussion:

This is a serious bug on macOS as it causes an application crash on start up for any of the default examples (because the default gui.config includes the component inspector which indirectly loads the spin box).

Possible approach

One of the answers in the SO article suggests a replacement SpinBox supporting doubles. This is almost a drop-in replacement for GzSpinBox. The branches below make the modifications to gz-gui7 and gz-sim7:

@srmainwaring srmainwaring added the bug Something isn't working label May 31, 2023
@azeey azeey self-assigned this Jul 17, 2023
@azeey azeey moved this to To do in Core development Jul 24, 2023
@azeey
Copy link
Contributor

azeey commented Sep 22, 2023

@srmainwaring I just tested this on an Intel macOS running Monterey, but I'm not getting a segfault at all. The spinbox doesn't seem to work properly (it's blank), but it doesn't crash. qt@5 has been upgraded to 5.15.10. Can you give it another try?

@srmainwaring
Copy link
Contributor Author

Can you give it another try?

@azeey - doing some book-keeping! Not seeing this at all in current Garden and Harmonic running Sonoma on M1 with latest brew - so suspect it was transient.

@github-project-automation github-project-automation bot moved this from To do to Done in Core development Feb 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants