Re: [GRASS-dev] [GRASS-SVN] r60048 - grass/trunk/vector/v.in.db

2014-05-07 Thread Markus Metz
On Fri, May 2, 2014 at 11:19 PM, Huidae Cho gras...@gmail.com wrote: OK, I did a quick search and there are 104 calls to Vect_open_new. 63 calls don't check its return value and 41 calls check. 27 of the 41 that do the check do some cleaning work before finally throwing a fatal error. Most

Re: [GRASS-dev] [GRASS-SVN] r60048 - grass/trunk/vector/v.in.db

2014-05-05 Thread Glynn Clements
Huidae Cho wrote: BTW, I don't see Rast_open_old returning a negative value on failure as documented in the developer's manual. If this is clearly documented and fatal error is also mentioned, it would save unnecessary conditional checks against Rast_open_old. The 6.x versions

Re: [GRASS-dev] [GRASS-SVN] r60048 - grass/trunk/vector/v.in.db

2014-05-02 Thread Martin Landa
Hi, 2014-05-02 18:53 GMT+02:00 svn_gr...@osgeo.org: -Vect_open_new(Map, outvect-answer, with_z); +if (Vect_open_new(Map, outvect-answer, with_z) == -1) + exit(EXIT_FAILURE); + please provide more info where it fails. Also note that Vect_open_new calls G_fatal_error() so the

Re: [GRASS-dev] [GRASS-SVN] r60048 - grass/trunk/vector/v.in.db

2014-05-02 Thread Huidae Cho
Segmentation fault when you do v.in.db ... output=a@other_mapset because Vect_open_new returns -1 with a warning, not a fatal error, unable to create new ... is not the current mapset. I didn't check why it's returning -1 instead of throwing a fatal error in this case. I believe that this warning

Re: [GRASS-dev] [GRASS-SVN] r60048 - grass/trunk/vector/v.in.db

2014-05-02 Thread Huidae Cho
More detail.. When this happens, Map is not fully initialized and following Vect_* calls with Map can fail unexpectedly, which caused a segmentation fault in this case. On Fri, May 2, 2014 at 1:15 PM, Huidae Cho gras...@gmail.com wrote: Segmentation fault when you do v.in.db ...

Re: [GRASS-dev] [GRASS-SVN] r60048 - grass/trunk/vector/v.in.db

2014-05-02 Thread Huidae Cho
OK, I did a quick search and there are 104 calls to Vect_open_new. 63 calls don't check its return value and 41 calls check. 27 of the 41 that do the check do some cleaning work before finally throwing a fatal error. Most of the cleaning work is Vect_close(already open vectors), which I don't