Opened 17 years ago

Closed 16 years ago

Last modified 15 years ago

#756 closed bug (fixed)

crash creating new GRASS vector with on the fly projection enabled

Reported by: msieczka Owned by: nobody
Priority: critical: causes crash or data corruption Milestone:
Component: GRASS Version: Trunk
Keywords: Cc:
Must Fix for Release: Yes Platform: Debian
Platform Version: Ubuntu Dapper Awaiting user input: no

Description

  1. open an existing project
  2. GRASS -> Open mapset
  3. GRASS -> Create new GRASS vector
  4. segfault

bt:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 46912616557152 (LWP 17048)]
0x00002aaaad7c0ae0 in QgsMapLayer::coordinateTransform ()
   from /usr/local/qgis08/lib/libqgis_gui.so.1
(gdb) bt
#0  0x00002aaaad7c0ae0 in QgsMapLayer::coordinateTransform ()
   from /usr/local/qgis08/lib/libqgis_gui.so.1
#1  0x00002aaab49fbc57 in QgsGrassEdit::transformLayerToMap ()
   from /usr/local/qgis08/bin/../lib/qgis/grassplugin.so
#2  0x00002aaab49fbdc7 in QgsGrassEdit::displayDynamic ()
   from /usr/local/qgis08/bin/../lib/qgis/grassplugin.so
#3  0x00002aaab4a00742 in QgsGrassEdit::startTool ()
   from /usr/local/qgis08/bin/../lib/qgis/grassplugin.so
#4  0x00002aaab4a056d8 in QgsGrassEdit::init ()
   from /usr/local/qgis08/bin/../lib/qgis/grassplugin.so
#5  0x00002aaab4a06f9a in QgsGrassEdit::QgsGrassEdit ()
   from /usr/local/qgis08/bin/../lib/qgis/grassplugin.so
#6  0x00002aaab49e8d9e in QgsGrassPlugin::newVector ()
   from /usr/local/qgis08/bin/../lib/qgis/grassplugin.so
#7  0x00002aaab4abbb7a in QgsGrassPlugin::qt_metacall ()
   from /usr/local/qgis08/bin/../lib/qgis/grassplugin.so
#8  0x00002aaaab0b74db in QMetaObject::activate (sender=0x9af8b0,
    from_signal_index=9, to_signal_index=10, argv=0x0)
    at kernel/qobject.cpp:3080
#9  0x00002aaaab7fa036 in QAction::activated (this=0x0, _t1=-102)
    at moc_qaction.cpp:228
#10 0x00002aaaab7fa921 in QAction::activate (this=0x9af8b0,
    event=<value optimized out>) at kernel/qaction.cpp:1119
#11 0x00002aaaabb58455 in QMenuPrivate::activateAction (this=0x9b2200,
    action=0x9af8b0, action_e=QAction::Trigger, self=true)
    at widgets/qmenu.cpp:912
#12 0x00002aaaab8438fa in QWidget::event (this=0x0, event=0x7fffffee7e10)
    at kernel/qwidget.cpp:6080
#13 0x00002aaaabb56591 in QMenu::event (this=0x9b21d0, e=0x7fffffee7e10)
    at widgets/qmenu.cpp:2134
#14 0x00002aaaab80012f in QApplicationPrivate::notify_helper (this=0x523410,
    receiver=0x9b21d0, e=0x7fffffee7e10) at kernel/qapplication.cpp:3558
#15 0x00002aaaab803d88 in QApplication::notify (this=<value optimized out>,
    receiver=0x9b21d0, e=0x7fffffee7e10) at kernel/qapplication.cpp:3257
#16 0x00002aaaab0a6440 in QCoreApplication::notifyInternal (
    this=0x7fffffee88b0, receiver=0x9b21d0, event=0x7fffffee7e10)
    at kernel/qcoreapplication.cpp:532
#17 0x00002aaaab859e65 in QETWidget::translateMouseEvent (this=0x9b21d0,
    event=<value optimized out>) at qcoreapplication.h:205
#18 0x00002aaaab85837c in QApplication::x11ProcessEvent (this=0x7b,
    event=0x7fffffee8400) at kernel/qapplication_x11.cpp:3024
