Details Ticket 977


Comment | Reply | Take | Open


Serial Number 977
Subject s.in.ascii core dumps
Area bug
Queue grass
Requestors andreas.lange@rhein-main.de
Owner none
Status resolved
Last User Contact Mon Mar 25 21:17:26 2002 (6 yr ago)
Current Priority 30
Final Priority 70
Due No date assigned
Last Action Tue Mar 26 17:47:56 2002 (6 yr ago)
Created Mon Mar 25 13:29:18 2002 (6 yr ago)

Transaction History Ticket 977


Mon, Mar 25 2002 13:29:18    Request created by guest  
Subject: s.in.ascii core dumps

Platform: Linux/Intel
grass downloaded at: CVS Server, Germany
grass binary for platform: I compiled the sources myself
grass sources source: (latest) GRASS from CVS, pre3/CVS versio

s.in.ascii sites=eaurinia input=e_aurinia.txt fs=","
or 
s.in.ascii sites=eaurinia input=e_aurinia.txt fs=,
dumps core on data in the form like this:
3500900,5704300,"AAAAAAAANF","Name",
3500900,5704300,"AAAAAAAANF","Name, another Name",
3555700,5697800,"AAAAAAAANG","Name with umlauts äöü",
3501500,5694000,"AAAAAAAANH","Name...",19760101

cat e_aurinia.txt | tr "," "\t"| s.in.ascii sites=eaurinia2
works partially. Only some lines are imported. If i cut off all fields exept
the easting/northing part it works.

I am in a hurry, so i am not able to check further. 

I think that s.in.ascii should at least not core dump on input, irrespectively
how weird it is.  
My guess is that the problem is either the unquoted "," inside the qouted field
or the empty fifth field. 

