Opened 15 years ago

Closed 15 years ago

Last modified 14 years ago

#865 closed bug (fixed)

SPIT segfaults

Reported by: msieczka Owned by:
Priority: critical: causes crash or data corruption Milestone:
Component: SPIT Version: Trunk
Keywords: Cc: lami@…, marco.hugentobler@…, venturato@…, msieczka
Must Fix for Release: Yes Platform: All
Platform Version: Awaiting user input: no

Description

QGIS SVN 7773, built and running against QT 4.3.2 on amd64 Ubuntu Dapper.

  1. SPIT
  2. select a shapefile to import
  3. OK
  4. kaboom

Backtrace with debugging enabled:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 46912604925728 (LWP 20332)]
QString::append (this=0x7ffffff234b0, str=@0x0) at tools/qstring.cpp:1255
1255        if (str.d != &shared_null) {
Current language:  auto; currently c++
(gdb) bt
#0  QString::append (this=0x7ffffff234b0, str=@0x0) at tools/qstring.cpp:1255
#1  0x00000000004ab673 in QString::operator+= ()
#2  0x00000000004d230e in operator+ ()
#3  0x00002aaab4cddb92 in QgsShapeFile::insertLayer ()
   from /usr/local/qgis09/lib/qgis/libspitplugin.so
#4  0x00002aaab4cccb9d in QgsSpit::import ()
   from /usr/local/qgis09/lib/qgis/libspitplugin.so
#5  0x00002aaab4ce51a3 in QgsSpit::on_buttonBox_accepted ()
   from /usr/local/qgis09/lib/qgis/libspitplugin.so
#6  0x00002aaab4ce4f91 in QgsSpit::qt_metacall ()
   from /usr/local/qgis09/lib/qgis/libspitplugin.so
#7  0x00002aaaaacd4eab in QMetaObject::activate (sender=0xf1bbe0,
    from_signal_index=28, to_signal_index=28, argv=0x83ffd0)
    at kernel/qobject.cpp:3083
#8  0x00002aaaab524945 in QDialogButtonBox::qt_metacall (this=0xf1bbe0,
    _c=QMetaObject::InvokeMetaMethod, _id=-2, _a=0x7ffffff253b0)
    at moc_qdialogbuttonbox.cpp:113
#9  0x00002aaaaacd4eab in QMetaObject::activate (sender=0xf1b9a0,
    from_signal_index=29, to_signal_index=30, argv=0x83ffd0)
    at kernel/qobject.cpp:3083
#10 0x00002aaaab71f387 in QAbstractButton::clicked (this=0x7ffffff234b0,
    _t1=false) at .moc/release-shared/moc_qabstractbutton.cpp:180
#11 0x00002aaaab4f96eb in QAbstractButtonPrivate::emitClicked (this=0xf1b650)
    at widgets/qabstractbutton.cpp:532
#12 0x00002aaaab4fa947 in QAbstractButtonPrivate::click (this=0xf1b650)
    at widgets/qabstractbutton.cpp:525
#13 0x00002aaaab4fab8d in QAbstractButton::mouseReleaseEvent (this=0xf1b9a0,
    e=0x7ffffff25c40) at widgets/qabstractbutton.cpp:1102
#14 0x00002aaaab271d6a in QWidget::event (this=dwarf2_read_address: Corrupted DW ARF expression.
) at kernel/qwidget.cpp:6129
#15 0x00002aaaab4f9a01 in QAbstractButton::event (this=0xf1b9a0, e=0x0)
    at widgets/qabstractbutton.cpp:1064
#16 0x00002aaaab5857e7 in QPushButton::event (this=0xf1b9a0, e=0x7ffffff25c40)
    at widgets/qpushbutton.cpp:667
#17 0x00002aaaab22e2af in QApplicationPrivate::notify_helper (this=0x7e71f0,
    receiver=0xf1b9a0, e=0x7ffffff25c40) at kernel/qapplication.cpp:3558
#18 0x00002aaaab231f08 in QApplication::notify (this=<value optimized out>,
    receiver=0xf1b9a0, e=0x7ffffff25c40) at kernel/qapplication.cpp:3257
