[QGIS-Developer] Drag and drop to PostGIS crash

Radim Blazek radim.blazek at gmail.com
Tue May 30 10:07:45 PDT 2017


On Tue, May 30, 2017 at 10:01 AM, Sandro Santilli <strk at kbt.io> wrote:
>> Calling QgsPostgresConn::connectDb with shared=false should be OK, right?
>
> I guess, given the assertion was only added in the shared=true case..

It is called from many places where it is difficult to pass shared
param. I have forced non shared in QgsPostgresConn::connectDb if it is
not main thread.

DD works within the browser now but not for layer with measures.

DD from layer tree to postgres/browser imports the layer (without measures) but:
- the layer is removed from layer tree - intended?
- QGIS crashes sometimes

One traceback below, it crashed when DD failed. I think that the
problem is that it is trying to show an error message which can only
be done on main thread?
The code which is run from QgsTaskManager should never interact with GUI?

Radim

#0  0x00007f844620f3c0 in QCoreApplication::notifyInternal2(QObject*,
QEvent*) () from /home/radim/Qt/5.8/gcc_64/lib/libQt5Core.so.5
(gdb) bt
#0  0x00007f844620f3c0 in QCoreApplication::notifyInternal2(QObject*,
QEvent*) () from /home/radim/Qt/5.8/gcc_64/lib/libQt5Core.so.5
#1  0x00007f844625ea1e in QTimerInfoList::activateTimers() () from
/home/radim/Qt/5.8/gcc_64/lib/libQt5Core.so.5
#2  0x00007f844625f219 in ?? () from
/home/radim/Qt/5.8/gcc_64/lib/libQt5Core.so.5
#3  0x00007f843e5c9c5d in g_main_context_dispatch () from
/lib/x86_64-linux-gnu/libglib-2.0.so.0
#4  0x00007f843e5c9f48 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#5  0x00007f843e5c9ffc in g_main_context_iteration () from
/lib/x86_64-linux-gnu/libglib-2.0.so.0
#6  0x00007f844625fcbf in
QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>)
()
   from /home/radim/Qt/5.8/gcc_64/lib/libQt5Core.so.5
#7  0x00007f844620d9ca in
QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from
/home/radim/Qt/5.8/gcc_64/lib/libQt5Core.so.5
#8  0x00007f844a1e8a07 in QDialog::exec() () from
/home/radim/Qt/5.8/gcc_64/lib/libQt5Widgets.so.5
#9  0x00007f844d8e9c50 in QgsMessageViewer::showMessage
(this=0x3e77be0, blocking=true)
    at /home/radim/devel/qgis/src/gui/qgsmessageviewer.cpp:74
#10 0x00007f844d8e9cbc in non-virtual thunk to
QgsMessageViewer::showMessage(bool) ()
    at /home/radim/devel/qgis/src/gui/qgsmessageviewer.cpp:81
#11 0x00007f8419ec65d0 in QgsPGConnectionItem::handleDrop(QMimeData
const*, QString const&)::$_5::operator()(int, QString const&) const
    (this=0x2c65230, error=2, errorMessage=...) at
/home/radim/devel/qgis/src/providers/postgres/qgspostgresdataitems.cpp:241
#12 0x00007f8419ec64ae in
QtPrivate::FunctorCall<QtPrivate::IndexesList<0, 1>,
QtPrivate::List<int, QString const&>, void,
QgsPGConnectionItem::handleDrop(QMimeData const*, QString
const&)::$_5>::call(QgsPGConnectionItem::handleDrop(QMimeData const*,
QString const&)::$_5&, void**) (f=..., arg=0x7ffcf04e7130) at
/home/radim/Qt/5.8/gcc_64/include/QtCore/qobjectdefs_impl.h:137
#13 0x00007f8419ec6471 in
QtPrivate::Functor<QgsPGConnectionItem::handleDrop(QMimeData const*,
QString const&)::$_5, 2>::call<QtPrivate::List<int, QString const&>,
void>(QgsPGConnectionItem::handleDrop(QMimeData const*, QString
const&)::$_5&, void*, void**) (f=...,
    arg=0x7ffcf04e7130) at
/home/radim/Qt/5.8/gcc_64/include/QtCore/qobjectdefs_impl.h:194
#14 0x00007f8419ec6413 in
QtPrivate::QFunctorSlotObject<QgsPGConnectionItem::handleDrop(QMimeData
const*, QString const&)::$_5, 2, QtPrivate::List<int, QString const&>,
void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*)
(which=1, this_=0x2c65220,
    r=0x3cfc3e0, a=0x7ffcf04e7130, ret=0x0) at
/home/radim/Qt/5.8/gcc_64/include/QtCore/qobject_impl.h:168
#15 0x00007f8446238746 in QMetaObject::activate(QObject*, int, int,
void**) () from /home/radim/Qt/5.8/gcc_64/lib/libQt5Core.so.5
#16 0x00007f844bf0347f in QgsVectorLayerExporterTask::errorOccurred
(this=0x43be440, _t1=2, _t2=...)
    at /home/radim/devel/qgis-build/src/core/moc_qgsvectorlayerexporter.cpp:147
#17 0x00007f844bbb9b80 in QgsVectorLayerExporterTask::finished
(this=0x43be440, result=false)
    at /home/radim/devel/qgis/src/core/qgsvectorlayerexporter.cpp:508
#18 0x00007f844bad71e7 in QgsTaskManager::taskStatusChanged
(this=0x23c7bc0, status=4)
    at /home/radim/devel/qgis/src/core/qgstaskmanager.cpp:653


More information about the QGIS-Developer mailing list