Ticket #370 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

lwgeom_free not empty safe

Reported by: robe Owned by: pramsey
Priority: medium Milestone: PostGIS 1.5.0
Component: postgis Version: trunk
Keywords: Cc:

Description (last modified by pramsey) (diff)

SELECT ST_CollectionExtract(foo1.the_geom, 3) 
  FROM ((SELECT ST_GeomFromText('GEOMETRYCOLLECTION EMPTY',4326) As the_geom
  UNION ALL SELECT ST_GeomFromText('POLYGON EMPTY',4326) As the_geom
)
) As foo1
LIMIT 3;

Crashes server.

Change History

Changed 2 years ago by pramsey

  • description modified (diff)

Changed 2 years ago by pramsey

  • summary changed from ST_CollectionExtract not Empty safe to lwgeom_free not empty safe

In fact, the problem is a little deeper. Hard to believe we don't do this in other places, but it seems to be a generic problem with freeing empties, or more to the point, that the lwgeom's returned by pglwgeom_deserialize aren't constructed in such a way we can free them safely. More investigation req'd.

Changed 2 years ago by pramsey

  • status changed from new to closed
  • resolution set to fixed

Fixed up de-serialization routines to avoid *geoms = malloc(0) cases which were causing free to fail later on down the line (r5099)

Note: See TracTickets for help on using tickets.