Bug report #8760

Custom Form from .ui File crashes QGIS on Ubuntu

Added by Akbar Gumbira about 6 years ago. Updated 9 months ago.

Status:Closed
Priority:High
Assignee:-
Category:Forms
Affected QGIS version:2.18.7 Regression?:Yes
Operating System:Ubuntu Easy fix?:No
Pull Request or Patch supplied:No Resolution:no timely feedback
Crashes QGIS or corrupts data:Yes Copied to github as #:17469

Description

After .ui file for a form is load, it crashed when the tools Identify Results is used.

Environment:
OS: Ubuntu 12.04
QGIS 2.0.1

[email protected]:/usr/bin$ qgis
Warning: loading of qt translation failed [/usr/share/qt4/translations/qt_en_US]
No handlers could be found for logger "InaSAFE" 

(qgis.bin:2347): Gtk-WARNING **: Attempting to store changes into `/root/.local/share/recently-used.xbel', but failed: Failed to create file '/root/.local/share/recently-used.xbel.Z9373W': No such file or directory

(qgis.bin:2347): Gtk-WARNING **: Attempting to set the permissions of `/root/.local/share/recently-used.xbel', but failed: No such file or directory

(qgis.bin:2347): Gtk-WARNING **: Attempting to store changes into `/root/.local/share/recently-used.xbel', but failed: Failed to create file '/root/.local/share/recently-used.xbel.L3573W': No such file or directory

(qgis.bin:2347): Gtk-WARNING **: Attempting to set the permissions of `/root/.local/share/recently-used.xbel', but failed: No such file or directory

(qgis.bin:2347): Gtk-WARNING **: Attempting to store changes into `/root/.local/share/recently-used.xbel', but failed: Failed to create file '/root/.local/share/recently-used.xbel.UR7E4W': No such file or directory

(qgis.bin:2347): Gtk-WARNING **: Attempting to set the permissions of `/root/.local/share/recently-used.xbel', but failed: No such file or directory

(qgis.bin:2347): Gtk-WARNING **: Attempting to store changes into `/root/.local/share/recently-used.xbel', but failed: Failed to create file '/root/.local/share/recently-used.xbel.7Z7E4W': No such file or directory

(qgis.bin:2347): Gtk-WARNING **: Attempting to set the permissions of `/root/.local/share/recently-used.xbel', but failed: No such file or directory
QGIS died on signal 11[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fb13ffff700 (LWP 2369)]
[New Thread 0x7fb186383700 (LWP 2364)]
[New Thread 0x7fb186b84700 (LWP 2363)]
[New Thread 0x7fb19fcd6700 (LWP 2357)]
[New Thread 0x7fb1a04d7700 (LWP 2355)]

