Details Ticket 4868


Comment | Reply | Take | Open


Serial Number 4868
Subject r.mapcalc: segfault in 'if then'
Area grass6
Queue grass
Requestors tutey@02.pl
Owner none
Status resolved
Last User Contact Thu Jul 20 12:19:37 2006 (2 yr ago)
Current Priority 70
Final Priority 70
Due No date assigned
Last Action Thu Jul 20 20:41:02 2006 (2 yr ago)
Created Tue Jul 18 18:07:09 2006 (2 yr ago)

Transaction History Ticket 4868


Tue, Jul 18 2006 18:07:09    Request created by guest  
Subject: r.mapcalc: segfault in 'if then'

grass obtained from: CVS
grass binary for platform: Compiled from Sources
GRASS Version: 2006-07-10

r.mapcalc 'map=if(dtm,1)'
Segmentation fault

Maciek
Wed, Jul 19 2006 09:44:55    Mail sent by glynn@gclements.plus.com  
Return-Path <glynn@gclements.plus.com>
Delivered-To grass-bugs@lists.intevation.de
From Glynn Clements <glynn@gclements.plus.com>
MIME-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Transfer-Encoding 7bit
Message-ID <17597.58100.832436.684787@cerise.gclements.plus.com>
Date Wed, 19 Jul 2006 08:44:52 +0100
To Request Tracker <grass-bugs@intevation.de>
Cc grass-dev@grass.itc.it
Subject Re: [GRASS-dev] [bug #4868] (grass) r.mapcalc: segfault in 'if then'
In-Reply-To <20060718160709.41F681005C9@lists.intevation.de>
References <20060718160709.41F681005C9@lists.intevation.de>
X-Mailer VM 7.07 under 21.4 (patch 15) "Security Through Obscurity" XEmacs Lucid
X-Virus-Scanned by amavisd-new at intevation.de
X-Spam-Status No, hits=-3.451 tagged_above=-999 required=3 tests=[AWL=1.283, BAYES_00=-5, FORGED_RCVD_HELO=0.266]
X-Spam-Level
Request Tracker wrote:

> this bug's URL: http://intevation.de/rt/webrt?serial_num=4868
> -------------------------------------------------------------------------
> 
> Subject: r.mapcalc: segfault in 'if then'
> 
> grass obtained from: CVS
> grass binary for platform: Compiled from Sources
> GRASS Version: 2006-07-10
> 
> r.mapcalc 'map=if(dtm,1)'
> Segmentation fault

I am unable to reproduce this.

Please provide a recipe to reproduce this with either the Spearfish
sample data or self-generated data.

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


Wed, Jul 19 2006 15:00:54    Mail sent by msieczka  
glynn@gclements.plus.com wrote (Wed, Jul 19 2006 09:44:55):

> > r.mapcalc 'map=if(dtm,1)'
> > Segmentation fault
> 
> I am unable to reproduce this.
> 
> Please provide a recipe to reproduce this with either the Spearfish
> sample data or self-generated data.

Indeed, this is not 100% reproducible. Somehow it depends on a combination of
input/output raster name lenght and the raster type (double/float/integer).
Scenario for spearfish60:

$ g.region rast=aspect

$ r.mapcalc 'aspect_dbl=double(aspect)'

             35 CHARS LONG OUTPUT NAME:

$ r.mapcalc 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=if(aspect_dbl,1)'
 100%

             36 CHARS:

$ r.mapcalc 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=if(aspect_dbl,1)'
*** glibc detected *** malloc(): memory corruption (fast): 0x0805a168 ***
Aborted

             37 CHARS AND MORE:

$ r.mapcalc 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=if(aspect_dbl,1)'
Segmentation fault



Maciek
Thu, Jul 20 2006 12:19:37    Mail sent by glynn@gclements.plus.com  
Return-Path <glynn@gclements.plus.com>
Delivered-To grass-bugs@lists.intevation.de
From Glynn Clements <glynn@gclements.plus.com>
MIME-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Transfer-Encoding 7bit
Message-ID <17599.22694.501063.561778@cerise.gclements.plus.com>
Date Thu, 20 Jul 2006 11:19:18 +0100
To Maciek Sieczka via RT <grass-bugs@intevation.de>
Cc tutey@02.pl, grass-dev@grass.itc.it
Subject Re: [GRASS-dev] [bug #4868] (grass) r.mapcalc: segfault in 'if then'
In-Reply-To <20060719130055.07CA91005A4@lists.intevation.de>
References <20060719130055.07CA91005A4@lists.intevation.de>
X-Mailer VM 7.07 under 21.4 (patch 15) "Security Through Obscurity" XEmacs Lucid
X-Virus-Scanned by amavisd-new at intevation.de
X-Spam-Status No, hits=-3.477 tagged_above=-999 required=3 tests=[AWL=1.257, BAYES_00=-5, FORGED_RCVD_HELO=0.266]
X-Spam-Level
Maciek Sieczka via RT wrote:

> > > r.mapcalc 'map=if(dtm,1)'
> > > Segmentation fault
> > 
> > I am unable to reproduce this.
> > 
> > Please provide a recipe to reproduce this with either the Spearfish
> > sample data or self-generated data.
> 
> Indeed, this is not 100% reproducible. Somehow it depends on a combination
of
> input/output raster name lenght and the raster type (double/float/integer).
Okay, found it. The type inference code for if() was assigning types
to the 2nd/3rd/4th arguments regardless of whether that many arguments
were actually present, overflowing the array.

I've committed a fix to CVS.

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


Thu, Jul 20 2006 20:41:02    Status changed to resolved by msieczka  
Comment | Reply | Take | Open

You are currently authenticated as guest.
[Show Configuration] [Login as another user]

Users Guide - Mail Commands - Homepage of RequestTracker 1.0.7 - list any request