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

Crash using background fill symbol in Ubuntu #51513

Closed
1 of 2 tasks
Kaemer1645 opened this issue Jan 19, 2023 · 2 comments
Closed
1 of 2 tasks

Crash using background fill symbol in Ubuntu #51513

Kaemer1645 opened this issue Jan 19, 2023 · 2 comments
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Crash/Data Corruption PyQGIS Related to the PyQGIS API

Comments

@Kaemer1645
Copy link

What is the bug or the crash?

The crash happened when I use QgsTextBackgroundSettings.fillSymbol() python command.

This is the error message:

QGIS died on signal 11[New LWP 59102]
[New LWP 59103]
[New LWP 59104]
[New LWP 59105]
[New LWP 59107]
[New LWP 59109]
[New LWP 59110]
[New LWP 59111]
[New LWP 59112]
[New LWP 59114]
[New LWP 59118]
[New LWP 59121]
[New LWP 59130]
[New LWP 59145]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
0x00007f95accf849f in __GI___wait4 (pid=59159, stat_loc=0x562770e600ec, options=0, usage=0x0) at ../sysdeps/unix/sysv/linux/wait4.c:30
30 ../sysdeps/unix/sysv/linux/wait4.c: No such file or directory.
[Current thread is 1 (Thread 0x7f959991b240 (LWP 59098))]
#0 0x00007f95accf849f in __GI___wait4 (pid=59159, stat_loc=0x562770e600ec, options=0, usage=0x0) at ../sysdeps/unix/sysv/linux/wait4.c:30
sc_ret = -512
sc_cancel_oldtype = 0
#1 0x000056276c4d2a7c in ()
#2 0x00007f95acc50520 in () at /lib/x86_64-linux-gnu/libc.so.6
#3 __pthread_kill_implementation (no_tid=0, signo=11, threadid=140280503317056) at ./nptl/pthread_kill.c:44
tid =
ret = 0
pd = 0x7f959991b240
old_mask = {__val = {140277891095632, 2451, 5415323478377983999, 140278387127280, 513, 24, 94558943120320, 0, 140278352472546, 4, 11, 24, 140280503314720, 0, 140278352472546, 140278351322501}}
ret =
#4 __pthread_kill_internal (signo=11, threadid=140280503317056) at ./nptl/pthread_kill.c:78
#5 __GI___pthread_kill (threadid=140280503317056, signo=signo@entry=11) at ./nptl/pthread_kill.c:89
#6 0x00007f95acc50476 in __GI_raise (sig=11) at ../sysdeps/posix/raise.c:26
ret =
#7 0x00007f95acc50520 in () at /lib/x86_64-linux-gnu/libc.so.6
#8 0x00007f95adb92617 in QgsTextBackgroundSettings::fillSymbol() const () at /lib/libqgis_core.so.3.28.2
#9 0x00007f9514b75547 in () at /usr/lib/python3/dist-packages/qgis/_core.cpython-310-x86_64-linux-gnu.so
#10 0x00007f95193516b8 in () at /lib/x86_64-linux-gnu/libpython3.10.so.1.0
#11 0x00007f951930c1ac in _PyObject_MakeTpCall () at /lib/x86_64-linux-gnu/libpython3.10.so.1.0
#12 0x00007f95192a1a0c in _PyEval_EvalFrameDefault () at /lib/x86_64-linux-gnu/libpython3.10.so.1.0
#13 0x00007f95193ec81f in () at /lib/x86_64-linux-gnu/libpython3.10.so.1.0
#14 0x00007f951929feee in _PyEval_EvalFrameDefault () at /lib/x86_64-linux-gnu/libpython3.10.so.1.0
#15 0x00007f95193ec81f in () at /lib/x86_64-linux-gnu/libpython3.10.so.1.0
#16 0x00007f951929feee in _PyEval_EvalFrameDefault () at /lib/x86_64-linux-gnu/libpython3.10.so.1.0
#17 0x00007f95193ec81f in () at /lib/x86_64-linux-gnu/libpython3.10.so.1.0
#18 0x00007f951930d618 in () at /lib/x86_64-linux-gnu/libpython3.10.so.1.0
#19 0x00007f95192a19b8 in _PyEval_EvalFrameDefault () at /lib/x86_64-linux-gnu/libpython3.10.so.1.0
#20 0x00007f95193ec81f in () at /lib/x86_64-linux-gnu/libpython3.10.so.1.0
#21 0x00007f951930d598 in () at /lib/x86_64-linux-gnu/libpython3.10.so.1.0
#22 0x00007f9519131ba0 in () at /usr/lib/python3/dist-packages/PyQt5/QtCore.abi3.so
#23 0x00007f95191355ae in () at /usr/lib/python3/dist-packages/PyQt5/QtCore.abi3.so
#24 0x00007f95af3f64e5 in () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#25 0x00007f95affea696 in QGroupBox::toggled(bool) () at /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#26 0x00007f95affeb43b in QGroupBox::setChecked(bool) () at /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#27 0x00007f95affeb485 in () at /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#28 0x00007f95affeb720 in QGroupBox::mouseReleaseEvent(QMouseEvent*) () at /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#29 0x00007f9518319ae3 in sipQgsCollapsibleGroupBox::mouseReleaseEvent(QMouseEvent*) () at /usr/lib/python3/dist-packages/qgis/_gui.cpython-310-x86_64-linux-gnu.so
#30 0x00007f95afef14ee in QWidget::event(QEvent*) () at /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#31 0x00007f95affebba9 in QGroupBox::event(QEvent*) () at /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#32 0x00007f95183196e3 in sipQgsCollapsibleGroupBox::event(QEvent*) () at /usr/lib/python3/dist-packages/qgis/_gui.cpython-310-x86_64-linux-gnu.so
#33 0x00007f95afeae713 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#34 0x00007f95afeb6364 in QApplication::notify(QObject*, QEvent*) () at /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#35 0x00007f95adbd95a3 in QgsApplication::notify(QObject*, QEvent*) () at /lib/libqgis_core.so.3.28.2
#36 0x00007f95af3bee3a in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#37 0x00007f95afeb4e47 in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer&, bool, bool) () at /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#38 0x00007f95aff0ad40 in () at /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#39 0x00007f95aff0dfd5 in () at /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#40 0x00007f95afeae713 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#41 0x00007f95adbd95a3 in QgsApplication::notify(QObject*, QEvent*) () at /lib/libqgis_core.so.3.28.2
#42 0x00007f95af3bee3a in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#43 0x00007f95af7a5307 in QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*) () at /lib/x86_64-linux-gnu/libQt5Gui.so.5
#44 0x00007f95af77aa2c in QWindowSystemInterface::sendWindowSystemEvents(QFlagsQEventLoop::ProcessEventsFlag) () at /lib/x86_64-linux-gnu/libQt5Gui.so.5
#45 0x00007f958fef5d6e in () at /lib/x86_64-linux-gnu/libQt5XcbQpa.so.5
#46 0x00007f95a5310d3b in g_main_context_dispatch () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#47 0x00007f95a53656c8 in () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#48 0x00007f95a530e3e3 in g_main_context_iteration () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#49 0x00007f95af4180b8 in QEventDispatcherGlib::processEvents(QFlagsQEventLoop::ProcessEventsFlag) () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#50 0x00007f95af3bd75b in QEventLoop::exec(QFlagsQEventLoop::ProcessEventsFlag) () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#51 0x00007f95af3c5cf4 in QCoreApplication::exec() () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#52 0x000056276c4cf2df in ()
#53 0x00007f95acc37d90 in __libc_start_call_main (main=main@entry=0x56276c4cc960, argc=argc@entry=1, argv=argv@entry=0x7fffc0bdc268) at ../sysdeps/nptl/libc_start_call_main.h:58
self =
result =
unwind_buf = {cancel_jmp_buf = {{jmp_buf = {0, -3688092470276969511, 140736427049576, 94727320684896, 94727321027064, 140280919650368, 3688098500729056217, 3745335686942895065}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x56276c521008, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 1817317384}}}
not_first_call =
#54 0x00007f95acc37e40 in __libc_start_main_impl (main=0x56276c4cc960, argc=1, argv=0x7fffc0bdc268, init=, fini=, rtld_fini=, stack_end=0x7fffc0bdc258) at ../csu/libc-start.c:392
#55 0x000056276c4d1c85 in ()
[Inferior 1 (process 59098) detached]
gdb returned 0
Aborted (core dumped)

