[GRASS-dev] [grass-code I][431] g.copy segmentation fault

Glynn Clements glynn at gclements.plus.com
Wed Jul 25 16:03:52 EDT 2007


Volker Wichmann wrote:

> > You will need to provide more detailed information, i.e. the complete
> > backtrace at the point of the segfault and the values of any relevant
> > variables.
> >
> 
> I did a backtrace, placed a break point a few lines before the crash and 
> did a re-run. Here is the output:

> Seems to me that path and path2 are corrupted?

No; they're both NUL-terminated. When printing the contents of a
char[], gdb prints the entire array; it doesn't stop at the first NUL.

> What I'm also unsure about is why line 35 is entered while stepping 
> through the code - a gdb issue I can forget about?

The code was compiled with optimisation enabled (the default CFLAGS
are '-g -O2'), so the object code doesn't directly correspond to the
source code.

It might help if you re-compile the general/manage directory without
optimisation, e.g.:

	make -C general/manage clean
	make -C general/manage CFLAGS1='-g'

That will certainly make it easier to debug; OTOH, it might simply
make the bug disappear.

-- 
Glynn Clements <glynn at gclements.plus.com>




More information about the grass-dev mailing list