warning: no loadable sections found in added symbol-file system-supplied DSO at 0x7fffba340000
0x00007fb1b518d48d in waitpid () from /lib/x86_64-linux-gnu/libc.so.6
[Current thread is 1 (Thread 0x7fb1bc38e7c0 (LWP 2347))]
#0  0x00007fb1b518d48d in waitpid () from /lib/x86_64-linux-gnu/libc.so.6
No symbol table info available.
#1  0x00000000004e8fb0 in qgisCrash(int) ()
No symbol table info available.
#2  <signal handler called>
No symbol table info available.
#3  0x000000000083cccf in QFormInternal::domPropertyToVariant(QFormInternal::QAbstractFormBuilder*, QMetaObject const*, QFormInternal::DomProperty const*) ()
No symbol table info available.
#4  0x00000000007eb219 in QFormInternal::QAbstractFormBuilder::toVariant(QMetaObject const*, QFormInternal::DomProperty*) ()
No symbol table info available.
#5  0x0000000000804db6 in QFormInternal::QFormBuilder::applyProperties(QObject*, QList<QFormInternal::DomProperty*> const&) ()
No symbol table info available.
#6  0x00000000007e2b9f in QFormInternal::FormBuilderPrivate::applyProperties(QObject*, QList<QFormInternal::DomProperty*> const&) ()
No symbol table info available.
#7  0x00000000007f4635 in QFormInternal::QAbstractFormBuilder::create(QFormInternal::DomWidget*, QWidget*) ()
No symbol table info available.
#8  0x0000000000805111 in QFormInternal::QFormBuilder::create(QFormInternal::DomWidget*, QWidget*) ()
No symbol table info available.
#9  0x00000000007e09ce in QFormInternal::FormBuilderPrivate::create(QFormInternal::DomWidget*, QWidget*) ()
No symbol table info available.
#10 0x00000000007f9523 in QFormInternal::QAbstractFormBuilder::create(QFormInternal::DomUI*, QWidget*) ()
No symbol table info available.
#11 0x00000000007e1165 in QFormInternal::FormBuilderPrivate::create(QFormInternal::DomUI*, QWidget*) ()
No symbol table info available.
#12 0x00007fb1b87ea2a2 in QFormInternal::QAbstractFormBuilder::load(QIODevice*, QWidget*) () from /usr/lib/libqgis_gui.so.2.0.1
No symbol table info available.
#13 0x00007fb1b87e26ad in QUiLoader::load(QIODevice*, QWidget*) () from /usr/lib/libqgis_gui.so.2.0.1
No symbol table info available.
#14 0x00007fb1b8722ddf in QgsAttributeDialog::QgsAttributeDialog(QgsVectorLayer*, QgsFeature*, bool, QgsDistanceArea, QWidget*, bool) () from /usr/lib/libqgis_gui.so.2.0.1
No symbol table info available.
#15 0x00000000005ce9de in QgsFeatureAction::newDialog(bool) ()
No symbol table info available.
#16 0x00000000005cfef4 in QgsFeatureAction::viewFeatureForm(QgsHighlight*) ()
No symbol table info available.
#17 0x00000000005c7078 in QgsIdentifyResultsDialog::featureForm() ()
No symbol table info available.
#18 0x00000000005c79fe in QgsIdentifyResultsDialog::show() ()
No symbol table info available.
#19 0x0000000000628f41 in QgsMapToolIdentifyAction::canvasReleaseEvent(QMouseEvent*) ()
No symbol table info available.
#20 0x00007fb1b8757bd3 in QgsMapCanvas::mouseReleaseEvent(QMouseEvent*) () from /usr/lib/libqgis_gui.so.2.0.1
No symbol table info available.
#21 0x00007fb1b7146144 in QWidget::event(QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
No symbol table info available.
#22 0x00007fb1b75063b6 in QFrame::event(QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
No symbol table info available.
#23 0x00007fb1b7730b2b in QGraphicsView::viewportEvent(QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
No symbol table info available.
#24 0x00007fb1b7d73028 in QCoreApplicationPrivate::sendThroughObjectEventFilters(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
No symbol table info available.
#25 0x00007fb1b70f585f in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
No symbol table info available.
#26 0x00007fb1b70fb0bf in QApplication::notify(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
No symbol table info available.
#27 0x00007fb1b8c821a6 in QgsApplication::notify(QObject*, QEvent*) () from /usr/lib/libqgis_core.so.2.0.1
No symbol table info available.
#28 0x00007fb1b7d72e9c in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
No symbol table info available.
#29 0x00007fb1b70f6862 in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
No symbol table info available.
#30 0x00007fb1b7175bf5 in ?? () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
No symbol table info available.
#31 0x00007fb1b7174bae in QApplication::x11ProcessEvent(_XEvent*) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
No symbol table info available.
#32 0x00007fb1b719e0d2 in ?? () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
No symbol table info available.
#33 0x00007fb1b3c30d53 in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
No symbol table info available.
#34 0x00007fb1b3c310a0 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
No symbol table info available.
#35 0x00007fb1b3c31164 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
No symbol table info available.
#36 0x00007fb1b7da23bf in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
No symbol table info available.
#37 0x00007fb1b719dd5e in ?? () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
No symbol table info available.
#38 0x00007fb1b7d71c82 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
No symbol table info available.
#39 0x00007fb1b7d71ed7 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
No symbol table info available.
#40 0x00007fb1b7d76f67 in QCoreApplication::exec() () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
No symbol table info available.
#41 0x00000000004e48be in main ()
No symbol table info available.
gdb returned 0

qgis22_ubuntu1310_x64.error (6.36 KB) Stefan Sylla, 2014-03-17 04:11 AM

project.ui (5.3 KB) Stefan Sylla, 2014-03-17 08:03 AM

Dialog_013.png - Form opens outside QGIS (7.15 KB) Jorge Rocha, 2014-05-16 01:36 PM


Related issues

Related to QGIS Application - Bug report #14152: Form annotation crashs QGIS with Segmentation fault (core... Closed 2016-01-21
Duplicated by QGIS Application - Bug report #11982: Custom UI Form crashes QGIS in Ubuntu Closed 2015-01-12
Duplicated by QGIS Application - Bug report #16650: segmentation error (core dumped) Closed 2017-06-01
Duplicated by QGIS Application - Bug report #17264: Segmentation fault with custom form Closed 2017-10-10