#19 0x00002aaaaacc3e10 in QCoreApplication::notifyInternal (
    this=0x7ffffff267a0, receiver=0xf1b9a0, event=0x7ffffff25c40)
    at kernel/qcoreapplication.cpp:532
#20 0x00002aaaab2877bb in QETWidget::translateMouseEvent (this=0xf1b9a0,
    event=<value optimized out>) at qcoreapplication.h:205
#21 0x00002aaaab28684c in QApplication::x11ProcessEvent (this=0x97,
    event=0x7ffffff26230) at kernel/qapplication_x11.cpp:3024
#22 0x00002aaaab2aaed2 in x11EventSourceDispatch (s=0x81b940, callback=0,
    user_data=0x0) at kernel/qguieventdispatcher_glib.cpp:137
#23 0x00002aaaae507bfd in g_main_context_dispatch ()
   from /usr/lib64/libglib-2.0.so.0
#24 0x00002aaaae50aec5 in g_main_context_check ()
   from /usr/lib64/libglib-2.0.so.0
#25 0x00002aaaae50b374 in g_main_context_iteration ()
   from /usr/lib64/libglib-2.0.so.0
#26 0x00002aaaaace66ce in QEventDispatcherGlib::processEvents (this=0x816fd0,
    flags=@0x7ffffff26500) at kernel/qeventdispatcher_glib.cpp:340
#27 0x00002aaaab2aaaaf in QGuiEventDispatcherGlib::processEvents (
    this=0x7ffffff234b0, flags=<value optimized out>)
    at kernel/qguieventdispatcher_glib.cpp:193
#28 0x00002aaaaacc3778 in QEventLoop::processEvents (
    this=<value optimized out>, flags=<value optimized out>)
    at kernel/qeventloop.cpp:142
#29 0x00002aaaaacc38c6 in QEventLoop::exec (this=0x7ffffff265a0,
    flags=@0x7ffffff265b0) at kernel/qeventloop.cpp:188
#30 0x00002aaaaacc5dc2 in QCoreApplication::exec ()
    at kernel/qcoreapplication.cpp:761
#31 0x00000000004ab10b in main ()
(gdb)

Change History (13)

comment:1 by leo.lami, 15 years ago

In Debian and Windows system I have the same problem. QGIS first says the follow message and then it crashes.

Problema nell'inserimento di elementi dal file: /home/Documenti/Gis/Cartografia/Arezzo/uniti/10k/AU.shp The database gave an error while executing this SQL: SELECT AddGeometryColumn('corso', 'AU', 'the_geom', -1, 'POLYGON', 2) The error was:

relazione "corso.AU" non esiste

CONTEXT: SQL statement "ALTER TABLE corso."AU" ADD COLUMN the_geom geometry " PL/pgSQL function "addgeometrycolumn" line 86 at execute statement SQL statement "SELECT AddGeometryColumn(, $1 , $2 , $3 , $4 , $5 , $6 )" PL/pgSQL function "addgeometrycolumn" line 4 at SQL statement

comment:2 by leo.lami, 15 years ago

Don't considere the last change. The reported problem is due to the all caps name choosen for the PostGis table.

comment:3 by msieczka, 15 years ago

Hmm. Same happens in QGIS 0.8.1. In both 0.9.x and 0.8.1 SPIT crashes, whatever shapefile I'm trying. Shapefiles are OK - QGIS can read and manipulate them.

I can import same shapefiles with ogr2ogr. Eg. a command:

ogr2ogr -f PostgreSQL PG:"dbname=dss_postgis port=31268" -lco "DIM=2" -nln gminy -a_srs EPSG:32633 caves_gminy.shp

works OK. QGIS can see the resultig PostGIS layer, lets me query it etc.

comment:4 by elpaso, 15 years ago

Could be a different bug, here is the bt (version 0.9.2 on gutsy 64 bit):

