Bug report #3077

ftools (merge shapefiles tool): QGIS crashes if shapes are missing the .prj file

Added by Giovanni Manghi about 9 years ago. Updated over 2 years ago.

Status:Closed
Priority:Low
Assignee:Alexander Bruy
Category:Processing/QGIS
Affected QGIS version: Regression?:
Operating System:Debian Easy fix?:
Pull Request or Patch supplied: Resolution:worksforme
Crashes QGIS or corrupts data: Copied to github as #:13137

Description

This is true also for the standalone plugin (by the way, what is the difference between the two?).

Console message is:

Warning: QPixmap: It is not safe to use pixmaps outside the GUI thread
Warning: QPixmap: It is not safe to use pixmaps outside the GUI thread
Segmentation fault

After adding the .prj file (for example with the "define current projection tool") it works fine.

Tested under Ubuntu 10.04 and qgis trunk.

History

#1 Updated by Maxim Dubinin about 9 years ago

I've tried on 2 point shapefiles with prj/qprj removed - all normal. I'm on Windows, latest trunk.

My example: http://gis-lab.info/share/1.7z

#2 Updated by Giovanni Manghi about 9 years ago

So it happens at least under trunk/linux (ubuntu) with this shapes (lines)

http://mapserver.uevora.pt/~mapserver/shapes_teste.tar.gz

#3 Updated by Alexander Bruy about 9 years ago

Can't reproduce under Windows and Linux with my own test files and with attached files

#4 Updated by Giovanni Manghi about 9 years ago

weird. What geos version are you using under both systems?

#5 Updated by Alexander Bruy about 9 years ago

Replying to [comment:4 lutra]:

weird. What geos version are you using under both systems?

Under Linux - geos-3.1.1, self-compiled
Under Windows - geos-3.0.3-2 from OSGeo4W

#6 Updated by Giovanni Manghi about 9 years ago

I'm using Ubuntu 10.04 with the ubuntugis repository, that ships geos 3.2.2, any chance to test it, maybe in a VM?

#7 Updated by Paolo Cavallini almost 9 years ago

It works here (debian testing, libgeos-3.2.0, qgis 0880c2c7 (SVN r14581))

#8 Updated by Giovanni Manghi almost 9 years ago

With trunk/ubuntu 10.04, still crashes, with the same provided data and with both the tool in the vector menu or the 3rd party plugin. The error is the same described in the summary.

Can anyone else try the same configuration?

By the way, why having the same tool as 3rd party plugin and as core tool in the vector menu?

#9 Updated by Alexander Bruy almost 9 years ago

Replying to [comment:8 lutra]:

By the way, why having the same tool as 3rd party plugin and as core tool in the vector menu?

Ok, we developed this plugin as patch for fTools and submit it. But patch was not being applied for a long time, so we decide to release it as separate plugin. Later patch was applied, but we added to plugin some new features (e.g option to select individual files).

Now this is unnecessary, because all features was ported to the fTools during hackfest. I think that separate plugin can be useful for those who use older QGIS without this functionality in fTools.

#10 Updated by Giovanni Manghi almost 9 years ago

Now this is unnecessary, because all features was ported to the fTools during hackfest. I think that separate plugin can be useful for those who use older QGIS without this functionality in fTools.

ok!

cheers

#12 Updated by Anne Ghisla over 8 years ago

I can reproduce the bug, merging the two shapefiles without prj leads to segfault, while adding prj fixes it.

I run self-compiled QGIS 44441dec (SVN r15305), geos version 3.2.1 on Fedora.

#13 Updated by Alexander Bruy over 8 years ago

Can't reproduce on Slackware with self-compiled QGIS 3c8d31dd (SVN r15321), geos 3.2.2 and on Windows with 95af577b (SVN r15307), geos 3.2.2 (from OSGeo4W)

#14 Updated by Paolo Cavallini over 8 years ago

I confirm the crash, even if the prj are present.libgeos-3.2.0, qgis a75d755c (SVN r15310), self compiled. It might be due to gos then.
Here is the backtrace:

#0  0x00007f7bdb1a7f02 in ?? () from /usr/lib/libQtGui.so.4
#3905  0x00007f7bdb2b23e8 in ?? () from /usr/lib/libQtGui.so.4
#3906  0x00007f7bdb21033c in QPainter::drawPixmap(QPointF const&, QPixmap const&) () from /usr/lib/libQtGui.so.4
#3907  0x00007f7bdb42dd7f in ?? () from /usr/lib/libQtGui.so.4
#3908  0x00007f7bdb4294be in QGtkStyle::drawPrimitive(QStyle::PrimitiveElement, QStyleOption const*, QPainter*, QWidget const*) const ()
   from /usr/lib/libQtGui.so.4
#3909  0x00007f7bdb510c63 in QStatusBar::paintEvent(QPaintEvent*) () from /usr/lib/libQtGui.so.4
#3910  0x00007f7bdb107212 in QWidget::event(QEvent*) () from /usr/lib/libQtGui.so.4
#3911  0x00007f7bdb51248e in QStatusBar::event(QEvent*) () from /usr/lib/libQtGui.so.4
#3912  0x00007f7bdb0b132c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#3913  0x00007f7bdb0b780b in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#10 0x00007f7bdcc101db in [[QgsApplication]]::notify(QObject*, QEvent*) () from /usr/lib/libqgis_core.so.1.7.0
#3914 0x00007f7bdbd1109c in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib/libQtCore.so.4
#3915 0x00007f7bdb10f80d in QWidgetPrivate::drawWidget(QPaintDevice*, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) ()
   from /usr/lib/libQtGui.so.4
