Details Ticket 5176


Comment | Reply | Take | Resolve


Serial Number 5176
Subject v.in.ogr: segfault when a full path to dsn is missing
Area grass6
Queue grass
Requestors tutey@o2.pl
Owner none
Status open
Last User Contact Sat Oct 7 21:07:25 2006 (2 yr ago)
Current Priority 30
Final Priority 70
Due No date assigned
Last Action Sat Oct 7 21:07:25 2006 (2 yr ago)
Created Mon Oct 2 00:37:29 2006 (2 yr ago)

Transaction History Ticket 5176


Mon, Oct 2 2006 00:37:29    Request created by msieczka  
Subject: v.in.ogr: segfault when a full path to dsn is missing

Uisng current CVS on x86 Linux. Built from source.

I have a shapefile in:



$ ls $HOME/force_lrconnect_cl_onlycat139
force_lrconnect_cl_onlycat139.dbf  force_lrconnect_cl_onlycat139.shp
force_lrconnect_cl_onlycat139.prj  force_lrconnect_cl_onlycat139.shx



v.in.ogr segfaults if I specify dsn as "force_lrconnect_cl_onlycat139/":



$ v.in.ogr dsn=force_lrconnect_cl_onlycat139/
output=force_lrconnect_cl_onlycat139_import
layer=force_lrconnect_cl_onlycat139 min_area=0.0001 snap=-1 --o
WARNING: The vector 'force_lrconnect_cl_onlycat139_import' already exists
         and will be overwritten.
A datum name wgs84 (WGS_1984) was specified without transformation parameters.
Note that the GRASS default for wgs84 is towgs84=0.000,0.000,0.000.
Projection of input dataset and current location appear to match.
Proceeding with import...
WARNING: The vector 'force_lrconnect_cl_onlycat139_import' already exists
         and will be overwritten.
WARNING: Table 'force_lrconnect_cl_onlycat139_import' linked to vector did
         not exist.
Layer: force_lrconnect_cl_onlycat139
WARNING: Column name changed: 'cat' -> 'cat_'
Segmentation fault



If I specify a full path /home/shoofi/orce_lrconnect_cl_onlycat139/ then it
works OK.

Maciek
Mon, Oct 2 2006 01:30:20    Mail sent by hamish_nospam@yahoo.com  
Return-Path <hamish_nospam@yahoo.com>
Delivered-To grass-bugs@lists.intevation.de
Date Mon, 2 Oct 2006 12:30:10 +1300
From Hamish <hamish_nospam@yahoo.com>
To Request Tracker <grass-bugs@intevation.de>
Cc grass-dev@grass.itc.it
Subject Re: [GRASS-dev] [bug #5176] (grass) v.in.ogr: segfault when a full path to dsn is missing
Message-Id <20061002123010.159ebd4f.hamish_nospam@yahoo.com>
In-Reply-To <20061001223729.C4D391005D8@lists.intevation.de>
References <20061001223729.C4D391005D8@lists.intevation.de>
X-Mailer Sylpheed version 1.0.4 (GTK+ 1.2.10; i386-pc-linux-gnu)
X-Face M<EoB)"*Z~u!,vFhXmw}R_KbdBta*P_=T|rbBL'e1/CQ9;/1g\BU3&!=y8ria$2Uk!HT&BB 8i?|X_+7~1jsy}F~g$2va%3fV`*=L(*cem[@3\yg,G,@rg6/QMJ
Mime-Version 1.0
Content-Type text/plain; charset=US-ASCII
Content-Transfer-Encoding 7bit
X-Virus-Scanned by amavisd-new at intevation.de
X-Spam-Status No, hits=-2.3 tagged_above=-999 required=3 tests=[BAYES_00=-5, FORGED_YAHOO_RCVD=2.7]
X-Spam-Level
Request Tracker wrote:
> this bug's URL: http://intevation.de/rt/webrt?serial_num=5176
> -------------------------------------------------------------------------
> 
> Subject: v.in.ogr: segfault when a full path to dsn is missing
> 
> Uisng current CVS on x86 Linux. Built from source.
> 
> I have a shapefile in:
> 
> $ ls $HOME/force_lrconnect_cl_onlycat139
> force_lrconnect_cl_onlycat139.dbf  force_lrconnect_cl_onlycat139.shp
> force_lrconnect_cl_onlycat139.prj  force_lrconnect_cl_onlycat139.shx
> 
> v.in.ogr segfaults if I specify dsn as "force_lrconnect_cl_onlycat139/":
> 
> $ v.in.ogr dsn=force_lrconnect_cl_onlycat139/  \
>      output=force_lrconnect_cl_onlycat139_import \
>      layer=force_lrconnect_cl_onlycat139 min_area=0.0001 snap=-1 --o
>
> WARNING: The vector 'force_lrconnect_cl_onlycat139_import' already exists
>          and will be overwritten.
> A datum name wgs84 (WGS_1984) was specified without transformation parameters.
> Note that the GRASS default for wgs84 is towgs84=0.000,0.000,0.000.
> Projection of input dataset and current location appear to match.
> Proceeding with import...
> WARNING: The vector 'force_lrconnect_cl_onlycat139_import' already exists
>          and will be overwritten.
> WARNING: Table 'force_lrconnect_cl_onlycat139_import' linked to vector did
>          not exist.
> Layer: force_lrconnect_cl_onlycat139
> WARNING: Column name changed: 'cat' -> 'cat_'
> Segmentation fault
>
> If I specify a full path /home/shoofi/orce_lrconnect_cl_onlycat139/ then it
> works OK.


