[GRASS-dev] [GRASS GIS] #111: r.los error "r.los.exe there are encountered to problem and needs to close"

#111: r.los error "r.los.exe there are encountered to problem and needs to close"
----------------------------+-----------------------------------------------
Reporter: gsancho | Owner: grass-dev@lists.osgeo.org
     Type: defect | Status: new
Priority: major | Milestone: 6.4.0
Component: default | Version: unspecified
Keywords: wingrass r.los |
----------------------------+-----------------------------------------------
Hello.

I have a problem with the operation r.los in winGrass(native). I have been
testing different maps and when a distance is greater than 80-100 pixels
(map pixels) a system error is thrown.

To put an example, in spearfish data base and the elevation.dem map, grass
fails from 2524m on up (with the height of the observer set to 1m)

The command would be:
r.los input=elevation.dem output=los coordinate=599505,4921010
max_dis=2525

The error that is reported is a system error: "r.los.exe there are
encountered to problem and needs to close"

Thanks and regards.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/111&gt;
GRASS GIS <http://grass.osgeo.org>
GRASS Geographic Information System (GRASS GIS) - http://grass.osgeo.org/

#111: r.los error "r.los.exe there are encountered to problem and needs to close"
----------------------+-----------------------------------------------------
  Reporter: gsancho | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 6.4.0
Component: default | Version: unspecified
Resolution: | Keywords: wingrass r.los
----------------------+-----------------------------------------------------
Changes (by 4everskiff):

* cc: marco.pasetti@alice.it (added)

Comment:

Replying to [ticket:111 gsancho]:
> Hello.
>
> I have a problem with the operation r.los in winGrass(native). I have
been testing different maps and when a distance is greater than 80-100
pixels (map pixels) a system error is thrown.
>
> To put an example, in spearfish data base and the elevation.dem map,
grass fails from 2524m on up (with the height of the observer set to 1m)
>
> The command would be:
> r.los input=elevation.dem output=los coordinate=599505,4921010
max_dis=2525
>
> The error that is reported is a system error: "r.los.exe there are
encountered to problem and needs to close"
>
> Thanks and regards.

Hi,

I checked the command on WinGRASS-6.3.0RC6 (WinXP). It's the same for me.
BTW, the error seems to be not related to WinGRASS, but to the map in use
or to the module as cross-platform error (maybe related to the dimension
of data to be processed?). For example, I launched the command on another
raster dem map (with a resolution of 20m) with dist set to 3000, and it
works fine, while it fails with 3001!
Could someone test it also on linux or mac?

Thank you

Marco

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/111#comment:1&gt;
GRASS GIS <http://grass.osgeo.org>
GRASS Geographic Information System (GRASS GIS) - http://grass.osgeo.org/

#111: r.los error "r.los.exe there are encountered to problem and needs to close"
----------------------+-----------------------------------------------------
  Reporter: gsancho | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 6.4.0
Component: default | Version: unspecified
Resolution: | Keywords: wingrass r.los
----------------------+-----------------------------------------------------
Comment (by mlennert):

I cannot confirm this on Debian GNU/Linux with recent svn, so it seems to
be win-specific.

Moritz

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/111#comment:2&gt;
GRASS GIS <http://grass.osgeo.org>
GRASS Geographic Information System (GRASS GIS) - http://grass.osgeo.org/

#111: r.los error "r.los.exe there are encountered to problem and needs to close"
----------------------+-----------------------------------------------------
  Reporter: gsancho | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 6.4.0
Component: default | Version: 6.3.0 RCs
Resolution: | Keywords: wingrass r.los
----------------------+-----------------------------------------------------
Changes (by 4everskiff):

  * version: unspecified => 6.3.0 RCs

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/111#comment:3&gt;
GRASS GIS <http://grass.osgeo.org>
GRASS Geographic Information System (GRASS GIS) - http://grass.osgeo.org/

#111: r.los fails in WinGRASS with high values for max_dis parameter
----------------------+-----------------------------------------------------
  Reporter: gsancho | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 6.4.0
Component: default | Version: 6.3.0
Resolution: | Keywords: wingrass r.los
----------------------+-----------------------------------------------------
Changes (by 4everskiff):

  * version: 6.3.0 RCs => 6.3.0
  * summary: r.los error "r.los.exe there are encountered to problem and
              needs to close" => r.los fails in WinGRASS with
              high values for max_dis parameter

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/111#comment:4&gt;
GRASS GIS <http://grass.osgeo.org>

#111: r.los fails in WinGRASS with high values for max_dis parameter
----------------------+-----------------------------------------------------
  Reporter: gsancho | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 6.4.0
Component: default | Version: 6.3.0
Resolution: | Keywords: wingrass r.los
----------------------+-----------------------------------------------------
Comment (by marcopx):

I tested it on my new Vista build (on Windows Vista Home Premium).

The reported sample command line worked fine for me.

I also tried with other command inputs (but with the same input dem and
coordinates) and always worked fine.

I'll wait positive feedbacks from XP to close the ticket.

Marco

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/111#comment:5&gt;
GRASS GIS <http://grass.osgeo.org>

#111: r.los fails in WinGRASS with high values for max_dis parameter
---------------------------+------------------------------------------------
  Reporter: gsancho | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 6.4.0
Component: Raster | Version: 6.3.0
Resolution: | Keywords: wingrass r.los
  Platform: MSWindows XP | Cpu: x86-32
---------------------------+------------------------------------------------
Changes (by aborruso):

  * platform: => MSWindows XP
  * component: default => Raster
  * cpu: => x86-32

Comment:

I tested it on winxp sp3, and it crashes.

This is my command:
r.los input=DEM@andrea output=tr_vis coordinate=300877,4213602
obs_elev=1.75 max_dist=5000

I use GRASS 6.3.0 (2008) downloaded from:
http://grass.osgeo.org/grass63/binary/mswindows/native/WinGRASS-6.3.0-4-Setup.exe

Andrea

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/111#comment:6&gt;
GRASS GIS <http://grass.osgeo.org>

#111: r.los fails in WinGRASS with high values for max_dis parameter
---------------------------+------------------------------------------------
  Reporter: gsancho | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 6.4.0
Component: Raster | Version: svn-develbranch6
Resolution: | Keywords: wingrass r.los
  Platform: MSWindows XP | Cpu: x86-32
---------------------------+------------------------------------------------
Changes (by neteler):

  * version: 6.3.0 => svn-develbranch6

Comment:

I have tried r.los with valgrind on Linux 64bit (GRASS 7):

