Bug report #756

crash creating new GRASS vector with on the fly projection enabled

Added by Maciej Sieczka - over 16 years ago. Updated over 14 years ago.

Status:Closed
Priority:Low
Assignee:nobody -
Category:GRASS
Affected QGIS version: Regression?:No
Operating System:Debian Easy fix?:No
Pull Request or Patch supplied: Resolution:fixed
Crashes QGIS or corrupts data: Copied to github as #:10815

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
#3905  0x00002aaab49fbc57 in [[QgsGrassEdit]]::transformLayerToMap ()
   from /usr/local/qgis08/bin/../lib/qgis/grassplugin.so
#3906  0x00002aaab49fbdc7 in [[QgsGrassEdit]]::displayDynamic ()
   from /usr/local/qgis08/bin/../lib/qgis/grassplugin.so
#3907  0x00002aaab4a00742 in [[QgsGrassEdit]]::startTool ()
   from /usr/local/qgis08/bin/../lib/qgis/grassplugin.so
#3908  0x00002aaab4a056d8 in [[QgsGrassEdit]]::init ()
   from /usr/local/qgis08/bin/../lib/qgis/grassplugin.so
#3909  0x00002aaab4a06f9a in [[QgsGrassEdit]]::QgsGrassEdit ()
   from /usr/local/qgis08/bin/../lib/qgis/grassplugin.so
#3910  0x00002aaab49e8d9e in [[QgsGrassPlugin]]::newVector ()
   from /usr/local/qgis08/bin/../lib/qgis/grassplugin.so
#3911  0x00002aaab4abbb7a in [[QgsGrassPlugin]]::qt_metacall ()
   from /usr/local/qgis08/bin/../lib/qgis/grassplugin.so
#3912  0x00002aaaab0b74db in QMetaObject::activate (sender=0x9af8b0,
    from_signal_index=9, to_signal_index=10, argv=0x0)
    at kernel/qobject.cpp:3080
#3913  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
#3914 0x00002aaaabb58455 in QMenuPrivate::activateAction (this=0x9b2200,
    action=0x9af8b0, action_e=QAction::Trigger, self=true)
    at widgets/qmenu.cpp:912
#3915 0x00002aaaab8438fa in QWidget::event (this=0x0, event=0x7fffffee7e10)
    at kernel/qwidget.cpp:6080
#3916 0x00002aaaabb56591 in QMenu::event (this=0x9b21d0, e=0x7fffffee7e10)
    at widgets/qmenu.cpp:2134
#3917 0x00002aaaab80012f in QApplicationPrivate::notify_helper (this=0x523410,
    receiver=0x9b21d0, e=0x7fffffee7e10) at kernel/qapplication.cpp:3558
#3918 0x00002aaaab803d88 in QApplication::notify (this=<value optimized out>,
    receiver=0x9b21d0, e=0x7fffffee7e10) at kernel/qapplication.cpp:3257
#3919 0x00002aaaab0a6440 in QCoreApplication::notifyInternal (
    this=0x7fffffee88b0, receiver=0x9b21d0, event=0x7fffffee7e10)
    at kernel/qcoreapplication.cpp:532
#3920 0x00002aaaab859e65 in QETWidget::translateMouseEvent (this=0x9b21d0,
    event=<value optimized out>) at qcoreapplication.h:205
#3921 0x00002aaaab85837c in QApplication::x11ProcessEvent (this=0x7b,
    event=0x7fffffee8400) at kernel/qapplication_x11.cpp:3024
#3922 0x00002aaaab87c9c2 in x11EventSourceDispatch (s=0x557b40, callback=0,
    user_data=0x0) at kernel/qguieventdispatcher_glib.cpp:137
#3923 0x00002aaaae589bfd in g_main_context_dispatch ()
   from /usr/lib/libglib-2.0.so.0
#3924 0x00002aaaae58cec5 in g_main_context_check ()
   from /usr/lib/libglib-2.0.so.0
#3925 0x00002aaaae58d374 in g_main_context_iteration ()
   from /usr/lib/libglib-2.0.so.0
#3926 0x00002aaaab0c8cfe in QEventDispatcherGlib::processEvents (this=0x5531d0,
    flags=@0x7fffffee86d0) at kernel/qeventdispatcher_glib.cpp:340
#3927 0x00002aaaab87c59f in QGuiEventDispatcherGlib::processEvents (this=0x0,
    flags=<value optimized out>) at kernel/qguieventdispatcher_glib.cpp:193
#3928 0x00002aaaab0a5da8 in QEventLoop::processEvents (
    this=<value optimized out>, flags=<value optimized out>)
    at kernel/qeventloop.cpp:141
#3929 0x00002aaaab0a5ef6 in QEventLoop::exec (this=0x7fffffee8770,
    flags=@0x7fffffee8780) at kernel/qeventloop.cpp:187
#3930 0x00002aaaab0a83f2 in QCoreApplication::exec ()
    at kernel/qcoreapplication.cpp:752
#3931 0x0000000000404afa in main ()

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

History

#1 Updated by Martin Dobias over 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.

#2 Updated by Maciej Sieczka - over 16 years ago

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

2. enable on the fly projection

3. save the project

4. quit qgis, start it again

5. load the project

6. Open mapset -> spearfish60/PERMANENT

7. Create new GRASS vector

8. 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
#3905  0xb6f80e0f in [[QgsMapRender]]::layerCoordsToOutputCoords ()
   from /usr/local/qgis09/lib/libqgis_core.so
#3906  0xb3144865 in [[QgsGrassEdit]]::transformLayerToMap ()
   from /usr/local/qgis09/lib/qgis/libgrassplugin.so