(undocumented?) tip:

v.in.ogr dsn=force_lrconnect_cl_onlycat139.shp

does it work then?
what if you change the dir name to something not the same as the filename?

Hamish


Mon, Oct 2 2006 13:22:21    Mail sent by msieczka  
Hamish wrote:

> v.in.ogr dsn=force_lrconnect_cl_onlycat139.shp
> does it work then?

No. It can't. Because force_lrconnect_cl_onlycat139.shp is in
$HOME/dsn=force_lrconnect_cl_onlycat139

> what if you change the dir name to something not the same as the filename?
Good guess! It works then:

$ mv force_lrconnect_cl_onlycat139 shorter
$ v.in.ogr dsn=shorter/ output=force_lrconnect_cl_onlycat139
layer=force_lrconnect_cl_onlycat139
(no segfault, shape imports fine)

But funny thing is that same command that segfaults in my location:

$ vin.ogr dsn=force_lrconnect_cl_onlycat139/
output=force_lrconnect_cl_onlycat139_import layer=force_lrconnect_cl_onlycat139
works fine in spearfish!, if projection check is -o(verrided) of course.


That made we wonder whether it would also work in my location if I use the -o
flag there as well - but still v.in.ogr segfaults even though. Hmm.

Maciek
Mon, Oct 2 2006 13:43:56    Mail sent by tutey@o2.pl  
Return-Path <tutey@o2.pl>
Delivered-To grass-bugs@lists.intevation.de
Message-ID <4520FB79.8000208@o2.pl>
Date Mon, 02 Oct 2006 13:43:53 +0200
From Maciej Sieczka <tutey@o2.pl>
User-Agent Thunderbird 1.5.0.7 (X11/20060922)
MIME-Version 1.0
To Maciek Sieczka via RT <grass-bugs@intevation.de>
Cc grass-dev@grass.itc.it, hamish_nospam@yahoo.com
Subject Re: [GRASS-dev] [bug #5176] (grass) v.in.ogr: segfault when a full path to dsn is missing
References <20061002112221.1D3331005C3@lists.intevation.de>
In-Reply-To <20061002112221.1D3331005C3@lists.intevation.de>
Content-Type text/plain; charset=ISO-8859-2
Content-Transfer-Encoding 7bit
X-Virus-Scanned by amavisd-new at intevation.de
X-Spam-Status No, hits=-5 tagged_above=-999 required=3 tests=[BAYES_00=-5]
X-Spam-Level
Maciek Sieczka via RT wrote:
> Hamish wrote:

>> v.in.ogr dsn=force_lrconnect_cl_onlycat139.shp
>> does it work then?

> No. It can't. Because force_lrconnect_cl_onlycat139.shp is in
> $HOME/dsn=force_lrconnect_cl_onlycat139

Correction: the last line above should read:

> $HOME/force_lrconnect_cl_onlycat139/

Maciek


Tue, Oct 3 2006 05:47:19    Mail sent by hamish_nospam@yahoo.com  
Return-Path <hamish_nospam@yahoo.com>
Delivered-To grass-bugs@lists.intevation.de
Date Tue, 3 Oct 2006 16:47:06 +1300
From Hamish <hamish_nospam@yahoo.com>
To Maciek Sieczka via RT <grass-bugs@intevation.de>
Cc grass-dev@grass.itc.it
Subject Re: [bug #5176] (grass) v.in.ogr: segfault when a full path to dsn is missing
Message-Id <20061003164706.29024fa6.hamish_nospam@yahoo.com>
In-Reply-To <20061002112221.1D3331005C3@lists.intevation.de>
References <20061002112221.1D3331005C3@lists.intevation.de>
X-Mailer Sylpheed version 1.0.4 (GTK+ 1.2.10; i386-pc-linux-gnu)
X-Face M<EoB)"*Z~u!,vFhXmw}R_KbdBta*P_=T|rbBL'e1/CQ9;/1g\BU3&!=y8ria$2Uk!HT&BB 8i?|X_+7~1jsy}F~g$2va%3fV`*=L(*cem[@3\yg,G,@rg6/QMJ
Mime-Version 1.0
Content-Type text/plain; charset=US-ASCII
Content-Transfer-Encoding 7bit
X-Virus-Scanned by amavisd-new at intevation.de
X-Spam-Status No, hits=-2.3 tagged_above=-999 required=3 tests=[BAYES_00=-5, FORGED_YAHOO_RCVD=2.7]
X-Spam-Level
Maciek Sieczka via RT wrote:
> $ v.in.ogr dsn=shorter/ 


what if you leave off the trailing "/" in the dsn?


Hamish


Tue, Oct 3 2006 13:37:21    Mail sent by msieczka  
hamish_nospam@yahoo.com wrote (Tue, Oct 3 2006 05:47:19):

> Maciek Sieczka via RT wrote:

>> $ v.in.ogr dsn=shorter/ 
 
> what if you leave off the trailing "/" in the dsn?

It doesn't change anything. Still a segfault if
"dsn=force_lrconnect_cl_onlycat139" and no segfault if "dsn=shorter". Looks
like the string length is the key.

Maciek
Tue, Oct 3 2006 13:57:13    Mail sent by neteler@itc.it  
Return-Path <neteler@itc.it>
Delivered-To grass-bugs@lists.intevation.de
X-AuditID d94d5003-ac3fabb000000fbc-e4-45225017cdc9
Date Tue, 3 Oct 2006 13:57:11 +0200
From Markus Neteler <neteler@itc.it>
To Maciek Sieczka via RT <grass-bugs@intevation.de>
Cc grass-dev@grass.itc.it
Subject Re: [GRASS-dev] [bug #5176] (grass) v.in.ogr: segfault when a full path to dsn is missing
Message-ID <20061003115711.GE25302@bartok.itc.it>
Mail-Followup-To Maciek Sieczka via RT <grass-bugs@intevation.de>, grass-dev@grass.itc.it
References <20061003113721.CAC1D1006A9@lists.intevation.de>
Mime-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Disposition inline
In-Reply-To <20061003113721.CAC1D1006A9@lists.intevation.de>
User-Agent Mutt/1.4.2.2i
X-PGP-Key http://www.gdf-hannover.de/neteler/markus_gpgkey.asc
X-PGP-Fingerprint D4D5 2F80 120E AD60 E2F6 2297 21B3 D02B E1E7 E789
X-Brightmail-Tracker AAAAAA==
X-Virus-Scanned by amavisd-new at intevation.de
X-Spam-Status No, hits=-5 tagged_above=-999 required=3 tests=[BAYES_00=-5]
X-Spam-Level
On Tue, Oct 03, 2006 at 01:37:21PM +0200, Maciek Sieczka via RT wrote:
> hamish_nospam@yahoo.com wrote (Tue, Oct 3 2006 05:47:19):
> 
> > Maciek Sieczka via RT wrote:
> 
> >> $ v.in.ogr dsn=shorter/ 
>  
> > what if you leave off the trailing "/" in the dsn?
> 
> It doesn't change anything. Still a segfault if
> "dsn=force_lrconnect_cl_onlycat139" and no segfault if "dsn=shorter". Looks
> like the string length is the key.

I just made a test:

GRASS 6.3.cvs (spearfish60):~ > v.out.ogr roads dsn=myroads_12345678901234567890_test.shp
olayer=roads
Exporting 825 points/lines...
825 features written

GRASS 6.3.cvs (spearfish60):~ > v.in.ogr myroads_12345678901234567890_test.shp
out=myroads
A datum name nad27 (North_American_Datum_1927) was specified without transformation
parameters.
WARNING: Non-interactive mode: the GRASS default for nad27 is
         towgs84=-22.000,157.000,176.000.
Projection of input dataset and current location appear to match.
Proceeding with import...
Layer: myroads_12345678901234567890_test
WARNING: Column name changed: 'cat' -> 'cat_'
-----------------------------------------------------
Building topology ...
825 primitives registered
...

This works.

Best is to use a debugger. See here how to do that with 'ddd':
http://grass.gdf-hannover.de/wiki/GRASS_Debugging#Using_DDD_.28gdb_graphical_frontend.29
It is fairly easy to handle.

Markus


Tue, Oct 3 2006 14:23:08    Mail sent by tutey@o2.pl  
Return-Path <tutey@o2.pl>
Delivered-To grass-bugs@lists.intevation.de
Message-ID <4522562A.2060309@o2.pl>
Date Tue, 03 Oct 2006 14:23:06 +0200
From Maciej Sieczka <tutey@o2.pl>
User-Agent Thunderbird 1.5.0.7 (X11/20060922)
MIME-Version 1.0
To grass-dev@grass.itc.it, Maciek Sieczka via RT <grass-bugs@intevation.de>
Cc Markus Neteler <neteler@itc.it>
Subject Re: [GRASS-dev] [bug #5176] (grass) v.in.ogr: segfault when a full path to dsn is missing
References <20061003113721.CAC1D1006A9@lists.intevation.de> <20061003115711.GE25302@bartok.itc.it>
In-Reply-To <20061003115711.GE25302@bartok.itc.it>
Content-Type text/plain; charset=ISO-8859-2
Content-Transfer-Encoding 7bit
X-Virus-Scanned by amavisd-new at intevation.de
X-Spam-Status No, hits=-5 tagged_above=-999 required=3 tests=[BAYES_00=-5]
X-Spam-Level
Markus Neteler wrote:

> Best is to use a debugger. See here how to do that with 'ddd':
> http://grass.gdf-hannover.de/wiki/GRASS_Debugging#Using_DDD_.28gdb_graphical_frontend.29
OK, done, but some different way:

$ ulimit -c 3000
$ grass63
$ v.in.ogr dsn=force_lrconnect_cl_onlycat139
output=force_lrconnect_cl_onlycat139_import
layer=force_lrconnect_cl_onlycat139

(segfault)

$ gdb v.in.ogr core

(gdb) bt
#0  0x00010101 in ?? ()
#1  0xb7cb5c2f in OGRSpatialReference::Release ()
   from /usr/local/lib/libgdal.so.1
#2  0xb7cab4e7 in OGRGeometry::~OGRGeometry () from
/usr/local/lib/libgdal.so.1
#3  0xb7ca6810 in OGRCurve::~OGRCurve () from /usr/local/lib/libgdal.so.1
#4  0xb7ca6ad8 in OGRLineString::~OGRLineString ()
   from /usr/local/lib/libgdal.so.1
#5  0xb7caf6ff in OGRFeature::~OGRFeature () from
/usr/local/lib/libgdal.so.1
#6  0xb7caefa5 in OGR_F_Destroy () from /usr/local/lib/libgdal.so.1
#7  0x0804ccfc in main (argc=4, argv=0xbffcb044) at main.c:744
(gdb) q

Any good?

Maciek


Thu, Oct 5 2006 05:35:57    Mail sent by rez@touchofmadness.com  
Return-Path <rez@touchofmadness.com>
Delivered-To grass-bugs@lists.intevation.de
Subject Re: [GRASS-dev] [bug #5176] (grass) v.in.ogr: segfault when a full path to dsn is missing
From Brad Douglas <rez@touchofmadness.com>
Reply-To rez@touchofmadness.com
To Maciek Sieczka via RT <grass-bugs@intevation.de>
Cc grass-dev@grass.itc.it, hamish_nospam@yahoo.com
In-Reply-To <20061003113721.CAC1D1006A9@lists.intevation.de>
References <20061003113721.CAC1D1006A9@lists.intevation.de>
Content-Type text/plain
Date Wed, 04 Oct 2006 20:35:35 -0700
Message-Id <1160019335.2593.51.camel@devel>
Mime-Version 1.0
X-Mailer Evolution 2.6.3 (2.6.3-1.fc5.5)
Content-Transfer-Encoding 7bit
X-Virus-Scanned by amavisd-new at intevation.de
X-Spam-Status No, hits=-5 tagged_above=-999 required=3 tests=[BAYES_00=-5]
X-Spam-Level
On Tue, 2006-10-03 at 13:37 +0200, Maciek Sieczka via RT wrote:
> hamish_nospam@yahoo.com wrote (Tue, Oct 3 2006 05:47:19):
> 
> > Maciek Sieczka via RT wrote:
> 
> >> $ v.in.ogr dsn=shorter/ 
>  
> > what if you leave off the trailing "/" in the dsn?
> 
> It doesn't change anything. Still a segfault if
> "dsn=force_lrconnect_cl_onlycat139" and no segfault if "dsn=shorter". Looks
> like the string length is the key.

Should be fixed in CVS.


-- 
Brad Douglas <rez touchofmadness com>                      KB8UYR
Address: 37.493,-121.924 / WGS84    National Map Corps #TNMC-3785


Sat, Oct 7 2006 13:45:21    Mail sent by msieczka  
rez@touchofmadness.com wrote (Thu, Oct 5 2006 05:35:57):

> Should be fixed in CVS.

Brad,

I'm sorry but it's not. Still exactly the same problem using today's CVS.


Here's a backtrace:

$ ulimit -c 3000
$ grass63
$ v.in.ogr dsn=force_lrconnect_cl_onlycat139
output=force_lrconnect_cl_onlycat139_import
layer=force_lrconnect_cl_onlycat139

(segfault)

$ gdb v.in.ogr core

(gdb) bt
#0  0x00010101 in ?? ()
#1  0xb7cb5c2f in OGRSpatialReference::Release ()
   from /usr/local/lib/libgdal.so.1
#2  0xb7cab4e7 in OGRGeometry::~OGRGeometry () from
/usr/local/lib/libgdal.so.1
#3  0xb7ca6810 in OGRCurve::~OGRCurve () from /usr/local/lib/libgdal.so.1
#4  0xb7ca6ad8 in OGRLineString::~OGRLineString ()
   from /usr/local/lib/libgdal.so.1
#5  0xb7caf6ff in OGRFeature::~OGRFeature () from
/usr/local/lib/libgdal.so.1
#6  0xb7caefa5 in OGR_F_Destroy () from /usr/local/lib/libgdal.so.1
#7  0x0804ccfc in main (argc=4, argv=0xbffcb044) at main.c:744
(gdb) q


Grass or GDAL issue? Using GDAL 1.3.2+CVS 2006-07-24.

Maciek
Sat, Oct 7 2006 21:07:25    Mail sent by rez@touchofmadness.com  
Return-Path <rez@touchofmadness.com>
Delivered-To grass-bugs@lists.intevation.de
Subject Re: [bug #5176] (grass) v.in.ogr: segfault when a full path to dsn is missing
From Brad Douglas <rez@touchofmadness.com>
Reply-To rez@touchofmadness.com
To Maciek Sieczka via RT <grass-bugs@intevation.de>
In-Reply-To <20061007114521.0058910015B@lists.intevation.de>
References <20061007114521.0058910015B@lists.intevation.de>
Content-Type text/plain
Date Sat, 07 Oct 2006 12:07:09 -0700
Message-Id <1160248029.2382.60.camel@devel>
Mime-Version 1.0
X-Mailer Evolution 2.6.3 (2.6.3-1.fc5.5)
Content-Transfer-Encoding 7bit
X-Virus-Scanned by amavisd-new at intevation.de
X-Spam-Status No, hits=-5 tagged_above=-999 required=3 tests=[BAYES_00=-5]
X-Spam-Level
On Sat, 2006-10-07 at 13:45 +0200, Maciek Sieczka via RT wrote:
> rez@touchofmadness.com wrote (Thu, Oct 5 2006 05:35:57):
> 
> > Should be fixed in CVS.
> 
> Brad,
> 
> I'm sorry but it's not. Still exactly the same problem using today's CVS.
> 
> 
> Here's a backtrace:
> 
> $ ulimit -c 3000
> $ grass63
> $ v.in.ogr dsn=force_lrconnect_cl_onlycat139
> output=force_lrconnect_cl_onlycat139_import
> layer=force_lrconnect_cl_onlycat139
> 
> (segfault)
> 
> $ gdb v.in.ogr core

Maciek,

IIRC, shortening the file name imports correctly, right?  Could you
provide me with a copy of your data?  I'll see if I can't see exactly
where the problem is.


-- 
Brad Douglas <rez touchofmadness com>                      KB8UYR
Address: 37.493,-121.924 / WGS84    National Map Corps #TNMC-3785


Comment | Reply | Take | Resolve

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