[postgis-tickets] [PostGIS] #2340: typmod check error crashing when in trigger on windows 64-bit EDB

PostGIS trac at osgeo.org
Mon May 20 07:12:45 PDT 2013


#2340: typmod check error  crashing when in trigger  on windows 64-bit EDB
----------------------+-----------------------------------------------------
 Reporter:  robe      |       Owner:  robe         
     Type:  defect    |      Status:  new          
 Priority:  critical  |   Milestone:  PostGIS 2.0.4
Component:  postgis   |     Version:  2.0.x        
 Keywords:            |  
----------------------+-----------------------------------------------------
 The tickets crash noted in #2338 I isolated to:


 {{{
 drop table if exists a ;
 SELECT '<#1320>';
 CREATE TABLE A ( geom geometry(MultiPolygon, 4326),
                  geog geography(MultiPolygon, 4326) );


 CREATE OR REPLACE FUNCTION triga() RETURNS trigger AS
 $$ BEGIN
         NEW.geom = ST_GeometryN(New.geom,1);
         NEW.geog = ST_GeometryN(New.geog::geometry,1)::geography;
         RETURN NEW;
 END; $$ language plpgsql VOLATILE;
 CREATE TRIGGER triga_before
   BEFORE INSERT ON a FOR EACH ROW
   EXECUTE PROCEDURE triga();


 -- run these a couple of times
 INSERT INTO a(geog) VALUES('SRID=4326;MULTIPOLYGON (((0 0, 10 0, 10 10, 0
 0)))'::geography);
 INSERT INTO a(geom) VALUES('SRID=4326;MULTIPOLYGON (((0 0, 10 0, 10 10, 0
 0)))'::geometry);
 }}}

 {{{
 -- first time
 ERROR: Geometry type (Polygon) does not match column type (MultiPolygon)

 -- second time crash
 }}}


 crash
 Seems to be happening in postgis\gserialized_typmod.c  around line 141 in
 postgis_valid_typmod function:

 http://postgis.net/docs/doxygen/2.1/d4/df6/gserialized__typmod_8c_source.html#l00141

 I suspect all parts have same issue

 this is running on a windows 2008 R2 64bit server

 {{{
 POSTGIS="2.1.0beta3dev r11482" GEOS="3.4.0dev-CAPI-1.8.0 r0" PROJ="Rel.
 4.8.0, 6 March 2012" GDAL="GDAL 1.10.0, released 2013/04/24"
 LIBXML="2.7.8" LIBJSON="UNKNOWN" RASTER PostgreSQL 9.2.4, compiled by
 Visual C++ build 1600, 64-bit
 }}}

 and get similar failure with 2.0.4 branch.

-- 
Ticket URL: <http://trac.osgeo.org/postgis/ticket/2340>
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