Debug: /home/ale/dev/cpp/qgis/src/plugins/spit/qgsshapefile.cpp: 292: (insertLayer) Escaped cat to cat

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 47908762661072 (LWP 3408)]
0x00002b9295e03a5a in QString::append () from /usr/lib/libQtCore.so.4
(gdb)
(gdb) bt
#0  0x00002b9295e03a5a in QString::append () from /usr/lib/libQtCore.so.4
#1  0x00000000004b7e41 in QString::operator+= (this=0x7fff181b1b30, s=@0x0)
    at /usr/include/qt4/QtCore/qstring.h:242
#2  0x00000000004e3b5c in operator+ (s1=0x2aaaafb5aa46 " ", s2=@0x0)
    at /usr/include/qt4/QtCore/qstring.h:955
#3  0x00002aaaafb4fa1c in QgsShapeFile::insertLayer (this=0x2aaab81bdbb0,
    dbname=@0x7fff181b2c30, schema=@0x7fff181b2c20, geom_col=@0x7fff181b2c10,
    srid=@0x7fff181b2c00, conn=0x3f28460, pro=@0x7fff181b2070,
    fin=@0x7fff181b2f46, errorText=@0x7fff181b2100)
    at /home/ale/dev/cpp/qgis/src/plugins/spit/qgsshapefile.cpp:294
#4  0x00002aaaafb3ba5a in QgsSpit::import (this=0x2aaab8024aa0)
    at /home/ale/dev/cpp/qgis/src/plugins/spit/qgsspit.cpp:801
#5  0x00002aaaafb57659 in QgsSpit::on_buttonBox_accepted (this=0x2aaab8024aa0)
    at /home/ale/dev/cpp/qgis/build/src/plugins/spit/../../../../src/plugins/spit/qgsspit.h:91
#6  0x00002aaaafb57381 in QgsSpit::qt_metacall (this=0x2aaab8024aa0,
    _c=QMetaObject::InvokeMetaMethod, _id=4, _a=0x7fff181b3050)
    at /home/ale/dev/cpp/qgis/build/src/plugins/spit/moc_qgsspit.cxx:91
#7  0x00002b9295e84770 in QMetaObject::activate () from /usr/lib/libQtCore.so.4
#8  0x00002b9295e84bbb in QMetaObject::activate () from /usr/lib/libQtCore.so.4
#9  0x00002b92937dc340 in QDialogButtonBox::accepted ()
   from /usr/lib/libQtGui.so.4
#10 0x00002b92937dc526 in ?? () from /usr/lib/libQtGui.so.4
#11 0x00002b92937ddc49 in QDialogButtonBox::qt_metacall ()
   from /usr/lib/libQtGui.so.4
#12 0x00002b9295e84770 in QMetaObject::activate () from /usr/lib/libQtCore.so.4
#13 0x00002b9295e84969 in QMetaObject::activate () from /usr/lib/libQtCore.so.4
#14 0x00002b92939dc7bb in QAbstractButton::clicked ()
   from /usr/lib/libQtGui.so.4
#15 0x00002b92937ade55 in ?? () from /usr/lib/libQtGui.so.4
#16 0x00002b92937af06b in ?? () from /usr/lib/libQtGui.so.4
#17 0x00002b92937af2ce in QAbstractButton::mouseReleaseEvent ()
   from /usr/lib/libQtGui.so.4
#18 0x00002b92934cb5d9 in QWidget::event () from /usr/lib/libQtGui.so.4
#19 0x00002b92937addff in QAbstractButton::event () from /usr/lib/libQtGui.so.4
#20 0x00002b92938489d3 in QPushButton::event () from /usr/lib/libQtGui.so.4
#21 0x00002b929347ed51 in QApplicationPrivate::notify_helper ()
   from /usr/lib/libQtGui.so.4
#22 0x00002b929347f949 in QApplication::notify () from /usr/lib/libQtGui.so.4
#23 0x00002b9295e73846 in QCoreApplication::notifyInternal ()
   from /usr/lib/libQtCore.so.4