#19 0x00002aaaab87c9c2 in x11EventSourceDispatch (s=0x557b40, callback=0,
    user_data=0x0) at kernel/qguieventdispatcher_glib.cpp:137
#20 0x00002aaaae589bfd in g_main_context_dispatch ()
   from /usr/lib/libglib-2.0.so.0
#21 0x00002aaaae58cec5 in g_main_context_check ()
   from /usr/lib/libglib-2.0.so.0
#22 0x00002aaaae58d374 in g_main_context_iteration ()
   from /usr/lib/libglib-2.0.so.0
#23 0x00002aaaab0c8cfe in QEventDispatcherGlib::processEvents (this=0x5531d0,
    flags=@0x7fffffee86d0) at kernel/qeventdispatcher_glib.cpp:340
#24 0x00002aaaab87c59f in QGuiEventDispatcherGlib::processEvents (this=0x0,
    flags=<value optimized out>) at kernel/qguieventdispatcher_glib.cpp:193
#25 0x00002aaaab0a5da8 in QEventLoop::processEvents (
    this=<value optimized out>, flags=<value optimized out>)
    at kernel/qeventloop.cpp:141
#26 0x00002aaaab0a5ef6 in QEventLoop::exec (this=0x7fffffee8770,
    flags=@0x7fffffee8780) at kernel/qeventloop.cpp:187
#27 0x00002aaaab0a83f2 in QCoreApplication::exec ()
    at kernel/qcoreapplication.cpp:752
#28 0x0000000000404afa in main ()

QGIS 0.8.1 SVN 7174, built and running against QT 4.3.1 on 2.6.15-29-amd64-xeon.

Change History (13)

comment:1 by wonder, 16 years ago

Is this still a problem? If so, please provide more input about the mapset you're using, if possible provide backtrace with QGIS built with debug support.

comment:2 by msieczka, 16 years ago

Version: 0.8.1HEAD

Can't reproduce exactly this error, but I'm having other fun with QGIS-GRASS. Examples:

  1. load the 'alaska' shapefile from QGIS sample dataset
  1. enable on the fly projection
  1. save the project
  1. quit qgis, start it again
  1. load the project
  1. Open mapset -> spearfish60/PERMANENT
  1. Create new GRASS vector
  1. click any button in the GRASS Digit tool - segfault:
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1257109824 (LWP 13737)]
0xb6f7c3f2 in QgsMapLayer::srs () from /usr/local/qgis09/lib/libqgis_core.so
(gdb) bt
#0  0xb6f7c3f2 in QgsMapLayer::srs ()
   from /usr/local/qgis09/lib/libqgis_core.so
#1  0xb6f80e0f in QgsMapRender::layerCoordsToOutputCoords ()
   from /usr/local/qgis09/lib/libqgis_core.so
#2  0xb3144865 in QgsGrassEdit::transformLayerToMap ()
   from /usr/local/qgis09/lib/qgis/libgrassplugin.so
#3  0xb3144a85 in QgsGrassEdit::displayDynamic ()
   from /usr/local/qgis09/lib/qgis/libgrassplugin.so
#4  0xb3144c11 in QgsGrassEdit::eraseDynamic ()
   from /usr/local/qgis09/lib/qgis/libgrassplugin.so
#5  0xb3148bb8 in QgsGrassEdit::startTool ()
   from /usr/local/qgis09/lib/qgis/libgrassplugin.so
#6  0xb3149595 in QgsGrassEdit::newPoint ()
   from /usr/local/qgis09/lib/qgis/libgrassplugin.so
#7  0xb3200ec5 in QgsGrassEdit::qt_metacall ()
   from /usr/local/qgis09/lib/qgis/libgrassplugin.so
#8  0xb7e75d67 in QMetaObject::activate (sender=0x86e82f0,
    from_signal_index=5, to_signal_index=6, argv=<value optimized out>)
    at kernel/qobject.cpp:3080
#9  0xb7e7614e in QMetaObject::activate (sender=0x86e82f0, m=0x65,
    from_local_signal_index=1, to_local_signal_index=2, argv=0x65)
    at kernel/qobject.cpp:3159
#10 0xb7678ab9 in QAction::triggered (this=0x65, _t1=true)
    at moc_qaction.cpp:208
#11 0xb767933c in QAction::activate (this=0x86e82f0, event=QAction::Trigger)
    at kernel/qaction.cpp:1116
