Ticket #705 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

ST_Distance on points crashes server

Reported by: robe Owned by: pramsey
Priority: blocker Milestone: PostGIS 2.0.0
Component: postgis Version: trunk
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

Changed 3 years ago by pramsey

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

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);

Changed 3 years ago by nicklas

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.