Compilation testers needed

Having trouble installing or compiling FreeCAD? Get help here.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
chennes
Veteran
Posts: 3910
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: Compilation testers needed

Post by chennes »

wmayer wrote: Mon Jan 02, 2023 10:05 am at the very end the application must be killed due to some modal dialogs coming from the Addon-Manager unit tests. Here a mechanism must be implemented that the dialog disappear automatically.
I'm working on this (it's an issue on some Linux flavors right now even with Qt5) -- I used a one shot timer to kill the dialogs and set the time too short. I'm going to refactor to use a more flexible approach.
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
wmayer
Founder
Posts: 20309
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Compilation testers needed

Post by wmayer »

I'm working on this (it's an issue on some Linux flavors right now even with Qt5)
That's correct but there is a little difference compared to Qt6. While with Qt5 the unit tests can continue and let the user close the dialogs manually this isn't possible any more with Qt6. The application kind of freezes and when clicking on the X symbol the window manager jumps in after a few seconds asking the user to kill the application.

In case it is of help for you: The PartDesign tests also open some modal dialogs that are closed automatically. You will find the relevant code here: https://github.com/FreeCAD/FreeCAD/blob ... Gui.py#L38
User avatar
chennes
Veteran
Posts: 3910
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: Compilation testers needed

Post by chennes »

Thanks -- I was using a 10ms timer, and I see there we've got a 500ms! In an effort to keep each unit test less than 100ms my new plan is to use a normal (non-oneshot) timer that just checks for the dialog every 10ms for up to a second. My thinking is that will fix both the Qt5 and the Qt6 issue. Though if the tests actually fail and the expected dialog never appears I don't know how to recover in Qt6 then.
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
User avatar
chennes
Veteran
Posts: 3910
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: Compilation testers needed

Post by chennes »

git commit 2f3baa033 changes the Addon Manager GUI test dialog closer to use a repeating timer that runs for up to a second. Can you let me know if this fixes the issue you are seeing with Qt6?
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
wmayer
Founder
Posts: 20309
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Compilation testers needed

Post by wmayer »

chennes wrote: Mon Jan 02, 2023 9:41 pm git commit 2f3baa033 changes the Addon Manager GUI test dialog closer to use a repeating timer that runs for up to a second. Can you let me know if this fixes the issue you are seeing with Qt6?
Sorry, but this doesn't fix it. Actually there are three cascaded dialogs and the top two are not even correctly painted (same as before your change). Here is a screentshot of how it looks:
Addonmanager_Test.png
Addonmanager_Test.png (62.83 KiB) Viewed 1247 times
wmayer
Founder
Posts: 20309
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Compilation testers needed

Post by wmayer »

chennes wrote: Mon Jan 02, 2023 9:41 pm Can you let me know if this fixes the issue you are seeing with Qt6?
Thanks! With your latest changes it works much better now. The tests now all complete and no longer block the application. However, they still don't disappear automatically and the user has to still manually click on the X icon. At least, this won't kill the application any more.

But there is now a regression with Qt5. It shows the problems that the Qt6 build had. In the console I get these warnings:

Code: Select all

Qt has caught an exception thrown from an event handler. Throwing
exceptions from an event handler is not supported in Qt.
You must not let any exception whatsoever propagate through Qt code.
If that is not possible, in Qt 5 you must at least reimplement
QCoreApplication::notify() and catch all exceptions there.
User avatar
chennes
Veteran
Posts: 3910
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: Compilation testers needed

Post by chennes »

I'm testing on Windows, Ubuntu 20.04 LTS, and Ubuntu latest, and am not getting that error with Qt5 :( . I will build Qt6 on one of the Linux systems and see if I can replicate it then.
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
StefanBruens
Posts: 24
Joined: Sun Nov 29, 2020 5:30 am

Re: Compilation testers needed

Post by StefanBruens »

wmayer wrote: Mon Jan 02, 2023 10:05 am
ToDo:
Unfortunately there are still a lot of old-style connects in the code base that won't work any more with Qt6 because signal or slot functions have been renamed or removed. For some reason Qt6 doesn't seem to print any warnings any more if the call of connect() has failed.
Do you have enabled the respective warning category?

https://codebrowser.dev/qt6/qtbase/src/ ... lcConnectv

Code: Select all

export QT_LOGGING_RULES=qt.core.qobject.connect.debug=true
or even

Code: Select all

export QT_LOGGING_RULES=qt.*.debug=true
before running FreeCAD should work.
openBrain
Veteran
Posts: 9041
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: Compilation testers needed