{{{
# Spearfish60
g.region -dp
CMD="r.los in=elevation.dem output=tr_vis coordinate=599490,4920855
max_dist=10000"
valgrind --tool=memcheck --leak-check=yes --show-reachable=yes $CMD --o
...
Using maximum distance from the viewing point (meters): 10000.000000
==15765== Invalid read of size 8
==15765== at 0x403616: hidden_point_elimination (pts_elim.c:107)
==15765== by 0x403B0E: segment (segment.c:81)
==15765== by 0x402B41: main (main.c:330)
==15765== Address 0xb062d90 is 24 bytes inside a block of size 40 free'd
==15765== at 0x4C2006F: free (vg_replace_malloc.c:323)
==15765== by 0x503A4A9: G_free (alloc.c:129)
==15765== by 0x401D5B: delete (delete.c:39)
==15765== by 0x40357E: hidden_point_elimination (pts_elim.c:166)
==15765== by 0x403B0E: segment (segment.c:81)
==15765== by 0x402B41: main (main.c:330)
==15765==
==15765== Invalid read of size 1
==15765== at 0x4C21FC0: memcpy (mc_replace_strmem.c:402)
==15765== by 0x4E2619E: segment_get (get.c:49)
==15765== by 0x403885: find_inclination (pts_elim.c:291)
==15765== by 0x40336E: hidden_point_elimination (pts_elim.c:94)
==15765== by 0x403B0E: segment (segment.c:81)
==15765== by 0x402B41: main (main.c:330)
==15765== Address 0xafdcc77 is 1 bytes before a block of size 76,320
alloc'd
==15765== at 0x4C2136E: malloc (vg_replace_malloc.c:207)
==15765== by 0x503A34E: G__malloc (alloc.c:41)
==15765== by 0x4E26E71: segment_setup (setup.c:64)
==15765== by 0x4E26431: segment_init (init.c:75)
==15765== by 0x40264E: main (main.c:257)
...
==15765== Invalid read of size 1
==15765== at 0x4C21FDC: memcpy (mc_replace_strmem.c:402)
==15765== by 0x4E2619E: segment_get (get.c:49)
==15765== by 0x403885: find_inclination (pts_elim.c:291)
==15765== by 0x4033B2: hidden_point_elimination (pts_elim.c:99)
==15765== by 0x403B0E: segment (segment.c:81)
==15765== by 0x402B41: main (main.c:330)
==15765== Address 0xafdcc74 is 4 bytes before a block of size 76,320
alloc'd
==15765== at 0x4C2136E: malloc (vg_replace_malloc.c:207)
==15765== by 0x503A34E: G__malloc (alloc.c:41)
==15765== by 0x4E26E71: segment_setup (setup.c:64)
==15765== by 0x4E26431: segment_init (init.c:75)
==15765== by 0x40264E: main (main.c:257)
  100%
==15765==
==15765== Conditional jump or move depends on uninitialised value(s)
==15765== at 0x5498B4E: (within /lib64/libz.so.1.2.3)
==15765== by 0x549949C: (within /lib64/libz.so.1.2.3)
==15765== by 0x549A06F: deflate (in /lib64/libz.so.1.2.3)
==15765== by 0x504A97C: G_zlib_compress (flate.c:339)
==15765== by 0x504A650: G_zlib_write (flate.c:213)
==15765== by 0x5064BC9: write_data_compressed (put_row.c:217)
==15765== by 0x5064FC9: put_fp_data (put_row.c:333)
==15765== by 0x50659AB: put_raster_data (put_row.c:633)
==15765== by 0x50662E0: put_raster_row (put_row.c:848)
==15765== by 0x5064907: G_put_raster_row (put_row.c:144)
==15765== by 0x402D5E: main (main.c:381)
==15765==
==15765== Conditional jump or move depends on uninitialised value(s)
==15765== at 0x5498B5B: (within /lib64/libz.so.1.2.3)
==15765== by 0x549949C: (within /lib64/libz.so.1.2.3)
==15765== by 0x549A06F: deflate (in /lib64/libz.so.1.2.3)
==15765== by 0x504A97C: G_zlib_compress (flate.c:339)
==15765== by 0x504A650: G_zlib_write (flate.c:213)
...
==15765==
==15765== ERROR SUMMARY: 284197 errors from 21 contexts (suppressed: 3
from 1)
==15765== malloc/free: in use at exit: 448,984 bytes in 10,702 blocks.
==15765== malloc/free: 291,268 allocs, 280,566 frees, 142,519,073 bytes
allocated.
==15765== For counts of detected errors, rerun with: -v
==15765== searching for pointers to 10,702 not-freed blocks.
==15765== checked 2,792,248 bytes.
==15765==
==15765==
==15765== 795 bytes in 72 blocks are definitely lost in loss record 1 of 5
==15765== at 0x4C2136E: malloc (vg_replace_malloc.c:207)
==15765== by 0x503A34E: G__malloc (alloc.c:41)
==15765== by 0x505633B: G__location_path (location.c:77)
==15765== by 0x50562A6: G_location_path (location.c:57)
==15765== by 0x5051ECB: G__gisinit (gisinit.c:57)
==15765== by 0x401E14: main (main.c:87)
==15765==
==15765==
==15765== 1,024 bytes in 1 blocks are definitely lost in loss record 2 of
5
==15765== at 0x4C1F144: calloc (vg_replace_malloc.c:397)
==15765== by 0x503A3CC: G__calloc (alloc.c:74)
==15765== by 0x50609B6: G_recreate_command (parser.c:2468)
==15765== by 0x505339D: G_command_history (history.c:257)
==15765== by 0x402EF7: main (main.c:414)
==15765==
==15765==
==15765== 6,380 bytes in 3 blocks are still reachable in loss record 3 of
5
==15765== at 0x4C1F144: calloc (vg_replace_malloc.c:397)
==15765== by 0x503A3CC: G__calloc (alloc.c:74)
==15765== by 0x505BFF6: G_parser (parser.c:795)
==15765== by 0x401FEE: main (main.c:133)
==15765==
==15765==
==15765== 16,016 bytes in 3 blocks are still reachable in loss record 4 of
5
==15765== at 0x4C2136E: malloc (vg_replace_malloc.c:207)
==15765== by 0x503A445: G__realloc (alloc.c:109)
==15765== by 0x5048375: set_env (env.c:172)
==15765== by 0x5048136: read_env (env.c:114)
==15765== by 0x504882F: G__getenv (env.c:337)
==15765== by 0x5048771: G_getenv (env.c:289)
==15765== by 0x5056297: G_location (location.c:37)
==15765== by 0x5056300: G__location_path (location.c:75)
==15765== by 0x50562A6: G_location_path (location.c:57)
==15765== by 0x5051ECB: G__gisinit (gisinit.c:57)
==15765== by 0x401E14: main (main.c:87)
==15765==
==15765==
==15765== 424,769 bytes in 10,623 blocks are still reachable in loss
record 5 of 5
==15765== at 0x4C2136E: malloc (vg_replace_malloc.c:207)
==15765== by 0x503A34E: G__malloc (alloc.c:41)
==15765== by 0x506FDE0: G_store (strings.c:83)
==15765== by 0x506402D: G_set_program_name (progrm_nme.c:52)
==15765== by 0x5051E92: G__gisinit (gisinit.c:51)
==15765== by 0x401E14: main (main.c:87)
==15765==
==15765== LEAK SUMMARY:
==15765== definitely lost: 1,819 bytes in 73 blocks.
==15765== possibly lost: 0 bytes in 0 blocks.
==15765== still reachable: 447,165 bytes in 10,629 blocks.
==15765== suppressed: 0 bytes in 0 blocks.
}}}

I have no idea if that's acceptable or not.

Markus

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/111#comment:7&gt;
GRASS GIS <http://grass.osgeo.org>

#111: r.los fails in WinGRASS with high values for max_dis parameter
---------------------------+------------------------------------------------
  Reporter: gsancho | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 6.4.0
