FreeCAD crashes when changing colors

I asked this question already in the FreeCAD forum (FreeCAD forum thread), but I was told to place it here.

I’m using the FreeCAD version from the official repo. When I try to change a color (menu: edit - preferences/settings then display - colors: click on any color button) , the app crashes everytime:

Program received signal SIGSEGV, Segmentation fault.
#0  /usr/lib/libc.so.6(+0x3cda0) [0x7fd220b4bda0]
#1  /usr/lib/libgtk-3.so.0(+0x1163dc) [0x7fd21a24c3dc]
#2  /usr/lib/libgtk-3.so.0(+0x12e034) [0x7fd21a264034]
#3  /usr/lib/libgtk-3.so.0(+0x11ff15) [0x7fd21a255f15]
#4  /usr/lib/libgobject-2.0.so.0(g_type_create_instance+0x203) [0x7fd219f75833]
#5  /usr/lib/libgobject-2.0.so.0(+0x212f6) [0x7fd219f5d2f6]
#6  /usr/lib/libgobject-2.0.so.0(g_object_new_with_properties+0x2cd) [0x7fd219f5e32d]
#7  /usr/lib/libgobject-2.0.so.0(g_object_new+0xc2) [0x7fd219f5ed12]
#8  /usr/lib/libgtk-3.so.0(+0x329dcf) [0x7fd21a45fdcf]
#9  /usr/lib/libgobject-2.0.so.0(g_type_create_instance+0x203) [0x7fd219f75833]
#10  /usr/lib/libgobject-2.0.so.0(+0x212f6) [0x7fd219f5d2f6]
#11  /usr/lib/libgobject-2.0.so.0(g_object_new_valist+0x16b) [0x7fd219f5e78b]
#12  /usr/lib/libgobject-2.0.so.0(g_object_new+0x9a) [0x7fd219f5ecea]
#13  0x7fd21aa80f9c in QGtk3ColorDialogHelper::QGtk3ColorDialogHelper() from /usr/lib/qt/plugins/platformthemes/libqgnomeplatformtheme.so+0x5c
#14  0x7fd21aa7e9e7 in QGnomePlatformTheme::createPlatformDialogHelper(QPlatformTheme::DialogType) const from /usr/lib/qt/plugins/platformthemes/libqgnomeplatformtheme.so+0x47
#15  0x7fd221ecd586 in QDialogPrivate::platformHelper() const from /usr/lib/libQt5Widgets.so.5+0x96
#16  /usr/lib/libQt5Widgets.so.5(+0x370ff4) [0x7fd221ec9ff4]
#17  0x7fd2236e8082 in Gui::ColorButton::onChooseColor() from /usr/lib/freecad/lib/libFreeCADGui.so+0x62
#18  /usr/lib/libQt5Core.so.5(+0x2fa96b) [0x7fd22120696b]
#19  0x7fd221dad927 in QAbstractButton::clicked(bool) from /usr/lib/libQt5Widgets.so.5+0x47
#20  /usr/lib/libQt5Widgets.so.5(+0x254bd0) [0x7fd221dadbd0]
#21  /usr/lib/libQt5Widgets.so.5(+0x256868) [0x7fd221daf868]
#22  0x7fd221dafa99 in QAbstractButton::mouseReleaseEvent(QMouseEvent*) from /usr/lib/libQt5Widgets.so.5+0xf9
#23  0x7fd221cf7fce in QWidget::event(QEvent*) from /usr/lib/libQt5Widgets.so.5+0x20e
#24  0x7fd221cb3ff6 in QApplicationPrivate::notify_helper(QObject*, QEvent*) from /usr/lib/libQt5Widgets.so.5+0x86
#25  0x7fd221cbbe59 in QApplication::notify(QObject*, QEvent*) from /usr/lib/libQt5Widgets.so.5+0xaa9
#26  0x7fd2232a0af9 in Gui::GUIApplication::notify(QObject*, QEvent*) from /usr/lib/freecad/lib/libFreeCADGui.so+0x89
#27  0x7fd2211cf20a in QCoreApplication::notifyInternal2(QObject*, QEvent*) from /usr/lib/libQt5Core.so.5+0x13a
#28  0x7fd221cba8ff in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool, bool) from /usr/lib/libQt5Widgets.so.5+0x1bf
#29  /usr/lib/libQt5Widgets.so.5(+0x1b8e98) [0x7fd221d11e98]
#30  /usr/lib/libQt5Widgets.so.5(+0x1bc215) [0x7fd221d15215]
#31  0x7fd221cb3ff6 in QApplicationPrivate::notify_helper(QObject*, QEvent*) from /usr/lib/libQt5Widgets.so.5+0x86
#32  0x7fd2232a0af9 in Gui::GUIApplication::notify(QObject*, QEvent*) from /usr/lib/freecad/lib/libFreeCADGui.so+0x89
#33  0x7fd2211cf20a in QCoreApplication::notifyInternal2(QObject*, QEvent*) from /usr/lib/libQt5Core.so.5+0x13a
#34  0x7fd2215afc50 in QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*) from /usr/lib/libQt5Gui.so.5+0x6b0
#35  0x7fd221584b15 in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) from /usr/lib/libQt5Gui.so.5+0xb5
#36  /usr/lib/libQt5XcbQpa.so.5(+0x63800) [0x7fd21b65f800]
#37  /usr/lib/libglib-2.0.so.0(g_main_context_dispatch+0x26c) [0x7fd21ef1f4dc]
#38  /usr/lib/libglib-2.0.so.0(+0xa8799) [0x7fd21ef73799]
#39  /usr/lib/libglib-2.0.so.0(g_main_context_iteration+0x31) [0x7fd21ef1cbc1]
#40  0x7fd221228b2a in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) from /usr/lib/libQt5Core.so.5+0x6a
#41  0x7fd2211cdabb in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) from /usr/lib/libQt5Core.so.5+0x12b
#42  0x7fd221eceb0e in QDialog::exec() from /usr/lib/libQt5Widgets.so.5+0x20e
#43  0x7fd22330aa97 in StdCmdDlgPreferences::activated(int) from /usr/lib/freecad/lib/libFreeCADGui.so+0x37
#44  0x7fd2232d5be1 in Gui::Command::invoke(int, Gui::Command::TriggerSource) from /usr/lib/freecad/lib/libFreeCADGui.so+0x371
#45  /usr/lib/libQt5Core.so.5(+0x2fa96b) [0x7fd22120696b]
#46  0x7fd221cad237 in QAction::triggered(bool) from /usr/lib/libQt5Widgets.so.5+0x47
#47  0x7fd221cb0060 in QAction::activate(QAction::ActionEvent) from /usr/lib/libQt5Widgets.so.5+0xb0
#48  /usr/lib/libQt5Widgets.so.5(+0x2e8733) [0x7fd221e41733]
#49  /usr/lib/libQt5Widgets.so.5(+0x2f05c1) [0x7fd221e495c1]
#50  0x7fd221cf7fce in QWidget::event(QEvent*) from /usr/lib/libQt5Widgets.so.5+0x20e
#51  0x7fd221cb3ff6 in QApplicationPrivate::notify_helper(QObject*, QEvent*) from /usr/lib/libQt5Widgets.so.5+0x86
#52  0x7fd221cbbe59 in QApplication::notify(QObject*, QEvent*) from /usr/lib/libQt5Widgets.so.5+0xaa9
#53  0x7fd2232a0af9 in Gui::GUIApplication::notify(QObject*, QEvent*) from /usr/lib/freecad/lib/libFreeCADGui.so+0x89
#54  0x7fd2211cf20a in QCoreApplication::notifyInternal2(QObject*, QEvent*) from /usr/lib/libQt5Core.so.5+0x13a
#55  0x7fd221cba8ff in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool, bool) from /usr/lib/libQt5Widgets.so.5+0x1bf
#56  /usr/lib/libQt5Widgets.so.5(+0x1b99b3) [0x7fd221d129b3]
#57  /usr/lib/libQt5Widgets.so.5(+0x1bc215) [0x7fd221d15215]
#58  0x7fd221cb3ff6 in QApplicationPrivate::notify_helper(QObject*, QEvent*) from /usr/lib/libQt5Widgets.so.5+0x86
#59  0x7fd2232a0af9 in Gui::GUIApplication::notify(QObject*, QEvent*) from /usr/lib/freecad/lib/libFreeCADGui.so+0x89
#60  0x7fd2211cf20a in QCoreApplication::notifyInternal2(QObject*, QEvent*) from /usr/lib/libQt5Core.so.5+0x13a
#61  0x7fd2215afc50 in QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*) from /usr/lib/libQt5Gui.so.5+0x6b0
#62  0x7fd221584b15 in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) from /usr/lib/libQt5Gui.so.5+0xb5
#63  /usr/lib/libQt5XcbQpa.so.5(+0x63800) [0x7fd21b65f800]
#64  /usr/lib/libglib-2.0.so.0(g_main_context_dispatch+0x26c) [0x7fd21ef1f4dc]
#65  /usr/lib/libglib-2.0.so.0(+0xa8799) [0x7fd21ef73799]
#66  /usr/lib/libglib-2.0.so.0(g_main_context_iteration+0x31) [0x7fd21ef1cbc1]
#67  0x7fd221228b2a in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) from /usr/lib/libQt5Core.so.5+0x6a
#68  0x7fd2211cdabb in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) from /usr/lib/libQt5Core.so.5+0x12b
#69  0x7fd2211d62a8 in QCoreApplication::exec() from /usr/lib/libQt5Core.so.5+0x98
#70  0x7fd2231f286e in Gui::Application::runApplication() from /usr/lib/freecad/lib/libFreeCADGui.so+0x1b9e
#71  freecad(+0x4858) [0x55e50a42c858]
#72  /usr/lib/libc.so.6(__libc_start_main+0xd5) [0x7fd220b36b25]
#73  freecad(+0x4b8e) [0x55e50a42cb8e]