Steps to reproduce the issue

Use this code.

lyr = iface.activeLayer()
labeling = lyr.labeling()
settings = labeling.settings()
background = settings.format().background()
symbols = background.fillSymbol().symbolLayers()

Versions

Ubuntu 22.04.1 LTS jammy

QGIS version
3.28.2-Firenze
QGIS code revision
b47e00b
Qt version
5.15.3
Python version
3.10.6
GDAL/OGR version
3.4.1
PROJ version
8.2.1
EPSG Registry database version
v10.041 (2021-12-03)
GEOS version
3.10.2-CAPI-1.16.0
SQLite version
3.37.2
PDAL version
2.3.0
PostgreSQL client version
unknown
SpatiaLite version
5.0.1
QWT version
6.1.4
QScintilla2 version
2.11.6
OS version
Ubuntu 22.04.1 LTS

Active Python plugins
QMapa
2.0.0
plugin_reloader
0.9.2
sagaprovider
2.12.99
db_manager
0.1.20
MetaSearch
0.3.6
processing
2.12.99
grassprovider
2.12.99

Supported QGIS version

  • I'm running a supported QGIS version according to the roadmap.

New profile

  • I tried with a new QGIS profile

Additional context

I tried to check this issue using Ubuntu 22.10 kinetic and I got the same error.

@Kaemer1645 Kaemer1645 added the Bug Either a bug report, or a bug fix. Let's hope for the latter! label Jan 19, 2023
@nicogodet
Copy link
Member

Confirmed on Windows too

@nicogodet nicogodet added PyQGIS Related to the PyQGIS API Crash/Data Corruption labels Jan 19, 2023
@nyalldawson
Copy link
Collaborator

Change your code to something like this:

text_format = settings.format()
background = text_format.background()
background_fill_symbol = background.fillSymbol()
symbols = background_fill_symbol.symbolLayers()

The Python garbage collector is cleaning up the underlying c++ objects too aggressively -- if you store them in variables then you can prevent this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Crash/Data Corruption PyQGIS Related to the PyQGIS API
Projects
None yet
Development

No branches or pull requests

3 participants