Andreas
Mon, Mar 25 2002 17:57:28    Mail sent by egm2@jps.net  
Return-Path <neteler@itc.it>
Delivered-To grass-bugs@lists.intevation.de
Resent-Message-Id <200203251657.g2PGvD600921@thuille.itc.it.>
From "Eric G. Miller" <egm2@jps.net>
To grass5@grass.itc.it
Subject Re: [GRASS5] [bug #977] (grass) s.in.ascii core dumps
Message-ID <20020325155939.GB26219@calico.local>
Mail-Followup-To grass5@grass.itc.it
References <20020325122918.BCED7139C9@lists.intevation.de>
Mime-Version 1.0
Content-Type text/plain; charset=iso-8859-1
Content-Disposition inline
Content-Transfer-Encoding 8bit
In-Reply-To <20020325122918.BCED7139C9@lists.intevation.de>
User-Agent Mutt/1.3.27i
Sender grass5-admin@grass.itc.it
Errors-To grass5-admin@grass.itc.it
X-BeenThere grass5@grass.itc.it
X-Mailman-Version 2.0.5
Precedence bulk
List-Help <mailto:grass5-request@grass.itc.it?subject=help>
List-Post <mailto:grass5@grass.itc.it>
List-Subscribe <http://grass.itc.it/mailman/listinfo/grass5>, <mailto:grass5-request@grass.itc.it?subject=subscribe>
List-Id GRASS 5 Developers mailing list <grass5.grass.itc.it>
List-Unsubscribe <http://grass.itc.it/mailman/listinfo/grass5>, <mailto:grass5-request@grass.itc.it?subject=unsubscribe>
List-Archive <http://grass.itc.it/pipermail/grass5/>
Date Mon, 25 Mar 2002 07:59:39 -0800
Resent-From neteler@itc.it
Resent-Date Mon, 25 Mar 2002 17:57:13 +0100
Resent-To grass-bugs@intevation.de
X-Spam-Status No, hits=1 required=5 tests=FROM_ENDS_IN_NUMS
On Mon, Mar 25, 2002 at 01:29:18PM +0100, Request Tracker wrote:
> s.in.ascii sites=eaurinia input=e_aurinia.txt fs=,
> dumps core on data in the form like this:
> 3500900,5704300,"AAAAAAAANF","Name",
> 3500900,5704300,"AAAAAAAANF","Name, another Name",
> 3555700,5697800,"AAAAAAAANG","Name with umlauts äöü",
> 3501500,5694000,"AAAAAAAANH","Name...",19760101

Sites files must have uniform field counts/types.  While it's not nice
behavior to segfault, the data should just be rejected.  There is
currently no provision for NULL fields.

-- 
Eric G. Miller <egm2@jps.net>
_______________________________________________
grass5 mailing list
grass5@grass.itc.it
http://grass.itc.it/mailman/listinfo/grass5


Mon, Mar 25 2002 17:58:15    Mail sent by neteler@itc.it  
Return-Path <neteler@itc.it>
Delivered-To grass-bugs@lists.intevation.de
Date Mon, 25 Mar 2002 17:58:13 +0100
From Markus Neteler <neteler@itc.it>
To grass5@grass.itc.it
Cc grass-bugs@intevation.de
Subject Re: [GRASS5] [bug #977] (grass) s.in.ascii core dumps
Message-ID <20020325175813.S29083@itc.it>
Mail-Followup-To grass5@grass.itc.it, grass-bugs@intevation.de
References <20020325122918.BCED7139C9@lists.intevation.de> <20020325155939.GB26219@calico.local>
Mime-Version 1.0
Content-Type text/plain; charset=iso-8859-1
Content-Disposition inline
Content-Transfer-Encoding 8bit
User-Agent Mutt/1.2.5.1i
In-Reply-To <20020325155939.GB26219@calico.local>; from egm2@jps.net on Mon, Mar 25, 2002 at 07:59:39AM -0800
X-Spam-Status No, hits=0 required=5 tests=
On Mon, Mar 25, 2002 at 07:59:39AM -0800, Eric G. Miller wrote:
> On Mon, Mar 25, 2002 at 01:29:18PM +0100, Request Tracker wrote:
> > s.in.ascii sites=eaurinia input=e_aurinia.txt fs=,
> > dumps core on data in the form like this:
> > 3500900,5704300,"AAAAAAAANF","Name",
> > 3500900,5704300,"AAAAAAAANF","Name, another Name",
> > 3555700,5697800,"AAAAAAAANG","Name with umlauts äöü",
> > 3501500,5694000,"AAAAAAAANH","Name...",19760101
> 
> Sites files must have uniform field counts/types.  While it's not nice
> behavior to segfault, the data should just be rejected.  There is
> currently no provision for NULL fields.

Eric,

do you see a change to add:

G_fatal_error("Sites files must have uniform field counts/types. There is
               currently no provision for NULL fields.");

in the module?

Thanks,

 Markus


Mon, Mar 25 2002 20:12:22    Mail sent by glynn.clements@virgin.net  
Return-Path <glynn.clements@virgin.net>
Delivered-To grass-bugs@lists.intevation.de
From Glynn Clements <glynn.clements@virgin.net>
MIME-Version 1.0
Content-Type text/plain; charset=iso-8859-1
Content-Transfer-Encoding quoted-printable
Message-ID <15519.16085.754265.512656@cerise.nosuchdomain.co.uk>
Date Mon, 25 Mar 2002 15:14:29 +0000
To Request Tracker <grass-bugs@intevation.de>
Cc grass5@grass.itc.it
Subject Re: [GRASS5] [bug #977] (grass) s.in.ascii core dumps
In-Reply-To <20020325122918.BCED7139C9@lists.intevation.de>
References <20020325122918.BCED7139C9@lists.intevation.de>
X-Mailer VM 6.94 under 21.4 (patch 4) "Artificial Intelligence (candidate #1)" XEmacs Lucid
X-Spam-Status No, hits=0 required=5 tests=
Request Tracker wrote:

> Subject: s.in.ascii core dumps

> s.in.ascii sites=3Deaurinia input=3De_aurinia.txt fs=3D","
> or=20
> s.in.ascii sites=3Deaurinia input=3De_aurinia.txt fs=3D,
> dumps core on data in the form like this:
> 3500900,5704300,"AAAAAAAANF","Name",
> 3500900,5704300,"AAAAAAAANF","Name, another Name",
> 3555700,5697800,"AAAAAAAANG","Name with umlauts =E4=F6=FC",
> 3501500,5694000,"AAAAAAAANH","Name...",19760101
>=20
> cat e_aurinia.txt | tr "," "\t"| s.in.ascii sites=3Deaurinia2
> works partially. Only some lines are imported. If i cut off all field=
s
> exept the easting/northing part it works.
>=20
> I am in a hurry, so i am not able to check further.=20
>=20
> I think that s.in.ascii should at least not core dump on input,
> irrespectively how weird it is.
>=20
> My guess is that the problem is either the unquoted "," inside the
> qouted field or the empty fifth field.

AFAICT, it's actually a bug in G_parser() regarding the "fs=3D," option=
;
the split_opts() function attempts to split the "answer" field into
multiple answers, regardless of whether the "multiple" field is set.=20=

Furthermore, zero-length options result in a NULL answer rather than
the empty string. This causes G_recreate_command() to segfault, as it
expects opt->answers[0] to be valid.

If I fix split_opts(), so that opt->answers[0] is just set to
opt->answer when opt->multiple is false, s.in.ascii works OK.

BTW, s.out.ascii only outputs the first three sites, so there's
something wrong there ($LOCATION/site_lists/eaurinia is correct).

--=20
Glynn Clements <glynn.clements@virgin.net>


Mon, Mar 25 2002 20:12:32    Mail sent by glynn.clements@virgin.net  
Return-Path <glynn.clements@virgin.net>
Delivered-To grass-bugs@lists.intevation.de
From Glynn Clements <glynn.clements@virgin.net>
MIME-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Transfer-Encoding 7bit
Message-ID <15519.16581.955209.200523@cerise.nosuchdomain.co.uk>
Date Mon, 25 Mar 2002 15:22:45 +0000
To Request Tracker <grass-bugs@intevation.de>, grass5@grass.itc.it
Subject Re: [GRASS5] [bug #977] (grass) s.in.ascii core dumps
In-Reply-To <15519.16085.754265.512656@cerise.nosuchdomain.co.uk>
References <20020325122918.BCED7139C9@lists.intevation.de> <15519.16085.754265.512656@cerise.nosuchdomain.co.uk>
X-Mailer VM 6.94 under 21.4 (patch 4) "Artificial Intelligence (candidate #1)" XEmacs Lucid
X-Spam-Status No, hits=0 required=5 tests=
Glynn Clements wrote:

> BTW, s.out.ascii only outputs the first three sites, so there's
> something wrong there ($LOCATION/site_lists/eaurinia is correct).

Sorry, my mistake; the last site doesn't match the guessed format, so
it's ignored.

-- 
Glynn Clements <glynn.clements@virgin.net>


Mon, Mar 25 2002 21:17:26    Mail sent by glynn.clements@virgin.net  
Return-Path <glynn.clements@virgin.net>
Delivered-To grass-bugs@lists.intevation.de
From Glynn Clements <glynn.clements@virgin.net>
MIME-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Transfer-Encoding 7bit
Message-ID <15519.32424.160580.105635@cerise.nosuchdomain.co.uk>
Date Mon, 25 Mar 2002 19:46:48 +0000
To Request Tracker <grass-bugs@intevation.de>, grass5@grass.itc.it
Subject Re: [GRASS5] [bug #977] (grass) s.in.ascii core dumps
In-Reply-To <15519.16085.754265.512656@cerise.nosuchdomain.co.uk>
References <20020325122918.BCED7139C9@lists.intevation.de> <15519.16085.754265.512656@cerise.nosuchdomain.co.uk>
X-Mailer VM 6.94 under 21.4 (patch 4) "Artificial Intelligence (candidate #1)" XEmacs Lucid
X-Spam-Status No, hits=0 required=5 tests=
Glynn Clements wrote:

> If I fix split_opts(), so that opt->answers[0] is just set to
> opt->answer when opt->multiple is false, s.in.ascii works OK.

But this breaks "paired" options, i.e.

	opt3->key_desc   = "x,y";

I've settled for not skipping "empty" answers; that appears to work.

-- 
Glynn Clements <glynn.clements@virgin.net>


Tue, Mar 26 2002 17:47:56    Status changed to resolved by gclements  
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