#21662 closed Bug (fixed)
Crash if a GEOS prepared geometry's parent geometry loses reference
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | GIS | Version: | 1.6 |
Severity: | Normal | Keywords: | gis geos prepared multipolygon |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
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.
Attachments (1)
Change History (6)
comment:1 by , 11 years ago
Component: | Uncategorized → GIS |
---|---|
Has patch: | set |
Triage Stage: | Unreviewed → Accepted |
by , 11 years ago
Attachment: | 21662.diff added |
---|
comment:2 by , 11 years ago
Huzzah - patch works for me fuzzy-applied to 1.6.1. Many thanks.
Merry xmas all.
comment:3 by , 11 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
Thanks for the report. Mind reviewing the attached patch?