Opened 14 years ago

Closed 13 years ago

#3077 closed bug (worksforme)

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

Reported by: lutra Owned by: alexbruy
Priority: critical: causes crash or data corruption Milestone: Version 1.7.0
Component: fTools Version: Trunk
Keywords: Cc: alexander.bruy@…
Must Fix for Release: Yes Platform: Debian
Platform Version: Awaiting user input: no

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.

Change History (18)

comment:1 by gislab, 14 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

comment:2 by lutra, 14 years ago

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

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

comment:3 by alexbruy, 14 years ago

Owner: changed from cfarmer to alexbruy

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

comment:4 by lutra, 14 years ago

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

in reply to:  4 comment:5 by alexbruy, 14 years ago

Replying to 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

comment:6 by lutra, 14 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?

comment:7 by pcav, 13 years ago

It works here (debian testing, libgeos-3.2.0, qgis r14580)

comment:8 by lutra, 13 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?

in reply to:  8 ; comment:9 by alexbruy, 13 years ago

Replying to 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.

in reply to:  9 comment:10 by lutra, 13 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

comment:12 by aghisla, 13 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 r15304, geos version 3.2.1 on Fedora.

comment:13 by alexbruy, 13 years ago

Can't reproduce on Slackware with self-compiled QGIS r15320, geos 3.2.2 and on Windows with r15306, geos 3.2.2 (from OSGeo4W)

comment:14 by pcav, 13 years ago

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

#0  0x00007f7bdb1a7f02 in ?? () from /usr/lib/libQtGui.so.4
#1  0x00007f7bdb2b23e8 in ?? () from /usr/lib/libQtGui.so.4
#2  0x00007f7bdb21033c in QPainter::drawPixmap(QPointF const&, QPixmap const&) () from /usr/lib/libQtGui.so.4
#3  0x00007f7bdb42dd7f in ?? () from /usr/lib/libQtGui.so.4
#4  0x00007f7bdb4294be in QGtkStyle::drawPrimitive(QStyle::PrimitiveElement, QStyleOption const*, QPainter*, QWidget const*) const ()
   from /usr/lib/libQtGui.so.4
#5  0x00007f7bdb510c63 in QStatusBar::paintEvent(QPaintEvent*) () from /usr/lib/libQtGui.so.4
#6  0x00007f7bdb107212 in QWidget::event(QEvent*) () from /usr/lib/libQtGui.so.4
#7  0x00007f7bdb51248e in QStatusBar::event(QEvent*) () from /usr/lib/libQtGui.so.4
#8  0x00007f7bdb0b132c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#9  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
#11 0x00007f7bdbd1109c in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib/libQtCore.so.4
#12 0x00007f7bdb10f80d in QWidgetPrivate::drawWidget(QPaintDevice*, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) ()
   from /usr/lib/libQtGui.so.4
#13 0x00007f7bdb1104a8 in QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, QList<QObject*> const&, int, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) () from /usr/lib/libQtGui.so.4
#14 0x00007f7bdb10f56a in QWidgetPrivate::drawWidget(QPaintDevice*, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) ()
   from /usr/lib/libQtGui.so.4
#15 0x00007f7bdb2c9a05 in ?? () from /usr/lib/libQtGui.so.4
#16 0x00007f7bdb101170 in QWidgetPrivate::syncBackingStore() () from /usr/lib/libQtGui.so.4
#17 0x00007f7bdb107915 in QWidget::event(QEvent*) () from /usr/lib/libQtGui.so.4
#18 0x00007f7bdb4ca0fb in QMainWindow::event(QEvent*) () from /usr/lib/libQtGui.so.4
#19 0x00007f7bdb0b132c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#20 0x00007f7bdb0b780b in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#21 0x00007f7bdcc101db in QgsApplication::notify(QObject*, QEvent*) () from /usr/lib/libqgis_core.so.1.7.0
#22 0x00007f7bdbd1109c in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib/libQtCore.so.4
#23 0x00007f7bdb2c6d57 in ?? () from /usr/lib/libQtGui.so.4
#24 0x00007f7bdb2ca1a1 in ?? () from /usr/lib/libQtGui.so.4
#25 0x00007f7bdb10352b in QWidget::repaint(QRect const&) () from /usr/lib/libQtGui.so.4
#26 0x00007f7bdb510fd8 in QStatusBar::hideOrShow() () from /usr/lib/libQtGui.so.4
#27 0x0000000000502840 in ?? ()
#28 0x00007f7bdcc93138 in QgsCoordinateReferenceSystem::validate() () from /usr/lib/libqgis_core.so.1.7.0
#29 0x00007f7bdccac77c in QgsVectorLayer::setCoordinateSystem() () from /usr/lib/libqgis_core.so.1.7.0
#30 0x00007f7bdccc0ea8 in QgsVectorLayer::QgsVectorLayer(QString, QString, QString, bool) () from /usr/lib/libqgis_core.so.1.7.0
#31 0x00007f7bbcc7c23d in sipQgsVectorLayer::sipQgsVectorLayer(QString, QString, QString) ()
   from /usr/lib/python2.6/dist-packages/qgis/core.so
#32 0x00007f7bbcc83b08 in ?? () from /usr/lib/python2.6/dist-packages/qgis/core.so
#33 0x00007f7bbdc911d7 in ?? () from /usr/lib/pymodules/python2.6/sip.so
#34 0x00007f7bbdf4fd68 in ?? () from /usr/lib/libpython2.6.so.1.0
#35 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 ?? ()

comment:15 by pcav, 13 years ago

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

comment:16 by pcav, 13 years ago

Component: Python plugins and bindingsfTools

in reply to:  2 comment:17 by lutra, 13 years ago

Replying to 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.

comment:18 by gislab, 13 years ago

Resolution: worksforme
Status: newclosed

worksforme as well, closing, reopen if necessary

Note: See TracTickets for help on using tickets.