Opened 13 years ago

Closed 13 years ago

#1308 closed defect (fixed)

ST_DumpAsPolygons breaks in debug mode

Reported by: dzwarg Owned by: pracine
Priority: medium Milestone: PostGIS 2.0.0
Component: raster Version: master
Keywords: Cc:

Description

When compiled with the flags:

--with-raster --enable-debug CFLAGS="-g -O0"

And performing this query (ST_Sum definition can be found in trunk/raster/test/regress/rt_mapalgebrafctngb.sql):

SELECT
  ST_Area(geom)
 FROM (SELECT
    (ST_DumpAsPolygons(
      ST_MapAlgebraFctNgb(rast, 1, NULL, 1, 1, 'ST_Sum(float[][], text, text[])'::regprocedure, 'NULL', NULL)
    )).*
   FROM ST_TestRaster(5, 5, 1) AS rast) AS foo;

ST_DumpAsPolygons causes a segfault on line 851:

POSTGIS_RT_DEBUGF(4, "Result %d, Polygon %s", call_cntr, geomval2[call_cntr].geom);
POSTGIS_RT_DEBUGF(4, "Result %d, val %s", call_cntr, geomval2[call_cntr].val);
POSTGIS_RT_DEBUGF(4, "Result %d, val %s", call_cntr, geomval2[call_cntr].srid); // <-- this line

Even when setting the SRID manually on rast, the behavior does not change.

Change History (1)

comment:1 by dzwarg, 13 years ago

Resolution: fixed
Status: newclosed

Fixed in r8179. Wrong sprintf characters for floating point and integer.

Note: See TracTickets for help on using tickets.