[GRASSLIST:2334] Re: r.in.gdal : Unresolvable problems? -- Solved

Glynn Clements glynn.clements at virgin.net
Thu Jan 22 20:00:08 EST 2004


John Gillette wrote:

> For the record, what operating system and distribution
> are you using? (Linux/Redhat, etc?)
> I am wondering if segfaults occur on different systems.
> (for example Redhat>7 being different than 7).
> 
> I am still curious as to why Ben Logan got his problem fixed by
> CFLAGS=-g ./configure on Redhat 8.0.

There are three main reasons why bugs often "vanish" when disabling
optimisation:

1. It's a compiler bug which only applies when optimising (in my
experience, *most* compiler bugs only apply when optimising).

2. It's an aliasing bug in the code (which only matters when
optimising).

3. Optimisation tends to make stack frames smaller (as some local
variables can often be eliminated), increasing the likelyhood that a
buffer overrun will trash something important.

As compilers optimise more aggresively, bugs which vanish when
optimisation is disabled are likely to become more common. This is a
substantial nuisance, as you often need to disable optimisation in
order to realistically use a debugger.

-- 
Glynn Clements <glynn.clements at virgin.net>




More information about the grass-user mailing list