#3907  0xb3144a85 in [[QgsGrassEdit]]::displayDynamic ()
   from /usr/local/qgis09/lib/qgis/libgrassplugin.so
#3908  0xb3144c11 in [[QgsGrassEdit]]::eraseDynamic ()
   from /usr/local/qgis09/lib/qgis/libgrassplugin.so
#3909  0xb3148bb8 in [[QgsGrassEdit]]::startTool ()
   from /usr/local/qgis09/lib/qgis/libgrassplugin.so
#3910  0xb3149595 in [[QgsGrassEdit]]::newPoint ()
   from /usr/local/qgis09/lib/qgis/libgrassplugin.so
#3911  0xb3200ec5 in [[QgsGrassEdit]]::qt_metacall ()
   from /usr/local/qgis09/lib/qgis/libgrassplugin.so
#3912  0xb7e75d67 in QMetaObject::activate (sender=0x86e82f0,
    from_signal_index=5, to_signal_index=6, argv=<value optimized out>)
    at kernel/qobject.cpp:3080
#3913  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
#3914 0xb767933c in QAction::activate (this=0x86e82f0, event=QAction::Trigger)
    at kernel/qaction.cpp:1116
#3915 0xb7a48ad6 in QToolButton::nextCheckState (this=0x84e8020) at qaction.h:190
#3916 0xb7981455 in QAbstractButtonPrivate::click (this=0x86e8a90)
    at widgets/qabstractbutton.cpp:515
#3917 0xb79816af in QAbstractButton::mouseReleaseEvent (this=0x86e82c8,
    e=0xbfc210fc) at widgets/qabstractbutton.cpp:1102
#3918 0xb7a48a08 in QToolButton::mouseReleaseEvent (this=0x65, e=0x84e8020)
    at widgets/qtoolbutton.cpp:658
#3919 0xb76c39dd in QWidget::event (this=0x86e82c8, event=0xbfc210fc)
    at kernel/qwidget.cpp:6080
#3920 0xb79805a6 in QAbstractButton::event (this=0x86e82c8, e=0xbfc210fc)
    at widgets/qabstractbutton.cpp:1064
#3921 0xb7a48876 in QToolButton::event (this=0x65, e=0x65)
    at widgets/qtoolbutton.cpp:1075
#3922 0xb767ebe3 in QApplicationPrivate::notify_helper (this=0x82dc6e8,
    receiver=0x86e82c8, e=0xbfc210fc) at kernel/qapplication.cpp:3558
#3923 0xb7681ff8 in QApplication::notify (this=0xbfc21828, receiver=0x86e82c8,
    e=0xbfc210fc) at kernel/qapplication.cpp:3257
#3924 0xb7e64f64 in QCoreApplication::notifyInternal (this=0xbfc21828,
    receiver=0x86e82c8, event=0xbfc210fc) at kernel/qcoreapplication.cpp:532
#3925 0xb76dabd7 in QETWidget::translateMouseEvent (this=0x86e82c8,
    event=0xbfc2145c) at qcoreapplication.h:205
#3926 0xb76da4ab in QApplication::x11ProcessEvent (this=0xbfc21828,
    event=0xbfc2145c) at kernel/qapplication_x11.cpp:2917
#3927 0xb76fedab in x11EventSourceDispatch (s=0x82fe258, callback=0,
    user_data=0x65) at kernel/qguieventdispatcher_glib.cpp:137
#3928 0xb63268d6 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#3929 0xb6329996 in g_main_context_check () from /usr/lib/libglib-2.0.so.0
#3930 0xb6329e1e in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#3931 0xb7e883b5 in QEventDispatcherGlib::processEvents (this=0x82fb0e0,
    flags=@0xbfc21648) at kernel/qeventdispatcher_glib.cpp:340
#3932 0xb76fe957 in QGuiEventDispatcherGlib::processEvents (this=0x82fb0e0,
    flags=@0x84e6df8) at kernel/qguieventdispatcher_glib.cpp:193
#3933 0xb7e64873 in QEventLoop::processEvents (this=0x65, flags=@0x65)
    at kernel/qeventloop.cpp:141
#3934 0xb7e649b2 in QEventLoop::exec (this=0xbfc216e0, flags=@0xbfc216e8)
    at kernel/qeventloop.cpp:187
#3935 0xb7e66e29 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:752
#3936 0xb767e6c7 in QApplication::exec () at kernel/qapplication.cpp:3055
#3937 0x080dc6d2 in main ()

Another one:

1. load 'alaska' shapefile from QGIS sample dataset

2. enable on the fly projection

3. 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

#3 Updated by Maciej Sieczka - over 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.

#4 Updated by Martin Dobias over 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?

#5 Updated by Maciej Sieczka - over 16 years ago

Replying to [comment:4 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.

#6 Updated by Martin Dobias over 16 years ago

Replying to [comment:5 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

#7 Updated by leo-lami - over 16 years ago

In Linux Debian I have not this problem.

#8 Updated by Maciej Sieczka - over 16 years ago

Replying to [comment:6 wonder]:

Replying to [comment:5 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

#9 Updated by Maciej Sieczka - over 16 years ago

Replying to [comment:7 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?

#10 Updated by Maciej Sieczka - over 16 years ago

Replying to [comment:8 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).

#11 Updated by Martin Dobias about 16 years ago

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

The problem with new layer has been fixed in 4e0c7fee (SVN r8058).

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

#12 Updated by Anonymous over 14 years ago

Milestone Version 0.9.2 deleted

Also available in: Atom PDF