Component: Raster | Version: svn-develbranch6
Resolution: | Keywords: wingrass r.los
  Platform: MSWindows XP | Cpu: x86-32
---------------------------+------------------------------------------------
Comment (by hamish):

another report of it:
http://lists.osgeo.org/pipermail/grass-windows/2008-November/001587.html

----
Benjamin Ducke wrote on the -dev list:
{{{
Michael,

this is a problem with dirty memory allocation that never got fixed.
On some systems, like Linux, the memory manager is a bit more "relaxed"
and lets this pass. On Windows, it's more strict and kills
the application. The crashes appear a bit random which is typical for
memory allocation problems. The more allocations involved (read: the
bigger
you set max_dist), the more probable it becomes that a sensitive memory
region gets corrupted and the program bails out.

If anyone wants to have a go at it: use Valgrind on Linux. It will tell
you exactly where the bad allocations happen. I actually had a go at this
years ago and it was quite easy to fix, but lost my notes in the meantime.

From memory: the problem can be fixed by delaying the release of memory
allocated at the start of each run through the main loop.

I have attached a file "delete3.c" from r.cva for which I fixed the same
problem.
I believe this file is identical to the version that r.los uses except for
the
changes I made. Look for the string "DELAYED". You should find my comments
and
additions. Replicate them for r.los and you _should_ be OK (provided there
were
no substantial changes to r.los since I wrote my fixed).

In main.c, the following has to be added towards the top of the file:

   if (G_parser (argc, argv))
        exit(EXIT_FAILURE);

   G_sleep_on_error (0);

   /* initialize delayed point deletion */
   DELAYED_DELETE = NULL;

And this toward the end:

   /* release that last tiny bit of memory ... */
   if ( DELAYED_DELETE != NULL ) {
       G_free ( DELAYED_DELETE );
   }

   return (0);
}

Unfortunately, I don't have the time to look into this myself at the
moment.
Sorry for not being of more help. This is a long-standing, very annoying
issue
that needs fixing urgently. It's embarassing to have such a basic tool
fail in
this way.

Cheers,

Ben
}}}

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/111#comment:8&gt;
GRASS GIS <http://grass.osgeo.org>

#111: r.los fails in WinGRASS with high values for max_dis parameter
---------------------------+------------------------------------------------
  Reporter: gsancho | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 6.4.0
Component: Raster | Version: svn-develbranch6
Resolution: | Keywords: wingrass r.los
  Platform: MSWindows XP | Cpu: x86-32
---------------------------+------------------------------------------------
Comment (by neteler):

Consider to replace r.los with r.viewshed after fixing #390

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/111#comment:9&gt;
GRASS GIS <http://grass.osgeo.org>

#111: r.los fails in WinGRASS with high values for max_dis parameter
---------------------------+------------------------------------------------
  Reporter: gsancho | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 6.4.0
Component: Raster | Version: svn-develbranch6
Resolution: | Keywords: wingrass r.los
  Platform: MSWindows XP | Cpu: x86-32
---------------------------+------------------------------------------------
Comment (by hamish):

{{{
OK. I have replicated the memory allocation changes from r.cva.
It seems to run without bad allocs now. I cannot confirm that
it no longer crashes on Windows. Someone with a Windows GRASS
setup will need to do that.

The patch also contains a fix done by Mark Lake years ago that
never made it back into r.los. It fixes a problem with calculating
cell neighbourhoods in combination with raster masks (see. pts_elim.c).

Ben
}}}

applied to devbr6 in r36160.

in quick testing it looks like the MASK problem remains unfixed.
(man page example)

Hamish

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/111#comment:10&gt;
GRASS GIS <http://grass.osgeo.org>

#111: r.los fails in WinGRASS with high values for max_dis parameter
---------------------------+------------------------------------------------
  Reporter: gsancho | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 6.4.0
Component: Raster | Version: svn-develbranch6
Resolution: | Keywords: wingrass r.los
  Platform: MSWindows XP | Cpu: x86-32
---------------------------+------------------------------------------------
Comment (by neteler):

Compiling the updated code with
{{{
MYCFLAGS="-g -Wall -fno-common"
MYCXXFLAGS="-g -Wall"
MYLDFLAGS="-Wl,--no-undefined"
LDFLAGS="$MYLDFLAGS" CFLAGS="$MYCFLAGS" CXXFLAGS="$MYCXXFLAGS" ./configure
...
}}}

leads to this problem:
{{{
gcc -L/home/neteler/grass64/dist.x86_64-unknown-linux-gnu/lib -Wl,--no-
undefined -Wl,--export-dynamic
-L/usr/lib64 -Wl,-rpath-link,/home/neteler/grass64/dist.x86_64-unknown-
linux-gnu/lib -o /home/neteler/grass64/dist.x86_64-unknown-linux-
gnu/bin/r.los OBJ.x86_64-unknown-linux-gnu/color_rnge.o
OBJ.x86_64-unknown-linux-gnu/delete.o OBJ.x86_64-unknown-linux-gnu/main.o
OBJ.x86_64-unknown-linux-gnu/make_list.o OBJ.x86_64-unknown-linux-
gnu/make_point.o OBJ.x86_64-unknown-linux-gnu/mark_pts.o OBJ.x86_64-
unknown-linux-gnu/pts_elim.o
OBJ.x86_64-unknown-linux-gnu/segment.o -lgrass_segment
-lgrass_gis -lgrass_datetime -lz -lgrass_gproj -lgrass_gis
-lgrass_datetime -lz -lproj -L/usr/local/lib -lgdal -lgrass_gis
-lgrass_datetime -lz -lm -lz
OBJ.x86_64-unknown-linux-gnu/main.o: In function `main':
/home/neteler/grass64/raster/r.los/main.c:60: multiple definition of
`DELAYED_DELETE'
OBJ.x86_64-unknown-linux-
gnu/delete.o:/home/neteler/grass64/raster/r.los/delete.c:26: first defined
here
OBJ.x86_64-unknown-linux-gnu/make_list.o: In function `make_list':
/home/neteler/grass64/raster/r.los/make_list.c:24: multiple definition of
`DELAYED_DELETE'
OBJ.x86_64-unknown-linux-
gnu/delete.o:/home/neteler/grass64/raster/r.los/delete.c:26: first defined
here
OBJ.x86_64-unknown-linux-gnu/mark_pts.o: In function
`mark_visible_points':
/home/neteler/grass64/raster/r.los/mark_pts.c:24: multiple definition of
`DELAYED_DELETE'
OBJ.x86_64-unknown-linux-
gnu/delete.o:/home/neteler/grass64/raster/r.los/delete.c:26: first defined
here
OBJ.x86_64-unknown-linux-gnu/pts_elim.o: In function
`hidden_point_elimination':
/home/neteler/grass64/raster/r.los/pts_elim.c:53: multiple definition of
`DELAYED_DELETE'
OBJ.x86_64-unknown-linux-
gnu/delete.o:/home/neteler/grass64/raster/r.los/delete.c:26: first defined
here
OBJ.x86_64-unknown-linux-gnu/segment.o: In function `segment':
/home/neteler/grass64/raster/r.los/segment.c:24: multiple definition of
`DELAYED_DELETE'
OBJ.x86_64-unknown-linux-
gnu/delete.o:/home/neteler/grass64/raster/r.los/delete.c:26: first defined
here
collect2: ld returned 1 exit status
make: *** [/home/neteler/grass64/dist.x86_64-unknown-linux-gnu/bin/r.los]
Error 1
}}}

