[GRASS-dev] Re: strange for loop bug

Yann Chemin yann.chemin at gmail.com
Tue Apr 1 04:53:43 EDT 2008


Hi again,

Well, this was a gcc-4.3.1 20080321 version for Debian

I tried gcc-4.2.3 also for Debian and it crashed while giving the
processed pixel to outrast[col]...

Finally went to gcc-4.1.3 20080308 version for Debian (4.1.2-21) which
is working fine...

maybe of any use
Yann

On 01/04/2008, Yann Chemin <yann.chemin at gmail.com> wrote:
> Hello,
>
>  I am writing a raster module for image processing, and the
>  for(col=0;col<ncols;col++) loop behaves strangely (segfault), the
>  number of lines of code inside is 239 lines. If i reduce the number of
>  functions inside to a simple copy of an input raster, the number of
>  line being 15 less, then it does not seg fault.
>
>  The error is basically the variable col becoming a very large negative
>  number, which is constant for a compilation, may not be the same
>  actually in all modifications of the code tested.
>
>  The interesting thing is that it processes through 77 rows of Null
>  pixels (sending outrast[col] to G_set_d_null_value(..)) and when it
>  comes to the first real data processing, it gives the output value to
>  outrast[col], goes up the loop and at that moment, col passes from
>  1450 to -2085319823.
>
>  Anybody has any experience of similar event?
>  Any idea what could corrupt a for() loop variable?
>
>  I am also going to change gcc version in case it is a gcc bug.
>
>  Thank you,
>
> Yann
>


More information about the grass-dev mailing list