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

Gui: Segfault on closing a document in Qt 6 #14189

Open
2 tasks done
pieterhijma opened this issue May 21, 2024 · 1 comment · May be fixed by #14423
Open
2 tasks done

Gui: Segfault on closing a document in Qt 6 #14189

pieterhijma opened this issue May 21, 2024 · 1 comment · May be fixed by #14423
Labels
3rd party: Qt 6 Issue related to Qt 6 Bug This issue or PR is related to a bug Core Issue or PR touches core sections (App, Gui, Base) of FreeCAD

Comments

@pieterhijma
Copy link
Contributor

Is there an existing issue for this?

  • I have searched the existing issues

Problem description

In Qt 6, an assertion fails when closing a document causing FreeCAD to deliberately segfault. To reproduce:

  • Open FreeCAD
  • Open a new empty document
  • Close the document

This behavior is not present in Qt 5.

The assertion:

ASSERT failure in QOpenGLWidget: "Called object is not of the correct type (class destructor may have already run)", file /usr/include/qt6/QtCore/qobjectdefs_impl.h, line 129

Stacktrace:

#0  0x00007ffff04a8e44 in ??? () at /usr/lib/libc.so.6
#1  0x00007ffff0450a30 in raise () at /usr/lib/libc.so.6
#2  0x00007ffff04384c3 in abort () at /usr/lib/libc.so.6
#3  0x00007ffff678af93 in messageHandler (type=QtFatalMsg, context=..., msg=...) at /home/pieter/freecad-add-prop-varset/src/Gui/Application.cpp:1804
#4  0x00007ffff0adae34 in ??? () at /usr/lib/libQt6Core.so.6
#5  0x00007ffff0adaf80 in ??? () at /usr/lib/libQt6Core.so.6
#6  0x00007ffff0a8ce27 in QMessageLogger::fatal(char const*, ...) const () at /usr/lib/libQt6Core.so.6
#7  0x00007ffff0a8ceda in qt_assert_x(char const*, char const*, char const*, int) () at /usr/lib/libQt6Core.so.6
#8  0x00007ffff6edb9c8 in QtPrivate::assertObjectType<CustomGLWidget> (o=0x555559315dd0) at /usr/include/qt6/QtCore/qobjectdefs_impl.h:129
#9  0x00007ffff6edb3d6 in QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, void (CustomGLWidget::*)()>::call(void (CustomGLWidget::*)(), CustomGLWidget*, void**) (f=(void (CustomGLWidget::*)(CustomGLWidget * const)) 0x7ffff6ed9356 <CustomGLWidget::aboutToDestroyGLContext()>, o=0x555559315dd0, arg=0x7fffffffbf18) at /usr/include/qt6/QtCore/qobjectdefs_impl.h:144
#10 0x00007ffff6edab82 in QtPrivate::FunctionPointer<void (CustomGLWidget::*)()>::call<QtPrivate::List<>, void>(void (CustomGLWidget::*)(), CustomGLWidget*, void**) (f=(void (CustomGLWidget::*)(CustomGLWidget * const)) 0x7ffff6ed9356 <CustomGLWidget::aboutToDestroyGLContext()>, o=0x555559315dd0, arg=0x7fffffffbf18) at /usr/include/qt6/QtCore/qobjectdefs_impl.h:182
#11 0x00007ffff6eda639 in QtPrivate::QCallableObject<void (CustomGLWidget::*)(), QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) (which=1, this_=0x555555cc8f40, r=0x555559315dd0, a=0x7fffffffbf18, ret=0x0) at /usr/include/qt6/QtCore/qobjectdefs_impl.h:553
#12 0x00007ffff0b9b57f in ??? () at /usr/lib/libQt6Core.so.6
#13 0x00007ffff1497753 in QOpenGLContext::destroy() () at /usr/lib/libQt6Gui.so.6
#14 0x00007ffff14979bf in QOpenGLContext::~QOpenGLContext() () at /usr/lib/libQt6Gui.so.6
#15 0x00007ffff534030b in ??? () at /usr/lib/libQt6OpenGLWidgets.so.6
#16 0x00007ffff53403ad in QOpenGLWidget::~QOpenGLWidget() () at /usr/lib/libQt6OpenGLWidgets.so.6
#17 0x00007ffff6ed91be in CustomGLWidget::~CustomGLWidget (this=0x555559315dd0, __in_chrg=<optimized out>) at /home/pieter/freecad-add-prop-varset/src/Gui/Quarter/QuarterWidget.cpp:169
#18 0x00007ffff6ed91e0 in CustomGLWidget::~CustomGLWidget (this=0x555559315dd0, __in_chrg=<optimized out>) at /home/pieter/freecad-add-prop-varset/src/Gui/Quarter/QuarterWidget.cpp:169
#19 0x00007ffff0b8a39b in QObjectPrivate::deleteChildren() () at /usr/lib/libQt6Core.so.6
#20 0x00007ffff1b31709 in QWidget::~QWidget() () at /usr/lib/libQt6Widgets.so.6
#21 0x00007ffff6ed6284 in SIM::Coin3D::Quarter::QuarterWidget::~QuarterWidget (this=0x555557ff6a40, __in_chrg=<optimized out>) at /home/pieter/freecad-add-prop-varset/src/Gui/Quarter/QuarterWidget.cpp:356
#22 0x00007ffff6ee1723 in SIM::Coin3D::Quarter::SoQTQuarterAdaptor::~SoQTQuarterAdaptor (this=0x555557ff6a40, __in_chrg=<optimized out>) at /home/pieter/freecad-add-prop-varset/src/Gui/Quarter/SoQTQuarterAdaptor.cpp:182
#23 0x00007ffff6f31c6b in Gui::View3DInventorViewer::~View3DInventorViewer (this=0x555557ff6a40, __in_chrg=<optimized out>) at /home/pieter/freecad-add-prop-varset/src/Gui/View3DInventorViewer.cpp:638
#24 0x00007ffff6f31cb4 in Gui::View3DInventorViewer::~View3DInventorViewer (this=0x555557ff6a40, __in_chrg=<optimized out>) at /home/pieter/freecad-add-prop-varset/src/Gui/View3DInventorViewer.cpp:638
#25 0x00007ffff6f2615e in Gui::View3DInventor::~View3DInventor (this=0x555559268230, __in_chrg=<optimized out>) at /home/pieter/freecad-add-prop-varset/src/Gui/View3DInventor.cpp:174
#26 0x00007ffff6f261d4 in Gui::View3DInventor::~View3DInventor (this=0x555559268230, __in_chrg=<optimized out>) at /home/pieter/freecad-add-prop-varset/src/Gui/View3DInventor.cpp:175
#27 0x00007ffff0b8bf1c in QObject::event(QEvent*) () at /usr/lib/libQt6Core.so.6
#28 0x00007ffff1afc44d in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib/libQt6Widgets.so.6
#29 0x00007ffff6933112 in Gui::GUIApplication::notify (this=0x7fffffffced0, receiver=0x555559268230, event=0x555559317fe0) at /home/pieter/freecad-add-prop-varset/src/Gui/GuiApplication.cpp:83
#30 0x00007ffff0b3fe18 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib/libQt6Core.so.6
#31 0x00007ffff0b401d2 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () at /usr/lib/libQt6Core.so.6
#32 0x00007ffff0d959ac in ??? () at /usr/lib/libQt6Core.so.6
#33 0x00007fffed90ea89 in ??? () at /usr/lib/libglib-2.0.so.0
#34 0x00007fffed9709b7 in ??? () at /usr/lib/libglib-2.0.so.0
#35 0x00007fffed90df95 in g_main_context_iteration () at /usr/lib/libglib-2.0.so.0
#36 0x00007ffff0d93389 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/libQt6Core.so.6
#37 0x00007ffff0b48350 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/libQt6Core.so.6
#38 0x00007ffff0b43c1d in QCoreApplication::exec() () at /usr/lib/libQt6Core.so.6
#39 0x00007ffff678be50 in (anonymous namespace)::tryRunEventLoop (mainApp=...) at /home/pieter/freecad-add-prop-varset/src/Gui/Application.cpp:2042
#40 0x00007ffff678c19b in (anonymous namespace)::runEventLoop (mainApp=...) at /home/pieter/freecad-add-prop-varset/src/Gui/Application.cpp:2062
#41 0x00007ffff678c554 in Gui::Application::runApplication () at /home/pieter/freecad-add-prop-varset/src/Gui/Application.cpp:2139
#42 0x000055555557a579 in main (argc=1, argv=0x7fffffffd6b8) at /home/pieter/freecad-add-prop-varset/src/Main/MainGui.cpp:278

Full version info

OS: Arch Linux
Word size of FreeCAD: 64-bit
Version: 0.22.0dev.37438 (Git)
Build type: DEBUG
Branch: main
Hash: 58083879b765846daaeab4fdb125e418138e5874
Python 3.12.3, Qt 6.7.0, Coin 4.0.2, Vtk , OCC 7.7.2
Locale: English/United States (en_US)
Installed mods: 
  * OpenTheme 2024.5.16

Subproject(s) affected?

Core

Anything else?

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@maxwxyz
Copy link
Collaborator

maxwxyz commented May 21, 2024

Related: #13303

@maxwxyz maxwxyz added Bug This issue or PR is related to a bug Core Issue or PR touches core sections (App, Gui, Base) of FreeCAD 3rd party: Qt 6 Issue related to Qt 6 labels May 21, 2024
xtemp09 added a commit to xtemp09/FreeCAD that referenced this issue Jun 1, 2024
Closes FreeCAD#14189. This commit partially reverts
fb37201 and
d15c7d0.
@xtemp09 xtemp09 linked a pull request Jun 1, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3rd party: Qt 6 Issue related to Qt 6 Bug This issue or PR is related to a bug Core Issue or PR touches core sections (App, Gui, Base) of FreeCAD
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants