Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#705 closed defect (fixed)

ST_Distance on points crashes server

Reported by: robe Owned by: pramsey
Priority: blocker Milestone: PostGIS 2.0.0
Component: postgis Version: master
Keywords: Cc:

Description

I assume this is a result of recent changes since it wasn't crashing last I tried on Friday.

-- this crashes --
SELECT ST_Distance(foo1.the_geom, foo2.the_geom)
FROM (SELECT ST_GeomFromText('POINT(-11.1111111 40)') UNION ALL 
	SELECT ST_GeomFromText('POINT(-11.1111111 55)') ) As foo1(the_geom)
	CROSS JOIN (SELECT ST_GeomFromText('POINT(-11.1111111 40)') 
  UNION ALL SELECT ST_GeomFromText('POINT(-11.1111111 55)') ) As foo2(the_geom);

— this doesn't crash -

SELECT ST_Distance(foo1.the_geom, foo2.the_geom)
FROM (SELECT ST_GeomFromText('POINT(-11.1111111 40)') UNION ALL 
	SELECT ST_GeomFromText('POINT(-11.1111111 55)') ) As foo1(the_geom)
	CROSS JOIN (SELECT ST_GeomFromText('POINT(-11.1111111 40)') 
  UNION ALL SELECT ST_GeomFromText('POINT(-11.1111111 55)') ) As foo2(the_geom) limit 1;

Change History (2)

comment:1 by pramsey, 13 years ago

Resolution: fixed
Status: newclosed

Fixed at r6349. There was a syntax error in a PG_FREE_IF_COPY call that double freed the first argument, like so

PG_FREE_IF_COPY(geom1, 0);
PG_FREE_IF_COPY(geom2, 0);

comment:2 by nicklas, 13 years ago

Sorry about that

I didn't think about that commit when I saw the ticket.

Thanks Paul and Regina

Note: See TracTickets for help on using tickets.