[postgis-tickets] [PostGIS] #2185: Geometry output functions crash server with invalid WKT

PostGIS trac at osgeo.org
Wed Jan 23 20:47:25 PST 2013


#2185: Geometry output functions crash server with invalid WKT
---------------------+------------------------------------------------------
 Reporter:  mwtoews  |       Owner:  pramsey      
     Type:  defect   |      Status:  new          
 Priority:  medium   |   Milestone:  PostGIS 2.0.3
Component:  postgis  |     Version:  2.0.x        
 Keywords:           |  
---------------------+------------------------------------------------------

Comment(by mwtoews):

 I have two versions of PostgreSQL and PostGIS installed on my work PC on
 Windows 7 x64. Both were installed by Application Stack Builder at
 different times.

 Interestingly they have different results, in summary:
  * PostgreSQL 9.1.3 / PostGIS 2.0.0 r9605 - works
  * PostgreSQL 9.2.2 / PostGIS 2.0.1 r9979 - crashes (used for this bug
 reporting)

 Here are more details from both.

 {{{
 postgis=# SELECT version();
                            version
 -------------------------------------------------------------
  PostgreSQL 9.1.3, compiled by Visual C++ build 1500, 64-bit
 (1 row)


 postgis=# SELECT postgis_full_version();
 postgis_full_version

 -----------------------------------------------------------------------------------------------------------------------------------------------------------------------
  POSTGIS="2.0.0 r9605" GEOS="3.3.3-CAPI-1.7.4" PROJ="Rel. 4.8.0, 6 March
 2012" GDAL="GDAL 1.9.0, released 2011/12/29" LIBXML="2.7.8"
 LIBJSON="UNKNOWN" TOPOLOGY RASTER
 (1 row)


 postgis=# SELECT ST_AsText('POINT(3 4 hi)'::text);
 ERROR:  parse error - invalid geometry
 HINT:  "POINT(3 4 hi" <-- parse error at position 12 within geometry
 CONTEXT:  SQL function "st_astext" statement 1
 postgis=# SELECT ST_AsText('POINT(3 4 hi)'::text);
 ERROR:  parse error - invalid geometry
 HINT:  "POINT(3 4 hi" <-- parse error at position 12 within geometry
 CONTEXT:  SQL function "st_astext" statement 1
 }}}
 no crash, works as expected

 {{{
 postgis=# SELECT version();
                            version
 -------------------------------------------------------------
  PostgreSQL 9.2.2, compiled by Visual C++ build 1600, 64-bit
 (1 row)


 postgis=# SELECT postgis_full_version();
 NOTICE:  Function postgis_topology_scripts_installed() not found. Is
 topology support enabled and topology.sql installed?
 postgis_full_version
 --------------------------------------------------------------------------------------------------------------------------------------------------------------
  POSTGIS="2.0.1 r9979" GEOS="3.3.5-CAPI-1.7.5" PROJ="Rel. 4.8.0, 6 March
 2012" GDAL="GDAL 1.9.1, released 2012/05/15" LIBXML="2.7.8"
 LIBJSON="UNKNOWN" RASTER
 (1 row)


 postgis=# SELECT ST_AsText('POINT(3 4 hi)'::text);
 ERROR:  parse error - invalid geometry
 HINT:  "POINT(3 4 hi" <-- parse error at position 12 within geometry
 CONTEXT:  SQL function "st_astext" statement 1
 postgis=# SELECT ST_AsText('POINT(3 4 hi)'::text);
 server closed the connection unexpectedly
         This probably means the server terminated abnormally
         before or while processing the request.
 The connection to the server was lost. Attempting reset: Failed.
 }}}

-- 
Ticket URL: <http://trac.osgeo.org/postgis/ticket/2185#comment:6>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-tickets mailing list