#1284: 'v.vol.rst --help' fails
-----------------------+----------------------------------------------------
Reporter: torben | Owner: grass-dev@…
Type: defect | Status: new
Priority: normal | Milestone: 6.4.1
Component: Vector | Version: 6.4.0
Keywords: v.vol.rst | Platform: Linux
Cpu: x86-64 |
-----------------------+----------------------------------------------------
'v.vol.rst --help' fails with a 'buffer overflow' (cf. vvolrst_error.txt)
when 'g.region res3' is set to larger than 200 (in most cases). The error
depends on the value set to 'g.region res' (cf. vvolrstRes.csv).
The '-- help' shouldn't be related to anything, but it seems to me that
the defaul-value for 'dmin' is computed, when calling 'v.vol.rst'.
I tried to run it also on another machine with GRASS 6.4.1RC1, where it
started without any problems.
Here the debugger outputs.
{{{
GRASS 6.4.0 (spearfish60):~ > gdb v.vol.rst
GNU gdb (GDB) 7.1-ubuntu
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>\.\.\.
Reading symbols from /usr/lib/grass64/bin/v.vol.rst...(no debugging
symbols found)...done.
}}}
{{{
(gdb) bt full #0 0x00007ffff52b4a75 in raise () from /lib/libc.so.6
No symbol table info available. #1 0x00007ffff52b85c0 in abort () from /lib/libc.so.6
No symbol table info available. #2 0x00007ffff52ee4fb in ?? () from /lib/libc.so.6
No symbol table info available. #3 0x00007ffff5380217 in __fortify_fail () from /lib/libc.so.6
No symbol table info available. #4 0x00007ffff537f0d0 in __chk_fail () from /lib/libc.so.6
No symbol table info available. #5 0x00007ffff537e539 in ?? () from /lib/libc.so.6
No symbol table info available. #6 0x00007ffff52cd421 in __printf_fp () from /lib/libc.so.6
No symbol table info available. #7 0x00007ffff52c899e in vfprintf () from /lib/libc.so.6
No symbol table info available. #8 0x00007ffff537e5d9 in __vsprintf_chk () from /lib/libc.so.6
No symbol table info available. #9 0x00007ffff537e51f in __sprintf_chk () from /lib/libc.so.6
No symbol table info available. #10 0x0000000000405837 in main ()
No symbol table info available.
}}}
Crashes on my ~AMD64 machine too. Memory corruption? Can't check, as my
glibc (for some strange reason) lacks debug symbols and thus valgrind
doesn't work.
Will try to get some extra debugging info within today.
Markus, on my system there is a "SPLITDEBUG" feature + recompilation. I
migh be rm'ing debug data to free some disk space
Problem is here:
source:grass/branches/releasebranch_6_4/vector/v.vol.rst/main.c#L225
"dminchar" is defined to have length of 10, still on my system somtimes
"dmin" is longer than 10. Easy workaround - bump up dminchar to anything
large enough (1000). Correct solution - analyze code and see if it's
required at all.
{{{
sprintf(dminchar, "%lf", dmin);
}}}
Replying to [comment:5 marisn]:
> Problem is here:
source:grass/branches/releasebranch_6_4/vector/v.vol.rst/main.c#L225
> "dminchar" is defined to have length of 10, still on my system somtimes
"dmin" is
> longer than 10. Easy workaround - bump up dminchar to anything large
enough (1000).
buffer size increased in all branches with r45906-8.