[GRASS-dev] Re: [GRASS GIS] #50: g.copy segfaults (debian.gfoss.it package) [and latest SVN]

GRASS GIS trac at osgeo.org
Sat Apr 12 21:25:39 EDT 2008


#50: g.copy segfaults (debian.gfoss.it package) [and latest SVN]
----------------------+-----------------------------------------------------
  Reporter:  steko    |       Owner:  grass-dev at lists.osgeo.org
      Type:  defect   |      Status:  new                      
  Priority:  major    |   Milestone:  6.4.0                    
 Component:  default  |     Version:  6.3.0 RCs                
Resolution:           |    Keywords:  g.copy                   
----------------------+-----------------------------------------------------
Comment (by glynn):

 Replying to [comment:11 glynn]:

 > As for possible solutions: one option is to change G_[l]stat() to
 allocate the "struct stat" with e.g. G_malloc().

 Drat. That isn't entirely safe, as the fields of "struct stat" may be at
 different offsets depending up the _FILE_OFFSET_BITS value. For the
 specific case of recursive_copy() on Linux, we'll get away with it, as
 it's only using the st_mode field, and that doesn't move.

 OTOH, for functions which only need to test for a directory, we could add
 e.g. G_is_directory(path) to libgis, which avoids having to deal with
 "struct stat" outside of libgis.

-- 
Ticket URL: <http://trac.osgeo.org/grass/ticket/50#comment:12>
GRASS GIS <http://grass.osgeo.org>
GRASS Geographic Information System (GRASS GIS) - http://grass.osgeo.org/


More information about the grass-dev mailing list