[postgis-devel] [PostGIS] #1434: ST_GeomFromGeoJSON - Malformed GeoJSON causes SIGSEGV in postgres process?

PostGIS trac at osgeo.org
Fri Jan 6 14:52:35 PST 2012


#1434: ST_GeomFromGeoJSON - Malformed GeoJSON causes SIGSEGV in postgres process?
----------------------+-----------------------------------------------------
 Reporter:  tokumine  |       Owner:  pramsey      
     Type:  defect    |      Status:  new          
 Priority:  medium    |   Milestone:  PostGIS 2.0.0
Component:  postgis   |     Version:  trunk        
 Keywords:  geojson   |  
----------------------+-----------------------------------------------------
 Hi all,

 I am really enjoying the new ST_GeomFromGeoJSON functionality in
 PostGIS2.0SVN.

 However, if I try to create geometry with certain types of invalid GeoJSON
 I have managed to trigger a SIGSEGV in the postgres process that causes
 cascading rollbacks and restarts to all other existing postgres processes.

 '''Works:'''
 {{{
 select ST_GeomFromGeoJSON('{ "type": "Point", "coordinates": [100.0, 0.0]
 }');
 }}}

 '''Throws 'ERROR:  invalid GeoJson representation' as expected:'''
 {{{
 select ST_GeomFromGeoJSON('{ "type": "Poooooooooooooint", "coordinates":
 [100.0, 0.0] }');
 }}}


 '''Causes SIGSEGV:'''
 {{{
 select ST_GeomFromGeoJSON('{ "type": "Point", "crashme": [100.0, 0.0] }');
 select ST_GeomFromGeoJSON('crashme');
 }}}

 I can trigger this on my Ubuntu and OSX dev machines and attach the OSX
 crashlog and the Ubuntu postgres logs for reference.

 Please note that occasionally the SQL commands will need to be run a few
 times to trigger the SIGSEGV.

 All the best,

 Simon

-- 
Ticket URL: <http://trac.osgeo.org/postgis/ticket/1434>
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-devel mailing list