Opened 9 years ago

Closed 7 years ago

#1246 closed defect (fixed)

r.sunmask buffer overflow

Reported by: paoloC Owned by: grass-dev@…
Priority: normal Milestone: 6.4.3
Component: Raster Version: 6.4.0
Keywords: r.sunmask Cc:
CPU: Unspecified Platform: Linux

Description

Hi

in grass 6.4 (Ubuntu 10.10) r.sunmusk fails:

GRASS 6.4.0 (piem_wgs84):~ > g.region -p
projection: 1 (UTM)
zone:       32
datum:      wgs84
ellipsoid:  wgs84
north:      4945050
south:      4943350
west:       369850
east:       372300
nsres:      50
ewres:      50
rows:       34
cols:       49
cells:      1666
GRASS 6.4.0 (piem_wgs84):~ >  y=4944000;x=370000
GRASS 6.4.0 (piem_wgs84):~ > r.sunmask elev=sundem out=shapdows
year=2010 month=12 day=22 hour=12 minute=0 second=0 timezone=1 east=$x north=$y --o

Calculating sun position... (using solpos (V. 11 April 2001) from NREL) Calculating shadows from DEM... * buffer overflow detected *: r.sunmask terminated

======= Backtrace: =========
/lib/libc.so.6(__fortify_fail+0x50)[0x642970]
/lib/libc.so.6(+0xe486a)[0x64186a]
/lib/libc.so.6(+0xe3fa8)[0x640fa8]
/lib/libc.so.6(_IO_default_xsputn+0x9e)[0x5c7a2e]
/lib/libc.so.6(_IO_vfprintf+0x36b2)[0x59d8c2]
/lib/libc.so.6(__vsprintf_chk+0xad)[0x64105d]
/lib/libc.so.6(__sprintf_chk+0x2d)[0x640f9d]
r.sunmask(main+0x1a8e)[0x804b23e]
/lib/libc.so.6(__libc_start_main+0xe7)[0x573ce7]
r.sunmask[0x8049421]
======= Memory map: ========
00110000-00116000 r-xp 00000000 08:05 4731552    /usr/lib/grass64/lib/libgrass_datetime.6.4.0.so
00116000-00117000 r--p 00005000 08:05 4731552    /usr/lib/grass64/lib/libgrass_datetime.6.4.0.so
00117000-00118000 rw-p 00006000 08:05 4731552    /usr/lib/grass64/lib/libgrass_datetime.6.4.0.so
00118000-00132000 r-xp 00000000 08:05 4468582    /usr/lib/libgeos_c.so.1.6.2
00132000-00133000 r--p 00019000 08:05 4468582    /usr/lib/libgeos_c.so.1.6.2
00133000-00134000 rw-p 0001a000 08:05 4468582    /usr/lib/libgeos_c.so.1.6.2
00134000-00177000 r-xp 00000000 08:05 4459839    /usr/lib/libjasper.so.1.0.0
00177000-00178000 r--p 00042000 08:05 4459839    /usr/lib/libjasper.so.1.0.0
00178000-0017b000 rw-p 00043000 08:05 4459839    /usr/lib/libjasper.so.1.0.0
0017b000-00181000 rw-p 00000000 00:00 0 
00181000-0019f000 r-xp 00000000 08:05 4468585    /usr/lib/libmfhdfalt.so.0.0.0
0019f000-001a0000 r--p 0001d000 08:05 4468585    /usr/lib/libmfhdfalt.so.0.0.0
001a0000-001a1000 rw-p 0001e000 08:05 4468585    /usr/lib/libmfhdfalt.so.0.0.0
001a1000-001a2000 rw-p 00000000 00:00 0 
001a2000-00265000 r-xp 00000000 08:05 4468600    /usr/lib/libnetcdf.so.6.0.0
00265000-002a2000 r--p 000c2000 08:05 4468600    /usr/lib/libnetcdf.so.6.0.0
002a2000-002a4000 rw-p 000ff000 08:05 4468600    /usr/lib/libnetcdf.so.6.0.0
002a4000-002a9000 rw-p 00000000 00:00 0 
002a9000-002c9000 r-xp 00000000 08:05 4468613    /usr/lib/libpq.so.5.2
002c9000-002ca000 r--p 0001f000 08:05 4468613    /usr/lib/libpq.so.5.2
002ca000-002cb000 rw-p 00020000 08:05 4468613    /usr/lib/libpq.so.5.2
002cb000-002db000 r-xp 00000000 08:05 4468577    /usr/lib/libdapserver.so.7.0.1
002db000-002dc000 r--p 0000f000 08:05 4468577    /usr/lib/libdapserver.so.7.0.1
002dc000-002dd000 rw-p 00010000 08:05 4468577    /usr/lib/libdapserver.so.7.0.1
002dd000-002f2000 r-xp 00000000 08:05 5903443    /lib/libpthread-2.12.1.so
002f2000-002f3000 ---p 00015000 08:05 5903443    /lib/libpthread-2.12.1.so
002f3000-002f4000 r--p 00015000 08:05 5903443    /lib/libpthread-2.12.1.so
002f4000-002f5000 rw-p 00016000 08:05 5903443    /lib/libpthread-2.12.1.so
002f5000-002f7000 rw-p 00000000 00:00 0 
002f7000-002fe000 r-xp 00000000 08:05 4459871    /usr/lib/libltdl.so.7.2.1
002fe000-002ff000 r--p 00006000 08:05 4459871    /usr/lib/libltdl.so.7.2.1
002ff000-00300000 rw-p 00007000 08:05 4459871    /usr/lib/libltdl.so.7.2.1
00300000-00302000 r-xp 00000000 08:05 5898292    /lib/libcom_err.so.2.1
00302000-00303000 r--p 00001000 08:05 5898292    /lib/libcom_err.so.2.1
00303000-00304000 rw-p 00002000 08:05 5898292    /lib/libcom_err.so.2.1
00304000-0030c000 r-xp 00000000 08:05 4731538    /usr/lib/grass64/lib/libgrass_gproj.6.4.0.so
0030c000-0030d000 r--p 00007000 08:05 4731538    /usr/lib/grass64/lib/libgrass_gproj.6.4.0.so
0030d000-0030e000 rw-p 00008000 08:05 4731538    /usr/lib/grass64/lib/libgrass_gproj.6.4.0.so
0030e000-0033b000 r-xp 00000000 08:05 4459844    /usr/lib/libgssapi_krb5.so.2.2
0033b000-0033c000 r--p 0002c000 08:05 4459844    /usr/lib/libgssapi_krb5.so.2.2
0033c000-0033d000 rw-p 0002d000 08:05 4459844    /usr/lib/libgssapi_krb5.so.2.2
0033d000-00343000 r-xp 00000000 08:05 4459848    /usr/lib/libkrb5support.so.0.1
00343000-00344000 r--p 00005000 08:05 4459848    /usr/lib/libkrb5support.so.0.1
00344000-00345000 rw-p 00006000 08:05 4459848    /usr/lib/libkrb5support.so.0.1
00345000-00347000 r-xp 00000000 08:05 5898333    /lib/libkeyutils.so.1.3
00347000-00348000 r--p 00001000 08:05 5898333    /lib/libkeyutils.so.1.3
00348000-00349000 rw-p 00002000 08:05 5898333    /lib/libkeyutils.so.1.3
00349000-0034c000 r-xp 00000000 08:05 5898325    /lib/libgpg-error.so.0.4.0
0034c000-0034d000 r--p 00002000 08:05 5898325    /lib/libgpg-error.so.0.4.0
0034d000-0034e000 rw-p 00003000 08:05 5898325    /lib/libgpg-error.so.0.4.0
0034f000-00356000 r-xp 00000000 08:05 4467254    /usr/lib/libgif.so.4.1.6
00356000-00357000 r--p 00006000 08:05 4467254    /usr/lib/libgif.so.4.1.6
00357000-00358000 rw-p 00007000 08:05 4467254    /usr/lib/libgif.so.4.1.6
00358000-00368000 r-xp 00000000 08:05 5902032    /lib/libresolv-2.12.1.so
00368000-00369000 r--p 00010000 08:05 5902032    /lib/libresolv-2.12.1.so
00369000-0036a000 rw-p 00011000 08:05 5902032    /lib/libresolv-2.12.1.so
0036a000-0036c000 rw-p 00000000 00:00 0 
0036d000-003b5000 r-xp 00000000 08:05 4731550    /usr/lib/grass64/lib/libgrass_gis.6.4.0.so
003b5000-003b6000 r--p 00047000 08:05 4731550    /usr/lib/grass64/lib/libgrass_gis.6.4.0.so
003b6000-003b7000 rw-p 00048000 08:05 4731550    /usr/lib/grass64/lib/libgrass_gis.6.4.0.so
003b7000-003ba000 rw-p 00000000 00:00 0 
003ba000-003fc000 r-xp 00000000 08:05 4458101    /usr/lib/libldap_r-2.4.so.2.5.6
003fc000-003fd000 ---p 00042000 08:05 4458101    /usr/lib/libldap_r-2.4.so.2.5.6
003fd000-003fe000 r--p 00042000 08:05 4458101    /usr/lib/libldap_r-2.4.so.2.5.6
003fe000-003ff000 rw-p 00043000 08:05 4458101    /usr/lib/libldap_r-2.4.so.2.5.6
003ff000-00400000 rw-p 00000000 00:00 0 
00402000-00421000 r-xp 00000000 08:05 4459841    /usr/lib/libjpeg.so.62.0.0
00421000-00422000 r--p 0001e000 08:05 4459841    /usr/lib/libjpeg.so.62.0.0
00422000-00423000 rw-p 0001f000 08:05 4459841    /usr/lib/libjpeg.so.62.0.0
00423000-004ec000 r-xp 00000000 08:05 4468575    /usr/lib/libdap.so.10.0.1
004ec000-004ed000 ---p 000c9000 08:05 4468575    /usr/lib/libdap.so.10.0.1
004ed000-004ef000 r--p 000c9000 08:05 4468575    /usr/lib/libdap.so.10.0.1
004ef000-004f0000 rw-p 000cb000 08:05 4468575    /usr/lib/libdap.so.10.0.1
004f0000-0053c000 r-xp 00000000 08:05 4459450    /usr/lib/libcurl-gnutls.so.4.2.0
0053c000-0053d000 r--p 0004c000 08:05 4459450    /usr/lib/libcurl-gnutls.so.4.2.0
0053d000-0053e000 rw-p 0004d000 08:05 4459450    /usr/lib/libcurl-gnutls.so.4.2.0
0053e000-00558000 r-xp 00000000 08:05 5898319    /lib/libgcc_s.so.1
00558000-00559000 r--p 00019000 08:05 5898319    /lib/libgcc_s.so.1
00559000-0055a000 rw-p 0001a000 08:05 5898319    /lib/libgcc_s.so.1
0055d000-006b4000 r-xp 00000000 08:05 5903442    /lib/libc-2.12.1.so
006b4000-006b6000 r--p 00157000 08:05 5903442    /lib/libc-2.12.1.so
006b6000-006b7000 rw-p 00159000 08:05 5903442    /lib/libc-2.12.1.so
006b7000-006ba000 rw-p 00000000 00:00 0 
006ba000-00750000 r-xp 00000000 08:05 4459649    /usr/lib/libgnutls.so.26.14.12Annullato


Change History (3)

comment:1 Changed 8 years ago by hamish

Keywords: r.sunmask added
Milestone: 6.4.16.4.3

Hi,

using 6.4.svn (~6.4.2rc3), utm 32N + wgs84, your region bounds, and synthetic elevation data (gaussian mound from r.surf.volcano) it works for me. (debian/squeeze 64bit)

?, Hamish

comment:2 Changed 8 years ago by hamish

fixed by #800 ?

comment:3 Changed 7 years ago by neteler

Resolution: fixed
Status: newclosed

I have made a test in a Piemonte UTM location with the current 6.4.svn, no (more) problems

GRASS 6.4.3svn (piemonte_utm32_wgs84):~ > y=4984700.000000;x=384715.000000
GRASS 6.4.3svn (piemonte_utm32_wgs84):~ > r.sunmask elev=gmted2010 out=shadows \
year=2010 month=12 day=22 hour=12 minute=0 second=0 timezone=1 east=$x north=$y
Calculating sun position... (using solpos (V. 11 April 2001) from NREL)
Calculating shadows from DEM...
 100%

Closing as fixed.

Note: See TracTickets for help on using tickets.