Attached patch cures it. Ok to submit?

Markus

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/111#comment:11&gt;
GRASS GIS <http://grass.osgeo.org>

#111: r.los fails in WinGRASS with high values for max_dis parameter
---------------------------+------------------------------------------------
  Reporter: gsancho | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 6.4.0
Component: Raster | Version: svn-develbranch6
Resolution: | Keywords: wingrass r.los
  Platform: MSWindows XP | Cpu: x86-32
---------------------------+------------------------------------------------
Comment (by neteler):

It crashes Linux (I have a 64bit box, using latest version of r.los):

{{{
GRASS 6.5.svn (patUTM32): > r.los pat_dtm_5m out=lavarone_viewshed_los
coordinate=676769.91,5091720.66 obs_elev=42 max=30000
Using maximum distance from the viewing point (meters): 30000.000000
18%
Segmentation fault

GRASS 6.5.svn (patUTM32): > g.region -p
projection: 1 (UTM)
zone: 32
datum: wgs84
ellipsoid: wgs84
north: 5103410
south: 5084090
west: 653990
east: 684010
nsres: 10
ewres: 10
rows: 1932
cols: 3002
cells: 5799864
}}}

will post a gdb bt.

Markus

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/111#comment:12&gt;
GRASS GIS <http://grass.osgeo.org>

#111: r.los fails in WinGRASS with high values for max_dis parameter
---------------------------+------------------------------------------------
  Reporter: gsancho | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 6.4.0
Component: Raster | Version: svn-develbranch6
Resolution: | Keywords: wingrass r.los
  Platform: MSWindows XP | Cpu: x86-32
---------------------------+------------------------------------------------
Comment (by neteler):

Replying to [comment:11 neteler]:
> Attached patch cures it. Ok to submit?

Submitted in r36179, r36180, r36181.

now hunting the segfault...

Markus

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/111#comment:13&gt;
GRASS GIS <http://grass.osgeo.org>

#111: r.los fails in WinGRASS with high values for max_dis parameter
---------------------------+------------------------------------------------
  Reporter: gsancho | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 6.4.0
Component: Raster | Version: svn-develbranch6
Resolution: | Keywords: wingrass r.los
  Platform: MSWindows XP | Cpu: x86-32
---------------------------+------------------------------------------------
Comment (by neteler):

Here the backtrace of the segfault:
{{{
GRASS 6.5.svn (patUTM32):~ > gdb r.los
GNU gdb 6.8-2mdv2009.0 (Mandriva Linux release 2009.0)
...
This GDB was configured as "x86_64-mandriva-linux-gnu"...

(gdb) r pat_dtm_5m out=lavarone_viewshed_los
coordinate=676769.91,5091720.66 obs_elev=42 max=30000 --o
Starting program: /home/neteler/grass64/dist.x86_64-unknown-linux-
gnu/bin/r.los pat_dtm_5m out=lavarone_viewshed_los
coordinate=676769.91,5091720.66 obs_elev=42 max=30000 --o
[Thread debugging using libthread_db enabled]
Using maximum distance from the viewing point (meters): 30000.000000
   25%
Program received signal SIGSEGV, Segmentation fault.
0x00007f8586b9c345 in memcpy () from /lib64/libc.so.6
(gdb) bt full
#0 0x00007f8586b9c345 in memcpy () from /lib64/libc.so.6
No symbol table info available.
#1 0x00007f858856319f in segment_get (SEG=0x7fff9097cf80,
buf=0x7fff9097b99c, row=-1, col=2277)
     at get.c:49
         index = -2908
         n = 3
         i = 0
#2 0x0000000000403a2d in find_inclination (x=0, y=1169, viewpt_elev=1381,
seg_in_p=0x7fff9097cf80,
     row_viewpt=1168, col_viewpt=2277, docurv=0, ellps_a=6.
9273684732832797e-310) at pts_elim.c:300
         del_x = 0
         del_y = 1169
         dist = 11690
         picked_pt_elev = 1290.72095
#3 0x0000000000403567 in hidden_point_elimination (head=0x461f0b0,
viewpt_elev=1381,
     seg_in_p=0x7fff9097cf80, seg_out_p=0x7fff9097cf40,
seg_patt_p=0x7fff9097cf00, quadrant=2,
     sign_on_y=1, sign_on_x=-1, row_viewpt=1168, col_viewpt=2277,
patt_flag=0, docurv=0,
     ellps_a=6.9273684732832797e-310) at pts_elim.c:99
         CHECKED_PT = (struct point *) 0x36f88b0
         BLOCKING_PT = (struct point *) 0x3706e30
         orientation_neighbor_1 = 1.5716524909692637
         orientation_neighbor_2 = 1.5707963267948966
         inclination_neighbor_1 = -0.0077292142003704354
         inclination_neighbor_2 = -0.0079553153874519812
         interpolated_inclination = 3.6327397940754172e-316
         correct_neighbor_inclination = -0.0073442512349566561
         correct_neighbor_orientation = 1.5716532246142985
         correct_neighbor_x = -1
         correct_neighbor_y = 1167
         neighbor_1_y = 1168
         neighbor_1_x = -1
         neighbor_2_x = 0
         neighbor_2_y = 1169
         uu = 0
         vv = 1
         mask = 1
#4 0x0000000000403cb7 in segment (segment_no=5, xmax=1168, ymax=2277,
slope_1=0, slope_2=0.5, flip=1,
     sign_on_y=1, sign_on_x=-1, viewpt_elev=1381, seg_in_p=0x7fff9097cf80,
seg_out_p=0x7fff9097cf40,
     seg_patt_p=0x7fff9097cf00, row_viewpt=1168, col_viewpt=2277,
patt_flag=0, docurv=0,
     ellps_a=6.9273684732832797e-310) at segment.c:81
         lower_limit_y = 0
         upper_limit_y = 0
         less = 0
         x = 0
         y = -1
         x_actual = 0
         y_actual = 1
         x_flip = 0
         y_flip = 1
         head = (struct point *) 0x461f0b0
         PRESENT_PT = (struct point *) 0x5094270
         quadrant = 2
#5 0x0000000000402cdf in main (argc=7, argv=0x7fff9097d3d8) at main.c:328
         row_viewpt = 1168
         col_viewpt = 2277
         nrows = 1932
         ncols = 3002
         a = 2277
         b = 1168
         row = 1932
         patt_flag = 0
         segment_no = 5
         flip = 1
         xmax = 1168
         ymax = 2277
         sign_on_y = 1
         sign_on_x = -1
         submatrix_rows = 484
         submatrix_cols = 751
         lenth_data_item = 4
         patt = 0
         in_fd = 8
         out_fd = 9
         patt_fd = 0
         old = 6
         new = 7
         slope_1 = 0
         slope_2 = 0.5
         max_vert_angle = 0
         color_factor = 6.9532634621160482e-310
         old_mapset = 0x2079260 "PERMANENT"
         patt_mapset = 0x0
         value = (FCELL *) 0x7fff9097cfc8
         search_mapset = 0x404020 ""
         current_mapset = 0x7f858855ca40 "neteler"
         in_name = 0x2078f90