#3916 0x00007f7bdb1104a8 in QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, QList<QObject*> const&, int, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) () from /usr/lib/libQtGui.so.4
#3917 0x00007f7bdb10f56a in QWidgetPrivate::drawWidget(QPaintDevice*, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) ()
   from /usr/lib/libQtGui.so.4
#3918 0x00007f7bdb2c9a05 in ?? () from /usr/lib/libQtGui.so.4
#3919 0x00007f7bdb101170 in QWidgetPrivate::syncBackingStore() () from /usr/lib/libQtGui.so.4
#3920 0x00007f7bdb107915 in QWidget::event(QEvent*) () from /usr/lib/libQtGui.so.4
#3921 0x00007f7bdb4ca0fb in QMainWindow::event(QEvent*) () from /usr/lib/libQtGui.so.4
#3922 0x00007f7bdb0b132c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#3923 0x00007f7bdb0b780b in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#3924 0x00007f7bdcc101db in [[QgsApplication]]::notify(QObject*, QEvent*) () from /usr/lib/libqgis_core.so.1.7.0
#3925 0x00007f7bdbd1109c in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib/libQtCore.so.4
#3926 0x00007f7bdb2c6d57 in ?? () from /usr/lib/libQtGui.so.4
#3927 0x00007f7bdb2ca1a1 in ?? () from /usr/lib/libQtGui.so.4
#3928 0x00007f7bdb10352b in QWidget::repaint(QRect const&) () from /usr/lib/libQtGui.so.4
#3929 0x00007f7bdb510fd8 in QStatusBar::hideOrShow() () from /usr/lib/libQtGui.so.4
#3930 0x0000000000502840 in ?? ()
#3931 0x00007f7bdcc93138 in [[QgsCoordinateReferenceSystem]]::validate() () from /usr/lib/libqgis_core.so.1.7.0
#3932 0x00007f7bdccac77c in [[QgsVectorLayer]]::setCoordinateSystem() () from /usr/lib/libqgis_core.so.1.7.0
#3933 0x00007f7bdccc0ea8 in [[QgsVectorLayer]]::QgsVectorLayer(QString, QString, QString, bool) () from /usr/lib/libqgis_core.so.1.7.0
#3934 0x00007f7bbcc7c23d in sipQgsVectorLayer::sipQgsVectorLayer(QString, QString, QString) ()
   from /usr/lib/python2.6/dist-packages/qgis/core.so
#3935 0x00007f7bbcc83b08 in ?? () from /usr/lib/python2.6/dist-packages/qgis/core.so
#3936 0x00007f7bbdc911d7 in ?? () from /usr/lib/pymodules/python2.6/sip.so
#3937 0x00007f7bbdf4fd68 in ?? () from /usr/lib/libpython2.6.so.1.0
#3938 0x00007f7bbdef3103 in [[PyObject]]_Call () from /usr/lib/libpython2.6.so.1.0
#36 0x00007f7bbdf986b9 in [[PyEval]]_EvalFrameEx () from /usr/lib/libpython2.6.so.1.0
#37 0x00007f7bbdf9acc0 in [[PyEval]]_EvalCodeEx () from /usr/lib/libpython2.6.so.1.0
#38 0x00007f7bbdf20980 in ?? () from /usr/lib/libpython2.6.so.1.0
#39 0x00007f7bbdef3103 in [[PyObject]]_Call () from /usr/lib/libpython2.6.so.1.0
#40 0x00007f7bbdf04abf in ?? () from /usr/lib/libpython2.6.so.1.0
#41 0x00007f7bbdef3103 in [[PyObject]]_Call () from /usr/lib/libpython2.6.so.1.0
#42 0x00007f7bbdf93103 in [[PyEval]]_CallObjectWithKeywords () from /usr/lib/libpython2.6.so.1.0
#43 0x00007f7bbdc92cab in ?? () from /usr/lib/pymodules/python2.6/sip.so
#44 0x00007f7bbd8fe498 in ?? () from /usr/lib/pymodules/python2.6/PyQt4/QtCore.so
#45 0x00007f7bbd92e68a in ?? () from /usr/lib/pymodules/python2.6/PyQt4/QtCore.so
#46 0x00007f7bdbc21e15 in ?? () from /usr/lib/libQtCore.so.4
#47 0x00007f7bd985f8ba in start_thread () from /lib/libpthread.so.0
#48 0x00007f7bd8c1702d in clone () from /lib/libc.so.6
#49 0x0000000000000000 in ?? ()

#15 Updated by Paolo Cavallini over 8 years ago

See more details in #3445 (now closed as duplicate)

#16 Updated by Giovanni Manghi over 8 years ago

Replying to [comment:2 lutra]:

So it happens at least under trunk/linux (ubuntu) with this shapes (lines)

http://mapserver.uevora.pt/~mapserver/shapes_teste.tar.gz

with this sample data, qgis trunk, geos 3.2.2 it now works FINE for me, with both the standalone plugin and the tool in the vector menu.

#17 Updated by Maxim Dubinin over 8 years ago

  • Resolution set to worksforme
  • Status changed from Open to Closed

worksforme as well, closing, reopen if necessary

#18 Updated by Giovanni Manghi over 2 years ago

The "ftools" category is being removed from the tracker, changing the category of this ticket to "Processing/QGIS" to not leave the category orphaned.

Also available in: Atom PDF