Opened 17 years ago
Closed 15 years ago
#111 closed defect (fixed)
r.los fails with high values for max_dis parameter
Reported by: | gsancho | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | 6.4.0 |
Component: | Raster | Version: | svn-develbranch6 |
Keywords: | wingrass r.los | Cc: | marco.pasetti@… |
CPU: | x86-32 | Platform: | MSWindows XP |
Description
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.
Attachments (1)
Change History (37)
follow-up: 6 comment:1 by , 16 years ago
Cc: | added |
---|
comment:2 by , 16 years ago
I cannot confirm this on Debian GNU/Linux with recent svn, so it seems to be win-specific.
Moritz
comment:3 by , 16 years ago
Version: | unspecified → 6.3.0 RCs |
---|
comment:4 by , 16 years ago
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 |
---|---|
Version: | 6.3.0 RCs → 6.3.0 |
comment:5 by , 16 years ago
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
comment:6 by , 16 years ago
Component: | default → Raster |
---|---|
CPU: | → x86-32 |
Platform: | → MSWindows XP |
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
comment:7 by , 16 years ago
Version: | 6.3.0 → svn-develbranch6 |
---|
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
comment:8 by , 16 years ago
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
comment:10 by , 16 years ago
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
follow-up: 13 comment:11 by , 16 years ago
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
comment:12 by , 16 years ago
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
comment:13 by , 16 years ago
follow-up: 15 comment:14 by , 16 years ago
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)
comment:15 by , 16 years ago
Replying to 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.
comment:16 by , 16 years ago
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.
follow-ups: 20 24 comment:17 by , 16 years ago
I have also made some tests with r.los operation and it keep failing (as it does in other versions)
comment:19 by , 15 years ago
follow-up: 22 comment:20 by , 15 years ago
Replying to gsancho:
I have also made some tests with r.los operation and it keep failing (as it does in other versions)
what version do you test with? same spearfish command line as in the original bug report?
I've just tested r.los in the latest stand-alone WinGRASS installer and it the only problem I noticed was that the G_percent() text only gets displayed as 100% after the process is complete, after any module output (run from msys command line).
I tested these:
#spearfish r.los in=elevation.dem output=tr_vis \ coordinate=599490,4920855 max_dist=10000 r.los input=elevation.dem output=los \ coordinate=599505,4921010 max_dis=2525 #NC_spm_08 r.los in=elevation out=ele.los coord=637500,221750 \ obs_elev=42 max=10000
all without crashing.
Hamish
comment:21 by , 15 years ago
gsancho: any more details you can provide about how to trigger the crash?
follow-up: 23 comment:22 by , 15 years ago
Replying to hamish:
all without crashing.
grass64.svn rev39432 self compiled in the osgeo4w-stack, WinVista32 nc-dataset
r.los input=elevation@PERMANENT output=rlostest coordinate=637101,223211 Using maximum distance from the viewing point (meters): 10000.000000
all without crashing
closing the ticket?
best regards helli
comment:23 by , 15 years ago
Hi helli, for me yes. I have had this problem in the past, but it's all ok with WinGRASS-6.4.0SVN-r39271-1. I have made a test with this command:
r.los --overwrite input=DEM@PERMANENT output=vis coordinate=304000,4211134 max_dist=50000
Thank you,
a
comment:24 by , 15 years ago
Replying to gsancho:
I have also made some tests with r.los operation and it keep failing (as it does in other versions)
still seeing this?
Hamish
follow-up: 27 comment:25 by , 15 years ago
Confirmed on GRASS 6.4.0~rc5+40109-1 from Debian unstable
comment:26 by , 15 years ago
Summary: | r.los fails in WinGRASS with high values for max_dis parameter → r.los fails with high values for max_dis parameter |
---|
comment:27 by , 15 years ago
Replying to pcav:
Confirmed on GRASS 6.4.0~rc5+40109-1 from Debian unstable
more details please:
do you see it using an example from one of the sample datasets? (spearfish or NC)
what was the command line you used, region settings, etc?
is this on 32 or 64 bit?
thanks, Hamish
comment:28 by , 15 years ago
(see details on grass-user ML, Wednesday, December 30, 2009)
can you provide a gdb backtrace for r.los run from the grass command line?
thanks, Hamish
comment:29 by , 15 years ago
I tested this on my own data, on amd64. On NC data I cannot reproduce it, but this may be due to a lower resolution.
Command line: r.los input=dtm@PERMANENT coordinate=1676844,4830417 obs_elev=50 max_dist=5000 output=los4 Using maximum distance from the viewing point (meters): 5000.000000 Module crashed or killed
This both from QGIS plugin and from the console.
g.region -p
projection: 99 (Transverse Mercator) zone: 0 datum: rome40 ellipsoid: international north: 4834913.78536118 south: 4803364.45415656 west: 1650370.47056664 east: 1689398.62729587 nsres: 24.99947005 ewres: 25.00202225 rows: 1262 cols: 1561 cells: 1969982
follow-up: 31 comment:30 by , 15 years ago
Unable to reproduce it with NC sample data - it takes a *lot* of time and CPU there, but seems to work anyway. I can make my region available for futher testing if necessary.
comment:31 by , 15 years ago
follow-ups: 33 35 comment:32 by , 15 years ago
Here it is (available for a while):
http://int.faunalia.it/~paolo/Toscana_rlos.tar.gz
Tested again with the command
r.los input=dtm@PERMANENT coordinate=1676734,4831167 obs_elev=100 max_dist=10000 output=rlos
and it fails
comment:33 by , 15 years ago
Replying to pcav:
http://int.faunalia.it/~paolo/Toscana_rlos.tar.gz
Tested again with the command
r.los input=dtm@PERMANENT coordinate=1676734,4831167 obs_elev=100 max_dist=10000 output=rlos
and it fails
works for me on debian-etch-pentium4, (& it looks nice too!)
http://bambi.otago.ac.nz/hamish/grass/bugs/rlos_onearth.jpg
but I do see the segfault on debian-lenny-amd64 & GRASS 6.5svn.
gdb session:
G65> gdb `which r.los` ... (gdb) run input=dtm@PERMANENT coordinate=1676734,4831167 obs_elev=100 max_dist=10000 output=rlos_test ... [Thread debugging using libthread_db enabled] warning: Lowest section in /usr/lib/libicudata.so.38 is .hash at 0000000000000120 Using maximum distance from the viewing point (meters): 10000.000000 [New Thread 0x7fde555ce710 (LWP 31319)] Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x7fde555ce710 (LWP 31319)] 0x00007fde53ae9ee5 in memcpy () from /lib/libc.so.6 (gdb) bt #0 0x00007fde53ae9ee5 in memcpy () from /lib/libc.so.6 #1 0x00007fde552eb288 in segment_get (SEG=0x7fff7c5cf320, buf=0x7fff7c5cdd2c, row=-1, col=1054) at get.c:49 #2 0x0000000000403b3e in find_inclination (x=0, y=150, viewpt_elev=249, seg_in_p=0x7fff7c5cf320, row_viewpt=149, col_viewpt=1054, docurv=0, ellps_a=6.9532466931849492e-310) at pts_elim.c:300 #3 0x000000000040361f in hidden_point_elimination (head=0x16a2340, viewpt_elev=249, seg_in_p=0x7fff7c5cf320, seg_out_p=0x7fff7c5cf2e0, seg_patt_p=0x7fff7c5cf2a0, quadrant=1, sign_on_y=1, sign_on_x=1, row_viewpt=149, col_viewpt=1054, patt_flag=0, docurv=0, ellps_a=6.9532466931849492e-310) at pts_elim.c:94 #4 0x0000000000403de7 in segment (segment_no=4, xmax=149, ymax=506, slope_1=0, slope_2=0.5, flip=1, sign_on_y=1, sign_on_x=1, viewpt_elev=249, seg_in_p=0x7fff7c5cf320, seg_out_p=0x7fff7c5cf2e0, seg_patt_p=0x7fff7c5cf2a0, row_viewpt=149, col_viewpt=1054, patt_flag=0, docurv=0, ellps_a=6.9532466931849492e-310) at segment.c:81 #5 0x0000000000402dc0 in main (argc=6, argv=0x7fff7c5cf778) at main.c:328 (gdb) frame 1 #1 0x00007fde552eb288 in segment_get (SEG=0x7fff7c5cf320, buf=0x7fff7c5cdd2c, row=-1, col=1054) at get.c:49 49 memcpy(buf, &SEG->scb[i].buf[index], SEG->len); (gdb) list 43 int index, n, i; 44 45 segment_address(SEG, row, col, &n, &index); 46 if ((i = segment_pagein(SEG, n)) < 0) 47 return -1; 48 49 memcpy(buf, &SEG->scb[i].buf[index], SEG->len); 50 51 return 1; 52 } (gdb) bt full #0 0x00007fde53ae9ee5 in memcpy () from /lib/libc.so.6 No symbol table info available. #1 0x00007fde552eb288 in segment_get (SEG=0x7fff7c5cf320, buf=0x7fff7c5cdd2c, row=-1, col=1054) at get.c:49 index = -476 n = 2 i = 0
so buf[index] on line 49 of lib/segment/get.c is trying to look for buf[-476] and generally speaking negative array positions are not allowed.
That row=-1 looks a bit suspicious...
I can follow that back as far as r.los/pts_elim.c L94 where row_viewpt=149 but neighbor_1_y=150, so row_viewpt - neighbor_1_y = -1.
"g.region res=25 -a" does not fix it.
Hamish
ps- more of the backtrace follows
#2 0x0000000000403b3e in find_inclination (x=0, y=151, viewpt_elev=250, seg_in_p=0x7fff36385b80, row_viewpt=150, col_viewpt=1055, docurv=0, ellps_a=6.9531885513800646e-310) at pts_elim.c:300 del_x = 0 del_y = 151 dist = 3775 picked_pt_elev = 1.40129846e-45 #3 0x000000000040361f in hidden_point_elimination (head=0xf185c0, viewpt_elev=250, seg_in_p=0x7fff36385b80, seg_out_p=0x7fff36385b40, seg_patt_p=0x7fff36385b00, quadrant=1, sign_on_y=1, sign_on_x=1, row_viewpt=150, col_viewpt=1055, patt_flag=0, docurv=0, ellps_a=6.9531885513800646e-310) at pts_elim.c:94 CHECKED_PT = (struct point *) 0xf34df0 BLOCKING_PT = (struct point *) 0xf5f780 orientation_neighbor_1 = 1.5707963267948966 orientation_neighbor_2 = 1.5641297588910283 inclination_neighbor_1 = -0.0080127842385963374 inclination_neighbor_2 = -0.0080487974672544659 interpolated_inclination = 7.8202765736839203e-317 correct_neighbor_inclination = -0.0080487974672544659 correct_neighbor_orientation = 1.5640850181635739 correct_neighbor_x = 1 correct_neighbor_y = 149 neighbor_1_y = 151 neighbor_1_x = 0 neighbor_2_x = 1 neighbor_2_y = 150 uu = 1 vv = 0 mask = 1072693248 #4 0x0000000000403de7 in segment (segment_no=4, xmax=150, ymax=506, slope_1=0, slope_2=0.5, flip=1, sign_on_y=1, sign_on_x=1, viewpt_elev=250, seg_in_p=0x7fff36385b80, seg_out_p=0x7fff36385b40, seg_patt_p=0x7fff36385b00, row_viewpt=150, col_viewpt=1055, patt_flag=0, docurv=0, ellps_a=6.9531885513800646e-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 *) 0xf185c0 PRESENT_PT = (struct point *) 0xe8aa50 quadrant = 1 #5 0x0000000000402dc0 in main (argc=6, argv=0x7fff36385fd8) at main.c:328 row_viewpt = 150 col_viewpt = 1055 nrows = 1263 ncols = 1562 a = 506 b = 150 row = 1263 patt_flag = 0 segment_no = 4 flip = 1 xmax = 150 ymax = 506 sign_on_y = 1 sign_on_x = 1 submatrix_rows = 316 submatrix_cols = 391 lenth_data_item = 4 patt = 0 in_fd = 7 out_fd = 8 patt_fd = 0 old = 5 new = 6 slope_1 = 0 slope_2 = 0.5 max_vert_angle = 0 color_factor = 6.9531885516330262e-310 old_mapset = 0xdb3510 "PERMANENT" patt_mapset = 0x0 value = (FCELL *) 0x7fff36385bc8 search_mapset = 0x404148 "" current_mapset = 0x7f937cbb1920 "paolo" ...[cut]
comment:34 by , 15 years ago
I would note that your starting point is 150 rows (+/- 1) from the northern edge of the map, which is the y it blows up on.
north: 4834913.78536118 nsres: 24.99947005 coordinate=1676734,4831167 ( 4834913.78536118 - 4831167 ) / 24.99947005 ans = 149.874591488794
setting the starting coord at the center of the map (dist to edge > max_dist) allows it to run to completion.
so it is some just tipping over the edge effect, ie integer truncation or rounding error ... ???
Hamish
comment:35 by , 15 years ago
Replying to pcav:
Here it is (available for a while):
http://int.faunalia.it/~paolo/Toscana_rlos.tar.gz
Tested again with the command
r.los input=dtm@PERMANENT coordinate=1676734,4831167 obs_elev=100 max_dist=10000 output=rlos
and it fails
tested it with an actual self compiled grass64 and grass65 on WinVista32, r.los works in both versions.
Helmut
comment:36 by , 15 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
I can confirm, it works quickly and smoothing on debian with official package 6.4.0~rc5+41380-1.
Replying to gsancho:
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