"/4/grassdata/patUTM32/neteler/.tmp/localhost/16164.2"
         out_name = 0x2078fd0
"/4/grassdata/patUTM32/neteler/.tmp/localhost/16164.3"
         patt_name = 0x0
         cats = {ncats = 0, num = 0, title = 0x0, fmt = 0x7f85889529c8 "",
m1 = -1.16239034e-34,
   a1 = 4.57453884e-41, m2 = -1.1265745e-34, a2 = 4.57453884e-41, q =
{truncate_only = -2005476696,
     round_only = 32645, defaultDRuleSet = 0, defaultCRuleSet = 1,
infiniteLeftSet = -2003535648,
     infiniteRightSet = 32645, cRangeSet = 9, maxNofRules = 0, nofRules =
39,
     defaultDMin = 2.0410903428666442e-314, defaultDMax = 6.
9273683755280439e-310,
     defaultCMin = -2035152548, defaultCMax = 32645, infiniteDLeft = 6.
9531436082581805e-310,
     infiniteDRight = 3.1892036252181633e-316, infiniteCLeft = -1869098656,
infiniteCRight = 32767,
     dMin = 6.9532634621109099e-310, dMax = 6.92736690931413e-310, cMin =
0, cMax = 0,
     table = 0x7f8588947a00, fp_lookup = {vals = 0x7f85889514b8, rules =
0x400fe8, nalloc = -2035101336,
       active = 32645, inf_dmin = 2.0732931236830403e-317, inf_dmax = 2.
1219957909652723e-314,
       inf_min = 1989, inf_max = 1}}, labels = 0x7f8588952d20, marks =
0x7f858897e358,
   nalloc = -1869098208, last_marked_rule = 32767}
         cellhd_elev = {format = -1, compressed = 1, rows = 19509, rows3 =
19509, cols = 23522,
   cols3 = 23522, depths = 1, proj = 1, zone = 32, ew_res = 5, ew_res3 = 5,
ns_res = 5, ns_res3 = 5,
   tb_res = 1, north = 5157086, south = 5059541, east = 730098, west =
612488, top = 1, bottom = 0}
         cellhd_patt = {format = 0, compressed = 0, rows = -2005476696,
rows3 = 32645, cols = 23,
   cols3 = 0, depths = -2005476696, proj = 32645, zone = 23, ew_res = 6.
927368471377372e-310,
   ew_res3 = 1.1363509854348671e-322, ns_res = 6.92736847137421e-310,
ns_res3 = 7.4109846876186982e-323,
   tb_res = 1.9268560187808615e-322, north = 1.5065906837361573e-314, south
= 6.927368375482738e-310,
   east = 7.4109846876186982e-323, west = 6.9273684713750005e-310, top = 8.
3991159793011913e-323,
   bottom = 1.9268560187808615e-322}
         cell = (CELL *) 0x7fff9097d418
         fcell = (FCELL *) 0x2079330
         data = 4.57453884e-41
         viewpt_elev = 1381.43994
         seg_in = {open = 1, nrows = 1932, ncols = 3002, len = 4, srows =
484, scols = 751,
   size = 1453936, spr = 4, spill = 749, fd = 8, scb = 0x2079010, nseg = 4,
cur = 0, offset = 20}
         seg_out = {open = 1, nrows = 1932, ncols = 3002, len = 4, srows =
484, scols = 751,
   size = 1453936, spr = 4, spill = 749, fd = 9, scb = 0x20ada80, nseg = 4,
cur = 1, offset = 20}
         seg_patt = {open = -2035101336, nrows = 32645, ncols =
-2005511248, len = 32645, srows = 0,
   scols = 0, size = -2005476696, spr = 32645, spill = 4198278, fd = 0, scb
= 0x7f85889478e0, nseg = 9,
   cur = 0, offset = 39}
         heads = {0x20fee70, 0x2a40bf0, 0x38a09f0, 0x4619eb0, 0x7c96f087,
0x7f858876df24, 0x7f8586b20b18,
   0x7, 0x1f25bc2, 0x7fff9097cee0, 0x7fff9097d068, 0x7f8586b20b50, 0x0,
0x7f8588946f18, 0x7f85889514b8,
   0x7f85887656dc}
         SEARCH_PT = (struct point *) 0x7f8587a881e0
         module = (struct GModule *) 0x7f858855cf20
         opt1 = (struct Option *) 0x7f858855ce80
         opt2 = (struct Option *) 0x2078450
         opt3 = (struct Option *) 0x2078380
         opt5 = (struct Option *) 0x2078520
         opt6 = (struct Option *) 0x20785f0
         opt7 = (struct Option *) 0x20782b0
         curvature = (struct Flag *) 0x7f858855ce40
         history = {
   mapid =
"��\227\220�\177\000\000\000\000\000\000\000\000\000\000���\205\205\177\000\000\001\000\000\000\000\000\000\000\000�\224\210\205\177\000\000�\002w\210\205\177",
'\0' <repeats 26 times>, "�!w\210\205\177\000",
   title =
"0�\227\220�\177\000\000\000\000\000\000\000\000\000\000`�\224\210\205\177\000\000\002\vw\210\205\177\000\000�\031\225\210\205\177\000\000��\224\210\205\177\000\000\000�\224\210\205\177\000\000\000\020\225\210\205\177\000\000�\024\225\210\205\177\000\000��\224\210\205\177\000",
   mapset = '\0' <repeats 16 times>,
"���\205\205\177\000\000\001\000\000\000\000\000\000\000\000�\224\210\205\177\000\000\000\000@y/!��\000\000VC�\020\v�\000�\016\000\000\000\000\000��\016\000\000\000\000\000��\016\000\000\000\000",
   creator = "\000\000\000\000\000\000\000\000\005", '\0' <repeats 15
times>,
"0�\227\220�\177\000\000��\227\220�\177\000\000\000\000\000\000\000\000\000\0008�D\206\205\177\000\000\004\000\000\000\000\000\000\000�\t\225\210\205\177\000\000�\002w\210\205\177\000",
   maptype = "\000\000\000\000\000\000\000\000X]!", '\0' <repeats 13
times>,
"�!w\210\205\177\000\0000�\227\220�\177\000\000\000\000\000\000\000\000\000\000��\227\220�\177\000\000\002\vw\210\205\177\000\000�\024\225\210\205\177\000\000(\005\230\210\205\177\000",
   datsrc_1 = '\0' <repeats 16 times>,
"\020�\227\220�\177\000\000�\b�\205\205\177\000\000\000\000@�/!��\000\000\000\000\000\000\000\0008�D\206\205\177\000\000\004\000\000\000\000\000\000\000�\t\225\210\205\177\000\000\000\000`{/!��",
   datsrc_2 = "\000\000VC�\020\v�n-linux-
gnu/lib/libgcc_sX][\204\205\177\000\0000�\227\220�\177\000\000��\227\220�\177\000\000\030\000\000\000\000\000\000\000@4j\206\205\177\000\000\000\000\000\000\000\000\000",
   keywrd = "
\005\225\210\205\177\000\000�\002w\210\205\177\000\000\000\000\000\000\000\000\000\000\020�\227\220\003",
'\0' <repeats 11 times>,
"�!w\210\205\177\000\0000�\227\220�\177\000\000p\002w\210\205\177\000\000o�\227\220�\177\000\000\000\000\000\000\000\000\000",
edlinecnt = -2003514440, edhist = {
"\205\177\000\000\002\vw\210\205\177\000\000\000�\224\210\205\177\000\000\000�\224\210\205\177\000\000\000\020\225\210\205\177\000\000��\224\210\205\177\000\000�\024\225\210\205\177\000\000\000\000\000\000\000\000\000\000@4j\206\205\177\000\000\000\000\000\000\000\000\000\000
\005\225\210",
"\205\177\000\000\000\000`}/!��\000\000VC�\020\v�0�\227\220�\177\000\000��\227\220�\177\000\000\000\000\000\000\000\000\000\000\b|\221\206\205\177\000\000\001\000\000\000\000\000\000\000X\000\225\210\205\177\000\000�\002w\210\205\177\000\000\000\000\000",
"\000\000\000\000��v\210\205\177\000\000\000\000\000\000\000\000\000\000�!w\210\205\177\000\0000�\227\220�\177\000\000p\002w\210\205\177\000\000o�\227\220�\177\000\000`�\227\220�\177\000\000X�\227\220�\177\000\0008\v\230\210\205\177\000\000\001\000\000",
     '\0' <repeats 12 times>,
"��\227\220�\177\000\000\002\vw\210\205\177\000\000�\024\225\210\205\177\000\000\000\000\000\000\000\000\000\000\b|\221\206\205\177\000\000\001\000\000\000\000\000\000\000X\000\225\210\205\177\000\000\000\000
\177/!��\000\000VC",
"�\020\v�0�\227\220�\177\000\000��\227\220�\177\000\000\000\000\000\000\000\000\000\000���\206\205\177\000\000\001\000\000\000\000\000\000\000�\031\225\210\205\177\000\000�\002w\210\205\177\000\000\000\000\000\000\000\000\000\000\001\000\000\000\005\000\000\000\000\000\000",
"\000\000\000\000�!w\210\205\177\000\0000�\227\220�\177\000\000p\002w\210\205\177\000\000o�\227\220�\177\000\000`�\227\220�\177\000\000X�\227\220�\177\000\0008\v\230\210\205\177\000\0008W!",
'\0' <repeats 13 times>, "��\227\220",
"�\177\000\000\002\vw\210\205\177\000\000\000�\224\210\205\177\000\000�\024\225\210\205\177\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000�\031\225\210\205\177\000\000\000\000�\200/!��\000\000VC�\020\v�\b\000\000\000\000\000\000\000P�td",
"\004\000\000\000\\?\001\000\000\000\000\000\\?\001\000\000\000\000\000\\?\001\000\000\000\000\000$\005\000\000\000\000\000\000$\005\000\000\000\000\000\000\004\000\000\000\000\000\000\000Q�td\006",
'\0' <repeats 22 times>,
"\000\000\000\0000�\227\220�\177\000\000��\227\220�\177\000\000\020\000\000\000\000\000\000\000`{�\206\205\177\000\000\000\000\000\000\000\000\000\000�\024\225\210\205\177\000\000\000\000\000\000\000\000\000\000��\227\220�\177\000\000\002\vw\210\205\177\000\000�\024\225\210",
"\205\177\000\000(\005\230\210\205\177\000\000\000\000\000\000\000\000\000\000p\002w\210\205\177\000\000o�\227\220�\177\000\000`�\227\220�\177\000\000X�\227\220�\177\000\0008\v\230\210\205\177\000\000\bC\v�\202\b\t\b\000\000\000\000\000\000\000\000�\001\207\v",
"a\204\226�7%�\206\205\177\000\000\000\000@�/!��\020\000\000\000\000\000\000\000`{�\206\205\177\000\000\000\000\000\000\000\000\000\000�\024\225\210\205\177\000\000\000\000`\203/!��\000\000VC�\020\v�+\000\000\000.\000\000\000/\000\000",
"2\000\000\0003\000\000\0005\000\000\000\000\000\000\0006\000\000\0000�\227\220�\177\000\000��\227\220�\177\000\000\230\000\000\000\000\000\000\000�\r\020\207\205\177",
'\0' <repeats 11 times>,
"\020\225\210\205\177\000\000�\002w\210\205\177\000\000\000\000\000",
     '\0' <repeats 12 times>,
"��\227\220�\177\000\000\002\vw\210\205\177\000\000\001\000\000\000�\177\000\000(\005\230\210\205\177\000\000\200�\227\220�\177\000\000\000\000\000\000\000\000\000\0007%�\206\205\177\000\000\a\nw\210\205\177\000\000(\005\230\210",
"\205\177\000\000\000\000\000\000\000\000\000\000X\000\000\000\000\000\000\000(\030�\206\205\177\000\000\000\000@�/!��\230\000\000\000\000\000\000\000�\r\020\207\205\177",
'\0' <repeats 11 times>,
"\020\225\210\205\177\000\000\000\000`\205/!��\000\000VC",
"�\020\v�\000\000\000\000`\000\000\000b\000\000\000c\000\000\0000�\227\220�\177\000\000��\227\220�\177\000\000\000\000\000\000\000\000\000\000�L\236\207\205\177\000\000\021\000\000\000\000\000\000\000�)\225\210\205\177\000\000�\002w\210\205\177\000\000\000\000\000",
     '\0' <repeats 20 times>,
"�!w\210\205\177\000\0000�\227\220�\177\000\000p\002w\210\205\177\000\000o�\227\220�\177\000\000`�\227\220�\177\000\000X�\227\220�\177\000\000\000\000\000\000\000\000\000\000��\227\220",
     "�\177\000\000\002\vw\210\205\177\000\000�\024\225\210\205\177",
'\0' <repeats 12 times>,
"@�/!��\000\000\000\000\000\000\000\000�L\236\207\205\177\000\000\021\000\000\000\000\000\000\000�)\225\210\205\177\000\000\000\000@\207/!��\000\000VC",
"�\020\v�\000\000\000\000\000\000\000\000�L\236\207\205\177\000\000\020\000\000\000\000\000\000\000�)\225\210\205\177\000\000\000\000�\207/!��\000\000VC�\020\v�\000\000\000\000\000\000\000\000�L\236\207\205\177\000\000\016\000\000\000\000\000\000\000�)\225\210",
"\205\177\000\000\000\000\000\210/!��\000\000VC�\020\v�\000\000\000\000\000\000\000\000�L\236\207\205\177\000\000\r\000\000\000\000\000\000\000�)\225\210\205\177\000\000\000\000`\210/!��\000\000VC�\020\v�\000\000\000\000\000\000\000\000\000�\224\210",
"\205\177\000\000\002\vw\210\205\177\000\000\001\000\000\000\205\177\000\000��\224\210\205\177\000\000��\227\220�\177\000\000\000\000\000\000\000\000\000\000�G\033\207\205\177\000\000\a\nw\210\205\177\000\000\001\000\000\000\205\177\000\000\000�\224\210\205\177\000\000��\227\220",
"�\177\000\000\000\000\000\000\000\000\000\000�G\033\207\205\177\000\000\a\nw\210\205\177\000\000\001\000\000\000\205\177\000\000x�\224\210\205\177\000\000\000�\227\220�\177\000\000\000\000\000\000\000\000\000\000�G\033\207\205\177\000\000\a\nw\210\205\177\000\000\001\000\000",
"\205\177\000\000��\224\210\205\177\000\0000�\227\220�\177\000\000\000\000\000\000\000\000\000\000�G\033\207\205\177\000\000\a\nw\210\205\177\000\000\001\000\000\000\205\177\000\000\000�\224\210\205\177\000\000`�\227\220�\177\000\000\000\000\000\000\000\000\000\000\230G\033\207",
"\205\177\000\000\a\nw\210\205\177\000\000\001\000\000\000\205\177\000\000\220�\224\210\205\177\000\000\220�\227\220�\177\000\000\000\000\000\000\000\000\000\000\212G\033\207\205\177\000\000\a\nw\210\205\177\000\000\001\000\000\000\205\177\000\000��\224\210\205\177\000\000��\227\220",
"�\177\000\000\000\000\000\000\000\000\000\000|G\033\207\205\177\000\000\a\nw\210\205\177\000\000\001\000\000\000\205\177\000\000\000�\224\210\205\177\000\000��\227\220�\177\000\000\000\000\000\000\000\000\000\000lG\033\207\205\177\000\000\a\nw\210\205\177\000\000\001\000\000",
     "\205\177\000\000\210�\224\210\205\177\000\000
�\227\220�\177\000\000\000\000\000\000\000\000\000\000\\G\033\207\205\177\000\000\a\nw\210\205\177\000\000\001\000\000\000\205\177\000\000��\224\210\205\177\000\000P�\227\220�\177\000\000\000\000\000\000\000\000\000\000MG\033\207",
"\205\177\000\000\a\nw\210\205\177\000\000\001\000\000\000\205\177\000\000\000�\224\210\205\177\000\000\200�\227\220�\177\000\000\000\000\000\000\000\000\000\000=G\033\207\205\177\000\000\a\nw\210\205\177\000\000\001\000\000\000\0000\205��\t\225\210\205\177\000\000��\227\220",
"�\177\000\000\000\000\000\000\000\000\000\000+G\033\207\205\177\000\000\a\nw\210\205\177\000\000\001\000\000\000\204\001\2011
\005\225\210\205\177\000\000��\227\220�\177\000\000\000\000\000\000\000\000\000\000\035G\033\207\205\177\000\000\a\nw\210\205\177\000\000\001\000\000",
"\017�\204�X\000\225\210\205\177\000\000\020�\227\220�\177\000\000\000\000\000\000\000\000\000\000\rG\033\207\205\177\000\000\a\nw\210\205\177\000\000X\000\225\210\205\177\000\000
\005\225\210\205\177\000\000�\t\225\210\205\177\000\000\000�\224\210\205\177\000\000��\224\210",
"\205\177\000\000\210�\224\210\205\177\000\000\000�\224\210\205\177\000\000��\224\210\205\177\000\000\220�\224\210\205\177\000\000\000�\224\210\205\177\000\000\030�\227\210\205\177\000\000��\224\210\205\177\000\000�\031\225\210\205\177\000\000x�\224\210\205\177\000\000\000�\224\210",
"\205\177\000\000\000\020\225\210\205\177\000\000��\224\210\205\177\000\000�\024\225\210\205\177\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\000%\225\210\205\177\000\000\000\000@\217/!��\000\000VC�\020\v�0�\227\220�\177\000\000��\227\220",
"�\177\000\000\000\000\000\000\000\000\000\000\210@�\207\205\177\000\000\006\000\000\000\000\000\000\000\000
\225\210\205\177\000\000�\002w\210\205\177", '\0' <repeats 26 times>,
"�!w\210\205\177\000\0000�\227\220",
"�\177\000\000p\002w\210\205\177\000\000o�\227\220�\177\000\000`�\227\220�\177\000\000X�\227\220�\177\000\000\177\222w\210\205\177\000\000\030\003",
'\0' <repeats 14 times>,
"��\227\220�\177\000\000\002\vw\210\205\177\000\000\000\020\225\210",
"\205\177\000\000�\024\225\210\205\177\000\000\000\000\000\000\000\000\000\000\006\000\000\000\000\000\000\000\000
\225\210\205\177\000\000\000\000\000\221/!��\000\000VC�\020\v�8\002\000\000\000\000\000\0008\002\000\000\000\000\000\0008\002\000\000\000\000\000\000
\000\000",
"\000\000\000\0000�\227\220�\177\000\000��\227\220�\177\000\000\020\000\000\000\000\000\000\000P\226\016\210\205\177\000\000\000\000\000\000\000\000\000\000\030�\227\210\205\177\000\000�\002w\210\205\177\000\000\000\000\000\000\000\000\000\000\004\000\000\000\000\000\000\000\000\000\000",
"\000\000\000\000�!w\210\205\177\000\0000�\227\220�\177\000\000p\002w\210\205\177\000\000o�\227\220�\177\000\000\000\000\000\000\000\000\000\000\220\037\225\210\205\177\000\000\002\vw\210\205\177\000\000\000�\227\210\205\177\000\000
�\227\210\205\177\000\000\030�\227\210",
"\205\177\000\000\000%\225\210\205\177\000\000�)\225\210\205\177\000\000\000\020\225\210\205\177\000\000�\024\225\210\205\177\000\000\000\000\000\000\000\000\000\000\030�\227\210\205\177\000\000\000\000\000\223/!��\000\000VC�\020\v�0�\227\220�\177\000\000��\227\220",
"�\177\000\0000\000\000\000\000\000\000\000(0/\210\205\177\000\000\000\000\000\000\000\000\000\000
�\227\210\205\177\000\000�\002w\210\205\177", '\0' <repeats 14 times>,
"\036", '\0' <repeats 11 times>, "�!w\210\205\177\000\0000�\227\220",
"�\177\000\000p\002w\210\205\177\000\000o�\227\220�\177\000\000`�\227\220�\177\000\000X�\227\220�\177\000\0008\v\230\210\205\177\000\000a�\000��S\200\030\000\000\000\000\000\000\000\000��\227\220�\177\000\000\002\vw\210\205\177\000\000�\024\225\210",
"\205\177\000\000\000\000\000\000\000\000\000\000(0/\210\205\177\000\000\000\000\000\000\000\000\000\000
�\227\210\205\177\000\000\000\000�\224/!��\000\000VC�\020\v�\000\000\000\000\000\000\000\000�\201U\210\205\177\000\000\004\000\000\000\000\000\000\000\000�\227\210",
     "\205\177\000\000�\002w\210\205\177", '\0' <repeats 26 times>,
"�!w\210\205\177\000\0000�\227\220�\177\000\000p\002w\210\205\177\000\000o�\227\220�\177\000\000`�\227\220�\177\000\000X�\227\220",
"�\177\000\0008\v\230\210\205\177\000\0000�\227\220�\177\000\000\000\000\000\000\000\000\000\000o�\227\220�\177\000\000\000\000\000\000\000\000\000\000��\227\220�\177\000\000\002\vw\210\205\177\000\000�\024\225\210\205\177",
'\0' <repeats 11 times>, "�\227\210",
"\205\177\000\000\000\000`\226/!��\000\000VC�\020\v�\000\000\000\000\000\000\000\000�\201U\210\205\177\000\000\003\000\000\000\000\000\000\000\000�\227\210\205\177\000\000\000\000�\226/!��\000\000VC�\020\v�\b\0
---Type <return> to continue, or q <return> to quit---
00\000\000\000\000\000\000R�td",
"\004\000\000\0000�\227\220�\177\000\000��\227\220�\177\000\000\000\000\000\000\000\000\000\000�Fv\210\205\177\000\000\003\000\000\000\000\000\000\000\030�\227\210\205\177\000\000�\002w\210\205\177",
'\0' <repeats 14 times>, "\002\000\000\000\000\000\000",
     '\0' <repeats 12 times>,
"�\036\225\210\205\177\000\000\002\vw\210\205\177\000\000\001\000\000\000�\177\000\000�\031\225\210\205\177\000\000@�\227\220�\177\000\000\000\000\000\000\000\000\000\000\207�/\210\205\177\000\000\a\nw\210\205\177\000\000\030�\227\210",
     "\205\177\000\000
�\227\210\205\177\000\000\000\020\225\210\205\177\000\000�\031\225\210\205\177\000\000�\024\225\210\205\177\000\000\000\000\000\000\000\000\000\000\030�\227\210\205\177\000\000\000\000�\230/!��\000\000VC�\020\v�B�\203�٤X\002\b\004\020@",
     "\a\020\004\002\220@\"\000
\032\020\002\031\004F&\000\001����\227\220�\177\000\000�\024\225\210\205\177\000\000\200\000@\023\020\000k\000!\204*\n\002\000
\0000�\227\220�\177\000\000��\227\220�\177", '\0' <repeats 11
times>, "F`",
     '\0' <repeats 13 times>,
"�\227\210\205\177\000\000�\002w\210\205\177", '\0' <repeats 34
times>,
"\210\031\225\210\205\177\000\000\002\vw\210\205\177\000\000\000�\227\210",
     "\205\177\000\000
�\227\210\205\177\000\000\030�\227\210\205\177\000\000�\024\225\210\205\177",
'\0' <repeats 18 times>,
"o�\227\220�\177\000\000�\017@\000\000\000\000\000\000\000@�/!��\000\000\000\000\000\000\000\000\000F`",
     '\0' <repeats 13 times>,
"�\227\210\205\177\000\000\000\000�\232/!��\000\000VC�\020\v�\000\000\000\000\000\000\000\000�E`",
'\0' <repeats 14 times>,
"�\227\210\205\177\000\000\000\000@\233/!��\000\000VC",
     "�\020\v�\000\000\000\000\000\000\000\000�E`", '\0' <repeats 14
times>,
"�\227\210\205\177\000\000\000\000�\233/!��\000\000VC�\020\v�\000\000\000\000\000\000\000\000�E`",
'\0' <repeats 13 times>, "\001\000\000"}}
         title = "�\024\225\210\205\177\000\000��\224\210\205\177",