#12 0xb7a48ad6 in QToolButton::nextCheckState (this=0x84e8020) at qaction.h:190
#13 0xb7981455 in QAbstractButtonPrivate::click (this=0x86e8a90)
    at widgets/qabstractbutton.cpp:515
#14 0xb79816af in QAbstractButton::mouseReleaseEvent (this=0x86e82c8,
    e=0xbfc210fc) at widgets/qabstractbutton.cpp:1102
#15 0xb7a48a08 in QToolButton::mouseReleaseEvent (this=0x65, e=0x84e8020)
    at widgets/qtoolbutton.cpp:658
#16 0xb76c39dd in QWidget::event (this=0x86e82c8, event=0xbfc210fc)
    at kernel/qwidget.cpp:6080
#17 0xb79805a6 in QAbstractButton::event (this=0x86e82c8, e=0xbfc210fc)
    at widgets/qabstractbutton.cpp:1064
#18 0xb7a48876 in QToolButton::event (this=0x65, e=0x65)
    at widgets/qtoolbutton.cpp:1075
#19 0xb767ebe3 in QApplicationPrivate::notify_helper (this=0x82dc6e8,
    receiver=0x86e82c8, e=0xbfc210fc) at kernel/qapplication.cpp:3558
#20 0xb7681ff8 in QApplication::notify (this=0xbfc21828, receiver=0x86e82c8,
    e=0xbfc210fc) at kernel/qapplication.cpp:3257
#21 0xb7e64f64 in QCoreApplication::notifyInternal (this=0xbfc21828,
    receiver=0x86e82c8, event=0xbfc210fc) at kernel/qcoreapplication.cpp:532
#22 0xb76dabd7 in QETWidget::translateMouseEvent (this=0x86e82c8,
    event=0xbfc2145c) at qcoreapplication.h:205
#23 0xb76da4ab in QApplication::x11ProcessEvent (this=0xbfc21828,
    event=0xbfc2145c) at kernel/qapplication_x11.cpp:2917
#24 0xb76fedab in x11EventSourceDispatch (s=0x82fe258, callback=0,
    user_data=0x65) at kernel/qguieventdispatcher_glib.cpp:137
#25 0xb63268d6 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#26 0xb6329996 in g_main_context_check () from /usr/lib/libglib-2.0.so.0
#27 0xb6329e1e in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#28 0xb7e883b5 in QEventDispatcherGlib::processEvents (this=0x82fb0e0,
    flags=@0xbfc21648) at kernel/qeventdispatcher_glib.cpp:340
#29 0xb76fe957 in QGuiEventDispatcherGlib::processEvents (this=0x82fb0e0,
    flags=@0x84e6df8) at kernel/qguieventdispatcher_glib.cpp:193
#30 0xb7e64873 in QEventLoop::processEvents (this=0x65, flags=@0x65)
    at kernel/qeventloop.cpp:141
#31 0xb7e649b2 in QEventLoop::exec (this=0xbfc216e0, flags=@0xbfc216e8)
    at kernel/qeventloop.cpp:187
#32 0xb7e66e29 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:752
#33 0xb767e6c7 in QApplication::exec () at kernel/qapplication.cpp:3055
#34 0x080dc6d2 in main ()

Another one:

  1. load 'alaska' shapefile from QGIS sample dataset
  1. enable on the fly projection
  1. open mapset -> spearfish60/PERMANENT

Crash, no segfault. In GDB I get the following information: "thread_db_get_info: cannot get thread info: generic error". Full GDB session output below:

