[GRASS5] Raster import bug

Carl Anderson candrsn at mindspring.com
Wed May 17 16:06:50 EDT 2000

Markus Neteler wrote:
> A severe bug is this:
> The r.in.png, r.in.tiff and r.in.ppm modules crash with
> segmentation faults only on Pentium processors! On AMD-K6
> the do their job. I tried around 20 Linux machines,
> aounrd 50% Pentium CPU = 50% failure. It seems to
> be a bug in the GRASS library, not in the modules.

I ran a test on an IBM 300PL (Pentium III 450Mhz, RH6.1+)
I also ran <top> in another terminal

r.in.tiff on a 62x109 pixel image 
before counting colors,
it allocated all free real memory and continued allocating 
until the allocation was so large as to be unmanageable 
and the process crashed
(on that machine with 64Mb real that was 216Mb)

At least for me the problem  is on line 283 and 296 of r.in.tiff.c
  tif_pos = ftell ((FILE*)tif); 
  fseek ((FILE *)tif, tif_pos, 0);
are probably the culprit.

if these lines are commented out the code works.

On other Raster notes

I am unable to project raster with more than 255 values (cats/range/...)
when using Sun Sparc CPU's

testing with the small included raster test_ag.tif

r.in.tiff input=test_ag.tif output=test nlev=7 
   generates an unprojectable raster (343 values)
r.in.tiff input=test_ag.tif output=test nlev=6
   generates a projectable raster (216 values)

r.proj fails while/just after allocating memory

of course there are workarounds import photo as bands, trim colors, ..

and while I'm at it r.compress is failing when I r.compress -u  ....
when used on Sun Sparc's

Carl Anderson 
Fulton County, Georgia
Environment & Community Development
404 730-8026
candrsn at fultonecd.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.zip
Type: application/x-zip-compressed
Size: 14382 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/grass-dev/attachments/20000517/8d7af03b/test.bin

More information about the grass-dev mailing list