'\0' <repeats 18 times>,
"�\022�\205\205\177\000\000\005\000\000\000\000\000\000\000��\224\210\205\177\000\000\000\000
w/!��\000\000VC�\020\v�", '\0' <repeats 16 times>,
"5.w\210\205\177\000\000\000\000\000\000\000\000\000\000(\005\230\210\205\177\000\000A\230\221\206\205\177\000\0000�\227\220�\177\000"
         aa = 6.9273684732832797e-310
         e2 = 6.9273684722714332e-310
(gdb)
}}}

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/111#comment:14&gt;
GRASS GIS <http://grass.osgeo.org>

#111: r.los fails in WinGRASS with high values for max_dis parameter
---------------------------+------------------------------------------------
  Reporter: gsancho | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 6.4.0
Component: Raster | Version: svn-develbranch6
Resolution: | Keywords: wingrass r.los
  Platform: MSWindows XP | Cpu: x86-32
---------------------------+------------------------------------------------
Comment (by glynn):

Replying to [comment:14 neteler]:
> !#1 0x00007f858856319f in segment_get (SEG=0x7fff9097cf80,
buf=0x7fff9097b99c, row=-1, col=2277)

row=-1

> !#2 0x0000000000403a2d in find_inclination (x=0, y=1169,
viewpt_elev=1381, seg_in_p=0x7fff9097cf80, row_viewpt=1168,
col_viewpt=2277, docurv=0, ellps_a=6.9273684732832797e-310) at
pts_elim.c:300