History

#1 Updated by Giovanni Manghi about 6 years ago

  • Crashes QGIS or corrupts data changed from No to Yes
  • Priority changed from Normal to High
  • Target version set to Future Release - High Priority

#2 Updated by Matthias Kuhn about 6 years ago

  • Operating System set to Ubuntu
  • OS version set to 12.04

We have had the same problem. This only appeared on Ubuntu 12.04 so far.

Here it was related to having "geometry" and "size" properties in the form. To reproduce assign a simple .ui with one of these properties specified on a widget.

Workaround:
Manually delete "geometry" and "size" properties from the .ui file (open with text or xml editor)

#3 Updated by Klas Karlsson about 6 years ago

  • Target version deleted (Future Release - High Priority)

Same problem.

Very simple shape files and a very simple ui-file created in Qt4 Designer crashes QGIS without any warning!

No geometry, just simple text attributes with line edit forms.

(Only tested on Ubuntu 12.04 and QGIS 2.0.1)

#4 Updated by Matthias Kuhn about 6 years ago

The term geometry does not refer to a QGIS geometry, but to a widget property geometry. Open your .ui file in a text editor and search for "geometry" and "size" and remove the entire xml element (<property name="geometry"> to </property>) .

#5 Updated by Stefan Sylla almost 6 years ago

I experienced the same issue now on Ubuntu 13.10 64 bit with QGIS 2.2. The custom UI was working perfectly under QGIS 2.0, but since QGIS 2.2 the application crashes when I try to open the form via the identify tool. The fix proposed by Matthias Kuhn is not helping.

#6 Updated by Matthias Kuhn over 5 years ago

Hi Stefan. Can you attach the .ui file you were trying to load?

Concerning the original bug, I think closing this and reporting a bug on ubuntu will help more than keeping this issue here open.

#7 Updated by Stefan Sylla over 5 years ago

Hi Matthias, attached my UI-file. For the ubuntu bug reporting I am not sure where to post that kind of issue. Any hint?

#8 Updated by Matthias Kuhn over 5 years ago

Loads fine for me, but I'm not on Ubuntu. Would be nice if someone with Ubuntu (13.10) could verify.