Post by openBrain »

wmayer wrote: Wed Jan 04, 2023 10:10 am

Code: Select all

Qt has caught an exception thrown from an event handler. Throwing
exceptions from an event handler is not supported in Qt.
You must not let any exception whatsoever propagate through Qt code.
If that is not possible, in Qt 5 you must at least reimplement
QCoreApplication::notify() and catch all exceptions there.
@chennes If it may help, below the callstack of the main thread when this message appears :

Code: Select all

#0 __futex_abstimed_wait_common64() at nptl/nptl/futex-internal.c:57
#1 __futex_abstimed_wait_common() at nptl/nptl/futex-internal.c:87
#2 __GI___futex_abstimed_wait_cancelable64() at nptl/nptl/futex-internal.c:139
#3 __pthread_cond_wait_common() at nptl/nptl/pthread_cond_wait.c:503
#4 ___pthread_cond_wait() at nptl/nptl/pthread_cond_wait.c:627
#5 QWaitConditionPrivate::wait() at src/corelib/thread/qwaitcondition_unix.cpp:146
#6 QWaitCondition::wait() at src/corelib/thread/qwaitcondition_unix.cpp:225
#7 QThread::wait() at src/corelib/thread/qmutex.h:270
#8 ??() at /usr/lib/python3/dist-packages/PySide2/QtCore.cpython-310-x86_64-linux-gnu.so
#9 ??() at /lib/x86_64-linux-gnu/libpython3.10.so.1.0
#10 _PyObject_MakeTpCall() at /lib/x86_64-linux-gnu/libpython3.10.so.1.0
#11 _PyEval_EvalFrameDefault() at /lib/x86_64-linux-gnu/libpython3.10.so.1.0
#12 ??() at /lib/x86_64-linux-gnu/libpython3.10.so.1.0
#13 ??() at /lib/x86_64-linux-gnu/libpython3.10.so.1.0
#14 PySide::SignalManager::callPythonMetaMethod(QMetaMethod const&, void**, _object*, bool)() at /lib/x86_64-linux-gnu/libpyside2.cpython-310-x86_64-linux-gnu.so.5.15
#15 PySide::SignalManager::qt_metacall(QObject*, QMetaObject::Call, int, void**)() at /lib/x86_64-linux-gnu/libpyside2.cpython-310-x86_64-linux-gnu.so.5.15
#16 doActivate<false>() at src/corelib/kernel/qobject.cpp:3 912
#17 QMetaObject::activate() at src/corelib/kernel/qobject.cpp:3 946
#18 QDialog::rejected() at src/widgets/.moc/moc_qdialog.cpp:242
#19 QDialogPrivate::finalize() at src/widgets/dialogs/qdialog.cpp:178
#20 doActivate<false>() at src/corelib/kernel/qobject.cpp:3 898
#21 QMetaObject::activate() at src/corelib/kernel/qobject.cpp:3 946
#22 QDialogButtonBox::rejected() at src/widgets/.moc/moc_qdialogbuttonbox.cpp:299
#23 QDialogButtonBoxPrivate::_q_handleButtonClicked() at src/widgets/widgets/qdialogbuttonbox.cpp:882
#24 doActivate<false>() at src/corelib/kernel/qobject.cpp:3 898
#25 QMetaObject::activate() at src/corelib/kernel/qobject.cpp:3 946
#26 QAbstractButton::clicked() at src/widgets/.moc/moc_qabstractbutton.cpp:308
#27 QAbstractButtonPrivate::emitClicked() at src/widgets/widgets/qabstractbutton.cpp:415
#28 QAbstractButton::click() at src/widgets/widgets/qabstractbutton.cpp:904
#29 QAbstractButton::click() at src/widgets/widgets/qabstractbutton.cpp:890
#30 QAbstractButton::qt_metacall() at src/widgets/.moc/moc_qabstractbutton.cpp:265
#31 QPushButton::qt_metacall() at src/widgets/.moc/moc_qpushbutton.cpp:141
#32 doActivate<false>() at src/corelib/kernel/qobject.cpp:3 912
#33 QMetaObject::activate() at src/corelib/kernel/qobject.cpp:3 946
#34 QTimer::timeout() at src/corelib/.moc/moc_qtimer.cpp:205
#35 ??() at /usr/lib/python3/dist-packages/PySide2/QtCore.cpython-310-x86_64-linux-gnu.so
#36 QObject::event() at src/corelib/kernel/qobject.cpp:1 336
#37 ??() at /usr/lib/python3/dist-packages/PySide2/QtCore.cpython-310-x86_64-linux-gnu.so
#38 QApplicationPrivate::notify_helper() at src/widgets/kernel/qapplication.cpp:3 637
#39 Gui::GUIApplication::notify() at /home/ob/dev/FreeCAD/src/Gui/GuiApplication.cpp:85
#40 QCoreApplication::notifyInternal2() at src/corelib/kernel/qcoreapplication.cpp:1 064
#41 QTimerInfoList::activateTimers() at src/corelib/kernel/qtimerinfo_unix.cpp:643
#42 timerSourceDispatch() at src/corelib/kernel/qeventdispatcher_glib.cpp:183
#43 g_main_context_dispatch() at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#44 ??() at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#45 g_main_context_iteration() at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#46 QEventDispatcherGlib::processEvents() at src/corelib/kernel/qeventdispatcher_glib.cpp:423
#47 QCoreApplication::processEvents() at src/corelib/global/qflags.h:69
#48 ??() at /usr/lib/python3/dist-packages/PySide2/QtCore.cpython-310-x86_64-linux-gnu.so
#49 ??() at /lib/x86_64-linux-gnu/libpython3.10.so.1.0
#50 _PyObject_MakeTpCall() at /lib/x86_64-linux-gnu/libpython3.10.so.1.0
#51 _PyEval_EvalFrameDefault() at /lib/x86_64-linux-gnu/libpython3.10.so.1.0
#52 ??() at /lib/x86_64-linux-gnu/libpython3.10.so.1.0
#53 ??() at /lib/x86_64-linux-gnu/libpython3.10.so.1.0
#54 _PyEval_EvalFrameDefault() at /lib/x86_64-linux-gnu/libpython3.10.so.1.0
#55 ??() at /lib/x86_64-linux-gnu/libpython3.10.so.1.0
#56 _PyEval_EvalFrameDefault() at /lib/x86_64-linux-gnu/libpython3.10.so.1.0
#57 ??() at /lib/x86_64-linux-gnu/libpython3.10.so.1.0
#58 ??() at /lib/x86_64-linux-gnu/libpython3.10.so.1.0
#59 _PyEval_EvalFrameDefault() at /lib/x86_64-linux-gnu/libpython3.10.so.1.0
#60 ??() at /lib/x86_64-linux-gnu/libpython3.10.so.1.0
#61 _PyObject_FastCallDictTstate() at /lib/x86_64-linux-gnu/libpython3.10.so.1.0
#62 _PyObject_Call_Prepend() at /lib/x86_64-linux-gnu/libpython3.10.so.1.0
#63 ??() at /lib/x86_64-linux-gnu/libpython3.10.so.1.0
#64 _PyObject_MakeTpCall() at /lib/x86_64-linux-gnu/libpython3.10.so.1.0
#65 _PyEval_EvalFrameDefault() at /lib/x86_64-linux-gnu/libpython3.10.so.1.0
#66 ??() at /lib/x86_64-linux-gnu/libpython3.10.so.1.0
#67 ??() at /lib/x86_64-linux-gnu/libpython3.10.so.1.0
#68 _PyEval_EvalFrameDefault() at /lib/x86_64-linux-gnu/libpython3.10.so.1.0
#69 ??() at /lib/x86_64-linux-gnu/libpython3.10.so.1.0
#70 _PyObject_FastCallDictTstate() at /lib/x86_64-linux-gnu/libpython3.10.so.1.0
#71 _PyObject_Call_Prepend() at /lib/x86_64-linux-gnu/libpython3.10.so.1.0
#72 ??() at /lib/x86_64-linux-gnu/libpython3.10.so.1.0
#73 _PyObject_MakeTpCall() at /lib/x86_64-linux-gnu/libpython3.10.so.1.0
#74 _PyEval_EvalFrameDefault() at /lib/x86_64-linux-gnu/libpython3.10.so.1.0
#75 ??() at /lib/x86_64-linux-gnu/libpython3.10.so.1.0
#76 _PyEval_EvalFrameDefault() at /lib/x86_64-linux-gnu/libpython3.10.so.1.0
#77 ??() at /lib/x86_64-linux-gnu/libpython3.10.so.1.0
#78 _PyEval_EvalFrameDefault() at /lib/x86_64-linux-gnu/libpython3.10.so.1.0
#79 ??() at /lib/x86_64-linux-gnu/libpython3.10.so.1.0
#80 PyEval_EvalCode() at /lib/x86_64-linux-gnu/libpython3.10.so.1.0
#81 ??() at /lib/x86_64-linux-gnu/libpython3.10.so.1.0
#82 PyRun_StringFlags() at /lib/x86_64-linux-gnu/libpython3.10.so.1.0
#83 Base::InterpreterSingleton::runString[abi:cxx11](char const*)() at /home/ob/dev/FreeCAD/src/Base/Interpreter.cpp:240
#84 TestGui::UnitTestDialog::on_startButton_clicked() at /home/ob/dev/FreeCAD/src/Mod/Test/Gui/UnitTestImp.cpp:178
#85 TestGui::UnitTestDialog::qt_static_metacall() at /home/ob/dev/FCBuild/src/Mod/Test/Gui/QtUnitGui_autogen/include/moc_UnitTestImp.cpp:91
#86 TestGui::UnitTestDialog::qt_metacall() at /home/ob/dev/FCBuild/src/Mod/Test/Gui/QtUnitGui_autogen/include/moc_UnitTestImp.cpp:127
#87 doActivate<false>() at src/corelib/kernel/qobject.cpp:3 912
#88 QMetaObject::activate() at src/corelib/kernel/qobject.cpp:3 946
#89 QAbstractButton::clicked() at src/widgets/.moc/moc_qabstractbutton.cpp:308
#90 QAbstractButtonPrivate::emitClicked() at src/widgets/widgets/qabstractbutton.cpp:415
#91 QAbstractButtonPrivate::click() at src/widgets/widgets/qabstractbutton.cpp:408
#92 QAbstractButton::mouseReleaseEvent() at src/widgets/widgets/qabstractbutton.cpp:1 044
#93 QWidget::event() at src/widgets/kernel/qwidget.cpp:9 033
#94 QApplicationPrivate::notify_helper() at src/widgets/kernel/qapplication.cpp:3 637
#95 QApplication::notify() at src/widgets/kernel/qapplication.cpp:3 081
#96 Gui::GUIApplication::notify() at /home/ob/dev/FreeCAD/src/Gui/GuiApplication.cpp:85
#97 QCoreApplication::notifyInternal2() at src/corelib/kernel/qcoreapplication.cpp:1 064
#98 QApplicationPrivate::sendMouseEvent() at src/widgets/kernel/qapplication.cpp:2 619
#99 QWidgetWindow::handleMouseEvent() at src/widgets/kernel/qwidgetwindow.cpp:683
#100 QWidgetWindow::event() at src/widgets/kernel/qwidgetwindow.cpp:300
#101 QApplicationPrivate::notify_helper() at src/widgets/kernel/qapplication.cpp:3 637
#102 Gui::GUIApplication::notify() at /home/ob/dev/FreeCAD/src/Gui/GuiApplication.cpp:85
#103 QCoreApplication::notifyInternal2() at src/corelib/kernel/qcoreapplication.cpp:1 064
#104 QGuiApplicationPrivate::processMouseEvent() at src/gui/kernel/qguiapplication.cpp:2 282
#105 QWindowSystemInterface::sendWindowSystemEvents() at src/gui/kernel/qwindowsysteminterface.cpp:1 169
#106 xcbSourceDispatch() at src/plugins/platforms/xcb/src/plugins/platforms/xcb/qxcbeventdispatcher.cpp:105
#107 g_main_context_dispatch() at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#108 ??() at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#109 g_main_context_iteration() at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#110 QEventDispatcherGlib::processEvents() at src/corelib/kernel/qeventdispatcher_glib.cpp:423
#111 QEventLoop::exec() at src/corelib/global/qflags.h:69
#112 QCoreApplication::exec() at src/corelib/global/qflags.h:121
#113 Gui::Application::runApplication() at /home/ob/dev/FreeCAD/src/Gui/Application.cpp:2 265
#114 main() at /home/ob/dev/FreeCAD/src/Main/MainGui.cpp:270
It looks like a QTimer timeout will trigger some fake click on a RejectRole button on some dialog.
IIRC, this is mechanism used somewhere in your Gui tests. Maybe there are several dialogs open and at some moment the wrong one is targeted. :?
wmayer
Founder
Posts: 20309
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Compilation testers needed

Post by wmayer »

StefanBruens wrote: Tue Jan 10, 2023 11:05 pm Do you have enabled the respective warning category?
No, I didn't know that an environment variable has to be set now. I will try it. Thanks!
Post Reply