This is not a new bug. I had this error also with the second last version. When I use the snap version, the color change works as expected.

Is there anything I can do to fix this?

When it’s working with the snap version - use this one!

You’re right: I’m currently using the snap version, but I would like to use the official repo version.

If the version from the repo doesn’t work, wouldn’t it be better to remove it from the repo?

Only, if there would be no chance it’s getting fixed. Usually, this is only a question of time, but for now I would recommend to use the snap version and to check from time to time if an updated repo version appears.

I checked the last 3 versions: no change regarding this bug.

Since I don’t know if this problem is Manjaro or FreeCAD related, I just want to address it to inform the devs about it.

There is a new version in unstable. You could temperary switch branches, test it and then decide if you want to stay on unstable and use it, or to switch back and wait until it’s reaching your current branch. Certainly, I don’t know if the fresher version solves your specific issue.

I also have FreeCAD (0.19.2-8) from the official repo installed, but it does not have the ‘settings’ step described above. Rather it goes directly from ‘preferences’ to ‘display’. In any case, when I click on a color button it does not crash and seems to be working.
(Kernel 5.15.7, Intel internal GPU, Enlightenment).

It could be that the issue is related to the used display server. You could try to change to X11.

Mine works under both X11 and Wayland. In the OP’s error messages I notice references to GTK3. Mine is dependent on QT5. So the problem may be with GTK3 or Gnome??.

I’m already using X11 but I haven’t tried wayland.

Stable branch, kernel 5.15.7, Intel internal GPU, Gnome

Just checked it: the error is also with Wayland