One can try to file a bug in the official Ubuntu bugtracker (I guess that's https://bugs.launchpad.net) as it seems to be a problem of their qt libraries.

#9 Updated by Imre Molnar over 5 years ago

I can verify. I have same problem like Klas Karlsson and Stefan Sylla as above on Ubuntu 13.10 32 bit with QGIS 2.2. But on Windows 8 64 bit with QGIS 2.2 work fine that shape file and ui file which kill the QGIS on Ubuntu.

#10 Updated by Hugo Mercier over 5 years ago

I've had the same problem.
On my small test files, removing geometry properties from the .ui file works.
I've tested Akbar's file both with and without geometry XML properties (xubuntu 13.10 upgraded from a 12.10) and it does not work.
Matthias, do you have more clues ? It seems to come from QT, within their QUiLoader ... but can't find anything related

#11 Updated by Matthias Kuhn over 5 years ago

Personally I've got no problems on my Linux systems (Fedora). I've only observed this happen on Ubuntu 12.04 and found the geometry property workaround with some debugging.

I assume it's a Qt bug. You could try to create a small sample pyqt script to load that ui file and see if it crashes as well. If yes it would be a nice attachment for a bug on the ubuntu tracker.

#12 Updated by Jorge Rocha over 5 years ago

Following Alexandre report on the dev mailing list [subject: Users Manual Form annotations challenge], I've created a simple python script to open the form outside QGIS in Ubuntu 12.04 (to open his form https://www.dropbox.com/s/4a3mqni2becruh9/annotations_form.ui).

The script is:

import sys
from PyQt4 import QtCore, QtGui, uic
form_class = uic.loadUiType("annotations_form.ui")[0]
class MyWindowClass(QtGui.QMainWindow, form_class):
    def __init__(self, parent=None):
        QtGui.QMainWindow.__init__(self, parent)
        self.setupUi(self)
app = QtGui.QApplication(sys.argv)
myWindow = MyWindowClass(None)
myWindow.show()
app.exec_()

The form opens, but it is not enough to decide if it is a QT bug or not.

#13 Updated by Jürgen Fischer over 5 years ago

  • Assignee deleted (Akbar Gumbira)
  • Category set to Forms

#14 Updated by Ahmet Emre Aladag about 5 years ago

I had this issue in (QGIS 2.6) Ubuntu 12.04, Mint 13, Mint 17(=Ubuntu 14.04). All had core dump.

(I could not test it on Ubuntu 14.10 since it didn't have dependencies QGis required. Works fine on MacOSX)

So what could the problem be?

#15 Updated by Matthias Kuhn about 5 years ago

Searching the internet brought me to these possibly related reports:

https://bugs.kde.org/show_bug.cgi?id=182810
which in turn points to this
https://bugreports.qt-project.org/browse/QTBUG-437

#16 Updated by Luca Lanteri about 4 years ago

I don't know if it's a Qt bug but if it could help this is the situation on my PC.
Custom form with logic crash on qgis 2.8.3 and qgis 2.10. It work on fine with master.

a test project can be downloaded on https://github.com/lucalanteri/mzs

#17 Updated by Sandro Santilli almost 4 years ago

  • Status changed from Open to Feedback

If you confirm it works with current master (2.14-pre, 69cb0c4ed3174946c82e32dad4af5a12275079fc at time of writing) I'd close this.

#18 Updated by Alexandre Neto almost 4 years ago

I have recently opened this issue #14152

As it seems to be a duplicate, It will be closed.

With my form, QGIS master still crashes. Sandro, what was the form that you tried?

Thanks

#19 Updated by Alexandre Neto almost 4 years ago

BTW, with my example form, in 2.8.3 it works ok.

#20 Updated by Fred Lehodey almost 4 years ago

Same problem:
Mint17 (ubuntu 14.04) qgis 2.14.0
(Matthias's workaround doesn't work)

#21 Updated by Giovanni Manghi over 3 years ago

  • Affected QGIS version changed from 2.0.1 to 2.14.0
  • Status changed from Feedback to Open
  • Priority changed from High to Severe/Regression

#22 Updated by Sylvain Beorchia over 3 years ago

Same problem here too (Qgis 2.14.3 / Kubuntu 14.04)
I've also tried the "project.ui" provided by Stefan Sylla. It crashes Qgis.

#23 Updated by Sylvain Beorchia over 3 years ago

In complement, i tried to load and display my .ui file directly from PyQt and it works. The same with PySide.

#24 Updated by Matthias Kuhn over 3 years ago

  • Subject changed from Custom Form from .ui File Crashed QGIS to Custom Form from .ui File crashes QGIS on Ubuntu

#25 Updated by Sandro Santilli about 3 years ago

  • Status changed from Open to In Progress
  • Assignee set to Sandro Santilli

#26 Updated by Sandro Santilli about 3 years ago

I've tried loading the .ui file in final-2_16_3-45-g61a0a1e and final-2_14_7-32-g35ddf1f, and both load the .ui just fine (as form annotations) -- is that's how you loaded it or can you give instructions to how else to load the .ui ?

#27 Updated by Sandro Santilli about 3 years ago

Note: my non-crashing tests were made on Ubuntu 16.04 with Qt 4.8.7

#28 Updated by Sandro Santilli about 3 years ago

  • Status changed from In Progress to Feedback

#29 Updated by Sandro Santilli about 3 years ago

  • Assignee deleted (Sandro Santilli)

#30 Updated by Sylvain Beorchia about 3 years ago

I've just made a build of the master, and the problem is solved for me (see my posts above).
Using the build version is fine. Using the one installed with the packages is not.

(Unbuntu 14.04).

#31 Updated by Diego Carvalho almost 3 years ago

I'm having the same problem.

My environment is as follows:
Ubuntu 16.04

Version of QGIS 2.18.1
QGIS version code 0cfd7d8
Compiled on Qt 4.8.7
Running on Qt 4.8.7
Compiled on GDAL / OGR 1.11.3
Running on GDAL / OGR 1.11.3
Compiled on GEOS 3.5.0-CAPI-1.9.0
Running on GEOS 3.5.0-CAPI-1.9.0 r4084
Client version PostgreSQL 9.5.2
SpatiaLite Version 4.3.0a
Version of QWT 5.2.3
PROJ.4 Version 492
Version QScintilla2 2.9.1

#32 Updated by Giovanni Manghi almost 3 years ago

  • OS version deleted (12.04)
  • Status changed from Feedback to Open
  • Operating System deleted (Ubuntu)
  • Affected QGIS version changed from 2.14.0 to 2.18.1

#33 Updated by Matthias Kuhn almost 3 years ago

  • Operating System set to Ubuntu

I think for this issue the platform is important. I haven't seen any reports except for Ubuntu.

I really hope we can just close this with QGIS 3.0 (probably due to the update to Qt 5).

#34 Updated by Giovanni Manghi almost 3 years ago

  • Status changed from Open to Feedback

Is this still an issue on 2.18.4?

#35 Updated by Giovanni Manghi over 2 years ago

  • Status changed from Feedback to Open
  • Description updated (diff)
  • Affected QGIS version changed from 2.18.1 to 2.18.7

#36 Updated by Giovanni Manghi over 2 years ago

  • Regression? set to Yes

#37 Updated by Giovanni Manghi over 2 years ago

  • Priority changed from Severe/Regression to High

#38 Updated by Giovanni Manghi over 2 years ago

  • Easy fix? set to No

#39 Updated by Paolo Frizzera over 2 years ago

I'm having the same problem: with custom form qgis crash !!
I tried to follow the training manual (x 2.14: 6.3.6 - 6.3.7) with different version of qgis and Ubuntu: same result

Ubuntu 14.04 LTS x86_64 (updated):
qgis: 2.14.14
qt: 4.8.6

Ubuntu 16.04 LTS x86_64 (updated):
qgis: 2.18.7
qt: 4.8.7

OSGeo Live 10.5 (installed and updated - Lubuntu 16.04 - x86_64):
qgis: 2.14.11
qt: 4.8.7

#40 Updated by Jürgen Fischer over 2 years ago

#41 Updated by Clément MARCEL over 2 years ago

I have the same problem on Ubuntu where:

  • QGis 2.14 is installed through repository,
  • QGis 2.18 is compiled from source.

Loading UI file in QGis 2.18 or in minimal stand-alone Qt application will result to a crash (only when loading custom widgets).

Loaded modules analysis shows that the following module is used:

/usr/lib/x86_64-linux-gnu/qt4/plugins/designer/libqgis_customwidgets.so.2.14.16

even if I use stand-alone Qt app. The same is loaded with QGis 2.18 version.

Workaround:
I can remove crash by deleting this library. QGis 2.18 loads successfully forms. QtDesigner fails to load custom widgets but only warnings are reported.

Fix:
I can fix this issue on my machine - keeping libqgis_customwidgets.so.2.14.16 installed - by forcing QUILoader not to use this plugin by resetting its plugins paths:

QUiLoader loader;
+loader.clearPluginPaths();

(This object is used 3 times in current QGis 2.18 source code)

#42 Updated by Hugo Mercier over 2 years ago

Clément: good catch !

Do you know why 2.18 is linked to the 2.14 version of custom widgets ?

#43 Updated by Clément MARCEL over 2 years ago

Hugo Mercier wrote:

Do you know why 2.18 is linked to the 2.14 version of custom widgets ?

There is no linking between dynamic libraries. QUILoader loads itself all plugins available in search paths. If libqgis_customwidgets.so.2.14.16 is deployed in standard Qt plugin path it will be loaded by QtDesigner or QUILoader instance for creating custom QGis widgets. There seams to be no mechanism that can check for QGis plugin version (only between Qt versions).

libqgis_customwidgets.so.2.14.16 is linked to libqgis_gui.so.2.14.16

By calling QUILoader::pluginPaths() we can see that Qt stores some paths like /usr/lib/x86_64-linux-gnu/qt4/plugins/designer (maybe hard-coded).

I try to manually deploy libqgis_customwidgets.so.2.18.10 to Qt standard path & it works (keeping version 2.14 in the same path).

But because custom widgets implementations are stored into QGis shared libraries (libqgis_gui.so ?) & QGis doesn't need libqgis_customwidgets.so I have clear all plugin paths for all QUILoader to keep QGis custom widgets plugin in standard path (and allow uses of QtDesigner) & to force QGis to ignore these hard-coded paths.

#44 Updated by Jürgen Fischer about 2 years ago

#45 Updated by Loïc BARTOLETTI 11 months ago

  • Status changed from Open to Feedback

Please test with QGIS 3.4 - QGIS 2 reached it's end of life.

#46 Updated by Giovanni Manghi 9 months ago

  • Status changed from Feedback to Closed
  • Resolution set to no timely feedback

Closing for lack of feedback.

Also available in: Atom PDF