y=1169, row_viewpt=1168

=> y > row_viewpt

> !#3 0x0000000000403567 in hidden_point_elimination (...) at
pts_elim.c:99

This is where I get lost.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/111#comment:15&gt;
GRASS GIS <http://grass.osgeo.org>

#111: r.los fails in WinGRASS with high values for max_dis parameter
---------------------------+------------------------------------------------
  Reporter: gsancho | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 6.4.0
Component: Raster | Version: svn-develbranch6
Resolution: | Keywords: wingrass r.los
  Platform: MSWindows XP | Cpu: x86-32
---------------------------+------------------------------------------------
Comment (by aborruso):

I have made a test with the new installer for grass-6.4.0RC3, made by
Colin Nielsen, and now r.los seems ok.

I must do other tests.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/111#comment:16&gt;
GRASS GIS <http://grass.osgeo.org>

#111: r.los fails in WinGRASS with high values for max_dis parameter
---------------------------+------------------------------------------------
  Reporter: gsancho | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 6.4.0
Component: Raster | Version: svn-develbranch6
Resolution: | Keywords: wingrass r.los
  Platform: MSWindows XP | Cpu: x86-32
---------------------------+------------------------------------------------
Comment (by gsancho):

I have also made some tests with r.los operation and it keep failing
(as it does in other versions)

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/111#comment:17&gt;
GRASS GIS <http://grass.osgeo.org>

#111: r.los fails in WinGRASS with high values for max_dis parameter
---------------------------+------------------------------------------------
  Reporter: gsancho | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 6.4.0
Component: Raster | Version: svn-develbranch6
Resolution: | Keywords: wingrass r.los
  Platform: MSWindows XP | Cpu: x86-32
---------------------------+------------------------------------------------
Comment (by hamish):

does it still break with 6.4.0rc4?

Hamish

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/111#comment:18&gt;
GRASS GIS <http://grass.osgeo.org>

#111: r.los fails in WinGRASS with high values for max_dis parameter
---------------------------+------------------------------------------------
  Reporter: gsancho | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 6.4.0
Component: Raster | Version: svn-develbranch6
Resolution: | Keywords: wingrass r.los
  Platform: MSWindows XP | Cpu: x86-32
---------------------------+------------------------------------------------
Comment (by aborruso):

Hi
Replying to [comment:18 hamish]:
> does it still break with 6.4.0rc4?
>
> Hamish

I have made a test with 6.4.0SVN-r36903-1, and it does not crash.

Andrea

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/111#comment:19&gt;
GRASS GIS <http://grass.osgeo.org>