[QGIS-trac] Re: [Quantum GIS] #1878: remove setjmp/longjmp in grass plugin&provider and use exceptions instead

Quantum GIS qgis at qgis.org
Tue Jan 12 16:28:59 EST 2010


#1878: remove setjmp/longjmp in grass plugin&provider and use exceptions instead
-------------------------------------+--------------------------------------
        Reporter:  jef               |         Owner:  jef          
            Type:  patch             |        Status:  reopened     
        Priority:  minor: annoyance  |     Milestone:  Version 1.3.0
       Component:  GRASS             |       Version:  HEAD         
      Resolution:                    |      Keywords:               
Platform_version:                    |      Platform:  All          
        Must_fix:  No                |   Status_info:  0            
-------------------------------------+--------------------------------------
Comment (by jef):

 Replying to [comment:13 rblazek]:
 > Previous backtrace is probably invalid, maybe old core. The following
 backtrace makes sense ,QgsGrass::error_routine is called, exception is
 thrown but it is not caught and program is terminated by std::terminate().
 >
 {{{
 > #5  0x09859452 in std::terminate() () from /usr/lib/libstdc++.so.6
 > #6  0x09859591 in __cxa_throw () from /usr/lib/libstdc++.so.6
 > #7  0x02dd2042 in QgsGrass::error_routine (
 >     msg=0xbfb46078 "Unable to open vector map <fiumi_buf at pok> on level
 2. Try to rebuild vector topology by v.build.", fatal=1) at
 /home/radim/devel/qgis/src/providers/grass/qgsgrass.cpp:401
 > #8  0x07b412e4 in ?? () from /usr/lib/grass64/lib/libgrass_gis.so
 > #9  0x07b418f2 in G_fatal_error () from
 /usr/lib/grass64/lib/libgrass_gis.so
 > #10 0x058956d5 in ?? () from /usr/lib/grass64/lib/libgrass_vect.so
 > #11 0x05896225 in Vect__open_old () from
 /usr/lib/grass64/lib/libgrass_vect.so
 > #12 0x0589677c in Vect_open_old_head () from
 /usr/lib/grass64/lib/libgrass_vect.so
 > #13 0x044f3a43 in QgsGrassSelect::vectorLayers (gisdbase=...,
 location=..., mapset=..., mapName=...)
 >     at /home/radim/devel/qgis/src/plugins/grass/qgsgrassselect.cpp:416
 }}}
 >

 I get:

 {{{
 Debug:
 /home/fischer/src/qgis/qgis_unstable/src/providers/grass/qgsgrass.cpp:
 734: (vectors) mapsetPath = /home/fischer/test/grass/spearfish60/user1
 Debug:
 /home/fischer/src/qgis/qgis_unstable/src/plugins/grass/qgsgrassselect.cpp:
 340: (setLayers) setLayers()
 Debug:
 /home/fischer/src/qgis/qgis_unstable/src/providers/grass/qgsgrass.cpp:
 335: (setLocation) gisdbase = /home/fischer/test/grass location =
 spearfish60
 Debug:
 /home/fischer/src/qgis/qgis_unstable/src/plugins/grass/qgsgrassselect.cpp:
 432: (vectorLayers) GRASS vector successfully opened
 Debug:
 /home/fischer/src/qgis/qgis_unstable/src/plugins/grass/qgsgrassselect.cpp:
 340: (setLayers) setLayers()
 Debug:
 /home/fischer/src/qgis/qgis_unstable/src/providers/grass/qgsgrass.cpp:
 335: (setLocation) gisdbase = /home/fischer/test/grass location =
 spearfish60
 Debug:
 /home/fischer/src/qgis/qgis_unstable/src/providers/grass/qgsgrass.cpp:
 394: (error_routine) error_routine (fatal = 1): Unable to open vector map
 <fiumi_buf at user1> on level 2. Try to rebuild vector topology by v.build.
 Debug:
 /home/fischer/src/qgis/qgis_unstable/src/plugins/grass/qgsgrassselect.cpp:
 421: (vectorLayers) Cannot open GRASS vector: Unable to open vector map
 <fiumi_buf at user1> on level 2. Try to rebuild vector topology by v.build.
 }}}

 So it looks like the exception is thrown and catched.  But this is with
 r12751 - although I don't think that deriving from {{{QgsException}}}
 instead of {{{std::runtime_error}}} made it work.

-- 
Ticket URL: <http://trac.osgeo.org/qgis/ticket/1878#comment:14>
Quantum GIS <http://qgis.org>
Quantum GIS is an Open Source GIS viewer/editor supporting OGR, PostGIS, and GRASS formats


More information about the QGIS-trac mailing list