(gdb) run
Starting program: /usr/local/bin/qgis09
[Thread debugging using libthread_db enabled]
[New Thread -1256323392 (LWP 13713)]
warning: Lowest section in /usr/lib/libicudata.so.34 is .hash at 00000094
[New Thread -1259484240 (LWP 13716)]
[New Thread -1267876944 (LWP 13718)]
[Thread -1267876944 (LWP 13718) exited]
[New Thread -1276269648 (LWP 13719)]
[Thread -1276269648 (LWP 13719) exited]
Loaded /usr/local/qgis09/lib/qgis/libcopyrightlabelplugin.so
Loaded /usr/local/qgis09/lib/qgis/libdelimitedtextplugin.so
Loaded /usr/local/qgis09/lib/qgis/libdelimitedtextprovider.so
Loaded /usr/local/qgis09/lib/qgis/libgeorefplugin.so
Loaded /usr/local/qgis09/lib/qgis/libgpsimporterplugin.so
Loaded /usr/local/qgis09/lib/qgis/libgpxprovider.so
Loaded /usr/local/qgis09/lib/qgis/libgrassplugin.so
Loaded /usr/local/qgis09/lib/qgis/libgrassprovider.so
Loaded /usr/local/qgis09/lib/qgis/libgridmakerplugin.so
Loaded /usr/local/qgis09/lib/qgis/libnortharrowplugin.so
Loaded /usr/local/qgis09/lib/qgis/libogrprovider.so
Loaded /usr/local/qgis09/lib/qgis/libpggeoprocessingplugin.so
Loaded /usr/local/qgis09/lib/qgis/libpostgresprovider.so
Loaded /usr/local/qgis09/lib/qgis/libscalebarplugin.so
Loaded /usr/local/qgis09/lib/qgis/libspitplugin.so
Loaded /usr/local/qgis09/lib/qgis/libwfsplugin.so
Loaded /usr/local/qgis09/lib/qgis/libwfsprovider.so
Loaded /usr/local/qgis09/lib/qgis/libwmsprovider.so
[New Thread -1276269648 (LWP 13721)]
[New Thread -1267876944 (LWP 13722)]
[Thread -1276269648 (LWP 13721) exited]
[Thread -1267876944 (LWP 13722) exited]
SpatialRefSys/ProjectSRSProj4String: +proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs
thread_db_get_info: cannot get thread info: generic error

comment:3 by msieczka, 16 years ago

I forgot to add that I can reproduce this on two machines - one amd64 and one i386. I'm referring to fresh SVN checkout 7373, built and running against QT 4.3.1.

comment:4 by wonder, 16 years ago

Good news is that I can reproduce the first one, in fact it's sufficient for me just to enable projections, add new grass vector and push any digitizing button (no need to open/save alaska layer).

Worse news is that so far I don't know how to fix it correctly: if projections are enabled, points are being transformed from SRS of layer which doesn't exist yet in QGIS (thus the crash). But there are some limitations in plugin API that prevent finding out reference of layer which has been newly added...

Also I'm not able to reproduce the second case you're describing... can you build with debug information and paste more verbose output in console?

in reply to:  4 ; comment:5 by msieczka, 16 years ago

Replying to wonder:

Also I'm not able to reproduce the second case you're describing... can you build with debug information and paste more verbose output in console?

My QGIS is built with debug (by "CMAKE_BUILD_TYPE="Debug"; export CMAKE_BUILD_TYPE" before "cmake" - is that OK?). What I habe pasted is all it says.

in reply to:  5 ; comment:6 by wonder, 16 years ago

Replying to msieczka:

My QGIS is built with debug (by "CMAKE_BUILD_TYPE="Debug"; export CMAKE_BUILD_TYPE" before "cmake" - is that OK?). What I habe pasted is all it says.

AFAIK this will not work. I know about these possibilities:

  • set it in ccmake configuration utility
  • set it as argument for cmake: cmake -DCMAKE_BUILD_TYPE=Debug

comment:7 by leo.lami, 16 years ago

In Linux Debian I have not this problem.

in reply to:  6 ; comment:8 by msieczka, 16 years ago

Replying to wonder:

Replying to msieczka:

My QGIS is built with debug (by "CMAKE_BUILD_TYPE="Debug"; export CMAKE_BUILD_TYPE" before "cmake" - is that OK?). What I habe pasted is all it says.

AFAIK this will not work. I know about these possibilities:

  • set it in ccmake configuration utility
  • set it as argument for cmake: cmake -DCMAKE_BUILD_TYPE=Debug

Thansk fo the hint. This works.

Getting back to error case 2 - I still can reproduce it. On two machines - amd64 with QGIS 0.9.1 SVN 7389 built and running against QT 4.3.2, and the same SVN checkout on i386 against QT 4.3.1. After enabling debug there seems to be no any information more. Pasting few of the last QGIS words before the crash in GDB:

Debug: /home/shoofi/src/straight/qgis09/src/core/qgscoordinatetransform.cpp: 193: (initialise) Source/Dest SRS equal, shortcircuit is set.
Debug: /home/shoofi/src/straight/qgis09/src/core/qgsmaprender.cpp: 420: (splitLayersExtent) Getting extent of canvas in layers CS. Canvas is  = -2168511.5000000000000000,139013.4105197291355580 : 1492183.5000000000000000,2657088.6519802706316113
Debug: /home/shoofi/src/straight/qgis09/src/core/qgscoordinatetransform.cpp: 193: (initialise) Source/Dest SRS equal, shortcircuit is set.
Debug: /home/shoofi/src/straight/qgis09/src/providers/ogr/qgsogrprovider.cpp: 366: (select) Setting spatial filter using POLYGON ((-2168511.50000000 139013.41051973, -2168511.50000000 2657088.65198027, 1492183.50000000 2657088.65198027, 1492183.50000000 139013.41051973, -2168511.50000000 139013.41051973))
Debug: /home/shoofi/src/straight/qgis09/src/providers/ogr/qgsogrprovider.cpp: 322: (getNextFeature) Feature is null
Debug: /home/shoofi/src/straight/qgis09/src/core/qgsvectorlayer.cpp: 834: (draw) Total features processed is 661
Debug: /home/shoofi/src/straight/qgis09/src/core/qgsmaprender.cpp: 290: (render) Done rendering map layers
Debug: /home/shoofi/src/straight/qgis09/src/core/qgscoordinatetransform.cpp: 193: (initialise) Source/Dest SRS equal, shortcircuit is set.
Debug: /home/shoofi/src/straight/qgis09/src/core/qgsmaprender.cpp: 420: (splitLayersExtent) Getting extent of canvas in layers CS. Canvas is  = -2168511.5000000000000000,139013.4105197291355580 : 1492183.5000000000000000,2657088.6519802706316113
Debug: /home/shoofi/src/straight/qgis09/src/core/qgscoordinatetransform.cpp: 193: (initialise) Source/Dest SRS equal, shortcircuit is set.
Debug: /home/shoofi/src/straight/qgis09/src/core/qgsvectorlayer.cpp: 271: (drawLabels) Starting draw of labels
showProgress called with 1/1
Debug: /home/shoofi/src/straight/qgis09/src/core/qgsmaprender.cpp: 336: (render) Rendering done in (seconds): 0.413
QgsGrassPlugin::postRender()
Debug: /home/shoofi/src/straight/qgis09/src/gui/qgsmapcanvas.cpp: 530: (keyPressEvent) keyPress event
QgsGrassPlugin::openMapset()
QgsGrassSelect() type = 0
setMapsets()
setMaps()
setLayers()
setMapsets()
setMaps()
setLayers()
setMapsets()
setMaps()
setLayers()
QgsGrass::openMapset
gisdbase = /home/grassdata
location = spearfish60
mapset = PERMANENT
pid = 9650
thread_db_get_info: cannot get thread info: generic error

in reply to:  7 comment:9 by msieczka, 16 years ago

Replying to leo.lami:

In Linux Debian I have not this problem.

Are you referring to case 1, 2 or both?

Can you give more details about your platform: Debian version, architectire, QT release, QGIS SVN checkout?

in reply to:  8 comment:10 by msieczka, 16 years ago

Replying to msieczka:

Getting back to error case 2 - I still can reproduce it.

Update: I can reproduce it *only* in GDB. Outside GDB it does not crash at this point anymore (but it really used to in previous SVN revisoins). There is a noticable delay when I open the mapset still, but no crash anymore. At first I thought that building with debug 'fixed' this, but after re-building without debug and re-installing no crash anyway. Maybe I just missed something (or Elves are helping QGIS team to get rid of nasty bugs before 0.9.1 release).

comment:11 by msieczka, 16 years ago

Summary: crash creating new GRASS vectorcrash creating new GRASS vector with on the fly projection enabled

comment:12 by wonder, 16 years ago

Resolution: fixed
Status: newclosed

The problem with new layer has been fixed in r8057.

Since the second problem is unreproducible, I'm closing this ticket, file a new one if the bug arises again, open a new ticket.

Martin

comment:13 by (none), 15 years ago

Milestone: Version 0.9.2

Milestone Version 0.9.2 deleted

Note: See TracTickets for help on using tickets.