#24 0x00002b9293489e73 in ?? () from /usr/lib/libQtGui.so.4
#25 0x00002b92934e4742 in ?? () from /usr/lib/libQtGui.so.4
#26 0x00002b92934e2239 in QApplication::x11ProcessEvent ()
   from /usr/lib/libQtGui.so.4
#27 0x00002b9293510599 in ?? () from /usr/lib/libQtGui.so.4
#28 0x00002b929a36afd3 in g_main_context_dispatch ()
   from /usr/lib/libglib-2.0.so.0
#29 0x00002b929a36e2dd in ?? () from /usr/lib/libglib-2.0.so.0
#30 0x00002b929a36e80e in g_main_context_iteration ()
   from /usr/lib/libglib-2.0.so.0
#31 0x00002b9295e9af4e in QEventDispatcherGlib::processEvents ()
   from /usr/lib/libQtCore.so.4
#32 0x00002b929350fe07 in ?? () from /usr/lib/libQtGui.so.4
#33 0x00002b9295e70b31 in QEventLoop::processEvents ()
   from /usr/lib/libQtCore.so.4
#34 0x00002b9295e70c86 in QEventLoop::exec () from /usr/lib/libQtCore.so.4
#35 0x00002b9295e73ffc in QCoreApplication::exec ()
   from /usr/lib/libQtCore.so.4
#36 0x00002b929347e928 in QApplication::exec () from /usr/lib/libQtGui.so.4
#37 0x00000000004b74dc in main (argc=1, argv=0x7fff181b5908)
    at /home/ale/dev/cpp/qgis/src/app/main.cpp:631

comment:5 by msieczka, 15 years ago

Milestone: Version 0.9.1Version 0.9.2

comment:6 by pcav, 15 years ago

Cc: marco.hugentobler@… venturato@… added

Given the frequent problems with the SPIT plugin, I think a different approach would be better:

  • replace ogr2ogr within the current SPIT plugin with the more robust shp2pgsql (please note however that this would impose a dependency on the client side of PostGIS), or
  • replace the current SPIT with a new plugin, possibly in python, as a thin wrapper to shp2pgsql

comment:7 by ha9016559, 15 years ago

Cc: marco.hugentobler@… venturato@… removed
Milestone: Version 0.9.2Version 0.9.1
Owner: changed from nobody to ha9016559
Platform: DebianWindows
Platform Version: Ubuntu Dapper amd64xp windows
Status: newassigned

i use the qgis in windows XP ,I AM USING the chinese type character set (tranditional),in my region,we use big5 and UTF8 code in our language,when i use the SPIT PLUGIN to import a shapfile with a chinese file name or chinese path name,after i push the "OK" button in the bottom-right area of form,the form frozen,after few secondes,the QGIS APPLICATION crash,and the MS-windows ERROR report dialog appear,before i PUSH the ok button,i add the shapfile,and the file instance in the workarea appear it's filename and path in the quene,but after i push the ok button the qgis crash,i can add a shapfile with a chinese file name or path in the add vector layer function,but when i use the SPIT to import the shapfile to POSTGRESQL/POSTGIS,it crash

comment:8 by msieczka, 15 years ago

Cc: marco.hugentobler@… venturato@… msieczka added
Milestone: Version 0.9.1Version 0.9.2
Owner: ha9016559 removed
Platform: WindowsAll
Platform Version: xp windows
Status: assignednew

ha9016559,

Thanks for confirming the bug on Windows. Please take more care when you modify the ticket's fields in future though. I've fixed it this time.

Cheers!

comment:9 by leolami, 15 years ago

It seems resolved in 0.9.2 Can you control and close it?

comment:10 by msieczka, 15 years ago

What do you mean by "it seems". Have you checked it?

For me SPIT still crashes when I press OK. And a probably related bug #903 is still present too.

Checked in the latest 0.9.2 SVN trunk r8210.

comment:11 by leolami, 15 years ago

Cc: lami@… added

comment:12 by jef, 15 years ago

Resolution: fixed
Status: newclosed

fixed in r8293

comment:13 by (none), 14 years ago

Milestone: Version 0.9.2

Milestone Version 0.9.2 deleted

Note: See TracTickets for help on using tickets.