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: Crash on Python Console autocompletion Qt6/Pyside6 #14101

Open
2 tasks done
pieterhijma opened this issue May 17, 2024 · 4 comments
Open
2 tasks done

Gui: Crash on Python Console autocompletion Qt6/Pyside6 #14101

pieterhijma opened this issue May 17, 2024 · 4 comments
Labels
3rd party: Qt 6 Issue related to Qt 6 Bug This issue or PR is related to a bug Coding: Python Coding issue related to Python 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

The autocompletion popup in the Python console causes a segfault with PySide6/Qt6.

To reproduce, type the following in the Python console:

from PySide import QtNetwork
QtNetwork.QNetworkRequest.

On typing the ., the console tries to show a popup with autocompletion, but it crashes before it can do that:

Stacktrace:

#0  /usr/lib/libc.so.6(+0x3cae0) [0x7a1d61250ae0]
#1  /usr/lib/libpython3.12.so.1.0(PyFrame_GetCode+0x4) [0x7a1d63e6ec14]
#2  /usr/lib/libshiboken6.cpython-312-x86_64-linux-gnu.so.6.7(+0x32656) [0x7a1d63bc0656]
#3  /usr/lib/libshiboken6.cpython-312-x86_64-linux-gnu.so.6.7(mangled_type_getattro+0x135) [0x7a1d63bc0a15]
#4  /usr/lib/libpython3.12.so.1.0(PyObject_GetAttrString+0xb3) [0x7a1d63dad623]
#5  0x7a1d6757747a in Py::Object::getAttr(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const from /home/pieter/build-freecad-main-debug/lib/libFreeCADGui.so+0x36
#6  0x7a1d67b125c5 in Gui::CallTipsList::extractTipsFromObject(Py::Object&, Py::List&, QMap<QString, Gui::CallTip>&) const from /home/pieter/build-freecad-main-debug/lib/libFreeCADGui.so+0xf3
#7  0x7a1d67b12159 in Gui::CallTipsList::extractTips(QString const&) const from /home/pieter/build-freecad-main-debug/lib/libFreeCADGui.so+0xb4f
#8  0x7a1d67b13f2a in Gui::CallTipsList::showTips(QString const&) from /home/pieter/build-freecad-main-debug/lib/libFreeCADGui.so+0x70e
#9  0x7a1d67b26c79 in Gui::PythonConsole::keyPressEvent(QKeyEvent*) from /home/pieter/build-freecad-main-debug/lib/libFreeCADGui.so+0x62f
#10  0x7a1d6294950e in QWidget::event(QEvent*) from /usr/lib/libQt6Widgets.so.6+0x62e
#11  0x7a1d629dbf6a in QFrame::event(QEvent*) from /usr/lib/libQt6Widgets.so.6+0x3a
#12  0x7a1d628fc44d in QApplicationPrivate::notify_helper(QObject*, QEvent*) from /usr/lib/libQt6Widgets.so.6+0x4d
#13  0x7a1d6290187b in QApplication::notify(QObject*, QEvent*) from /usr/lib/libQt6Widgets.so.6+0x124b
#14  0x7a1d677196c4 in Gui::GUIApplication::notify(QObject*, QEvent*) from /home/pieter/build-freecad-main-debug/lib/libFreeCADGui.so+0x114
#15  0x7a1d6193fe18 in QCoreApplication::notifyInternal2(QObject*, QEvent*) from /usr/lib/libQt6Core.so.6+0x158
#16  /usr/lib/libQt6Widgets.so.6(+0x160336) [0x7a1d62960336]
#17  0x7a1d628fc44d in QApplicationPrivate::notify_helper(QObject*, QEvent*) from /usr/lib/libQt6Widgets.so.6+0x4d
#18  0x7a1d677196c4 in Gui::GUIApplication::notify(QObject*, QEvent*) from /home/pieter/build-freecad-main-debug/lib/libFreeCADGui.so+0x114
#19  0x7a1d6193fe18 in QCoreApplication::notifyInternal2(QObject*, QEvent*) from /usr/lib/libQt6Core.so.6+0x158
#20  0x7a1d61f77a30 in QGuiApplicationPrivate::processKeyEvent(QWindowSystemInterfacePrivate::KeyEvent*) from /usr/lib/libQt6Gui.so.6+0x330
#21  0x7a1d61fe8dcc in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) from /usr/lib/libQt6Gui.so.6+0x2ac
#22  /usr/lib/qt6/plugins/platforms/../../../libQt6XcbQpa.so.6(+0x4dcb7) [0x7a1d5d07ccb7]
#23  /usr/lib/libglib-2.0.so.0(+0x5ca89) [0x7a1d5e70ea89]
#24  /usr/lib/libglib-2.0.so.0(+0xbe9b7) [0x7a1d5e7709b7]
#25  /usr/lib/libglib-2.0.so.0(g_main_context_iteration+0x35) [0x7a1d5e70df95]
#26  0x7a1d61b93389 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) from /usr/lib/libQt6Core.so.6+0x89
#27  0x7a1d61948350 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) from /usr/lib/libQt6Core.so.6+0x1b0
#28  0x7a1d61943c1d in QCoreApplication::exec() from /usr/lib/libQt6Core.so.6+0x8d
#29  /home/pieter/build-freecad-main-debug/lib/libFreeCADGui.so(+0x1372470) [0x7a1d67572470]
#30  /home/pieter/build-freecad-main-debug/lib/libFreeCADGui.so(+0x13727bb) [0x7a1d675727bb]
#31  0x7a1d67572b74 in Gui::Application::runApplication() from /home/pieter/build-freecad-main-debug/lib/libFreeCADGui.so+0x22e
#32  ./bin/FreeCAD(+0x26579) [0x607c1498b579]
#33  /usr/lib/libc.so.6(+0x25c88) [0x7a1d61239c88]
#34  /usr/lib/libc.so.6(__libc_start_main+0x8c) [0x7a1d61239d4c]
#35  ./bin/FreeCAD(+0x25745) [0x607c1498a745]

