[GRASS-dev] g.mapsets -l crash (sometimes)

Markus Neteler neteler at osgeo.org
Mon Apr 13 02:55:20 EDT 2009


Huidae, all

(I have removed unused code in 6.40.svn and 6.5.svn to
simplify patching)

On Mon, Apr 13, 2009 at 5:42 AM, Huidae Cho <grass4u at gmail.com> wrote:
> Markus,
>
> If, for some reason, Path is empty, nchoices should be 0 and you should
> be fine. Also, PERMANENT and G_mapset can be intentionally removed from
> search list.

ok (I thought that PERMANENT is a must) - my hack was obviously
incorrect.

> I think Path buffer (4096 bytes) can be flooded because your mapset
> names are long.

Yes - I have at least 128 of these long names (running elaborations
on a cluster).

> If you used just the -l flag without any other flags or
> options, the number of mapsets also matters.  The mapset_name array can
> contain up to 256 (GMAPSET_MAX) mapset names.  In fact, GMAPSET_MAX is
> not the maximum number of mapsets, but the maximum length of the mapset
> name.

No good indeed - There can easily be more than 256 mapsets.

> I think these buffers should be dynamically allocated.

I have seen the trunk patch and locally backported it to 6.4.0svn
(my production environment). Works well, thanks! I'll send the patch to
you for 6.5.svn. If there are no objections, I'll then backport it to
6.4.0svn after a period of more testing.

Markus


More information about the grass-dev mailing list