﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
21662	Crash if a GEOS prepared geometry's parent geometry loses reference	bugs@…	nobody	"Django 1.6.1, libgeos-c1 debian version 3.3.3-1.1

The following:

{{{
>>> from django.contrib.gis.geos import GEOSGeometry , Point
>>> g = GEOSGeometry ( ""MULTIPOLYGON (((0.5694200000000000 51.0155570000000012, 0.5682199999999999 51.1943380000000019, 0.7769980000000000 51.1763400000000033, 0.7637990000000000 50.9747619999999984, 0.5694200000000000 51.0155570000000012)), ((-0.5128650000000000 51.8554680000000019, 0.3390440000000000 51.8014739999999989, 0.3306450000000000 51.1175470000000018, -0.1577030000000000 51.2423330000000021, -0.6244530000000000 51.1091470000000001, -0.6664480000000000 51.7426800000000000, -0.5128650000000000 51.8554680000000019)))"")
>>> g = g.prepared
>>> g.contains ( Point ( 0 , 0 ) )
}}}

causes a crash:

{{{
pure virtual method called
terminate called without an active exception
Aborted
}}}

It seems a reference to the parent geometry isn't being kept by the prepared geometry, it's getting garbage collected and the following vtable lookup goes awry. Just a guess.

Originally discovered on django 1.4.3."	Bug	closed	GIS	1.6	Normal	fixed	gis geos prepared multipolygon		Accepted	1	0	0	0	0	0