Full version info

OS: Arch Linux
Word size of FreeCAD: 64-bit
Version: 0.22.0dev.37347 (Git)
Build type: DEBUG
Branch: main
Hash: 18c85a58aeb0fa9d69fae1b70de85d7fff9e0eb3
Python 3.12.3, Qt 6.7.0, Coin 4.0.2, Vtk , OCC 7.7.2
Locale: English/United States (en_US)

Subproject(s) affected?

Other (specify in description)

Anything else?

This seems related: #10974

Code of Conduct

  • I agree to follow this project's Code of Conduct
@pieterhijma
Copy link
Contributor Author

@chennes, we briefly discussed this and mentioned you had a Qt debug compilation, so let's hope you can reproduce this.

@maxwxyz
Copy link
Collaborator

maxwxyz commented May 17, 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 Coding: Python Coding issue related to Python 3rd party: Qt 6 Issue related to Qt 6 labels May 17, 2024
@pieterhijma
Copy link
Contributor Author

Yes, I think so.

@wwmayer
Copy link
Contributor

wwmayer commented May 22, 2024

Looking at the stack trace this doesn't look like it's related to Qt6 but rather to Python 3.12.

It perfectly works with

OS: Ubuntu 22.04.4 LTS (XFCE/xubuntu)
Word size of FreeCAD: 64-bit
Version: 0.22.0dev.37369 (Git)
Build type: Release
Branch: main
Hash: f814ef63aa6dce9067b507da3fc34c8cc017d882
Python 3.10.12, Qt 6.2.4, Coin 4.0.0, Vtk 7.1.1, OCC 7.5.1
Locale: German/Germany (de_DE)

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 Coding: Python Coding issue related to Python Core Issue or PR touches core sections (App, Gui, Base) of FreeCAD
Projects
None yet
Development

No branches or pull requests

3 participants