[Django] #27472: GEOSGeometry('POINT EMPTY').ogr crashes

28 views
Skip to first unread message

Django

unread,
Nov 10, 2016, 2:19:38 PM11/10/16
to django-...@googlegroups.com
#27472: GEOSGeometry('POINT EMPTY').ogr crashes
-------------------------------------------+------------------------
Reporter: Sergey Fedoseev | Owner: nobody
Type: Bug | Status: new
Component: GIS | Version: 1.8
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------------+------------------------
{{{
#!div style="font-size: 80%"
{{{#!python
In [1]: from django.contrib.gis.geos import GEOSGeometry

In [2]: GEOSGeometry('POINT EMPTY').ogr
No handlers could be found for logger "django.contrib.gis"
---------------------------------------------------------------------------
GEOSException Traceback (most recent call
last)
<ipython-input-2-2913b5e786ad> in <module>()
----> 1 GEOSGeometry('POINT EMPTY').ogr

/home/sergey/dev/django/django/contrib/gis/geos/geometry.pyc in ogr(self)
484 except gdal.SRSException:
485 pass
--> 486 return gdal.OGRGeometry(self.wkb)
487
488 @property

/home/sergey/dev/django/django/contrib/gis/geos/geometry.pyc in wkb(self)
450 `ewkb` property instead.
451 """
--> 452 return wkb_w(3 if self.hasz else 2).write(self)
453
454 @property

/home/sergey/dev/django/django/contrib/gis/geos/prototypes/io.pyc in
write(self, geom)
227 def write(self, geom):
228 "Returns the WKB representation of the given geometry."
--> 229 return six.memoryview(wkb_writer_write(self.ptr, geom.ptr,
byref(c_size_t())))
230
231 def write_hex(self, geom):

/home/sergey/dev/django/django/contrib/gis/geos/libgeos.pyc in
__call__(self, *args, **kwargs)
155 if self.func is None:
156 self.func = self.get_func(*self.args, **self.kwargs)
--> 157 return self.func(*args, **kwargs)
158
159 def get_func(self, *args, **kwargs):

/home/sergey/dev/django/django/contrib/gis/geos/prototypes/threadsafe.pyc
in __call__(self, *args)
54 # Call the threaded GEOS routine with pointer of the
context handle
55 # as the first argument.
---> 56 return self.cfunc(self.thread_context.handle.ptr,
*args)
57 else:
58 return self.cfunc(*args)

/home/sergey/dev/django/django/contrib/gis/geos/prototypes/errcheck.pyc in
check_sized_string(result, func, cargs)
60 """
61 if not result:
---> 62 raise GEOSException('Invalid string pointer returned by
GEOS C function "%s"' % func.__name__)
63 # A c_size_t object is passed in by reference for the second
64 # argument on these routines, and its needed to determine the

GEOSException: Invalid string pointer returned by GEOS C function
"GEOSWKBWriter_write_r"
}}}
}}}

The cause of this problem is that empty points couldn't be represented in
WKB.
There are similar crashes in the other places. I'm not sure if individual
tickets should be created or all fixes should be done within the bounds of
this ticket.

--
Ticket URL: <https://code.djangoproject.com/ticket/27472>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Nov 10, 2016, 2:19:58 PM11/10/16
to django-...@googlegroups.com
#27472: GEOSGeometry('POINT EMPTY').ogr crashes
-------------------------------------+-------------------------------------
Reporter: Sergey Fedoseev | Owner: Sergey
| Fedoseev
Type: Bug | Status: assigned
Component: GIS | Version: 1.8
Severity: Normal | Resolution:

Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Sergey Fedoseev):

* status: new => assigned
* owner: nobody => Sergey Fedoseev


--
Ticket URL: <https://code.djangoproject.com/ticket/27472#comment:1>

Django

unread,
Nov 11, 2016, 6:34:03 AM11/11/16
to django-...@googlegroups.com
#27472: GEOSGeometry('POINT EMPTY').ogr crashes
-------------------------------------+-------------------------------------
Reporter: Sergey Fedoseev | Owner: Sergey
| Fedoseev
Type: Bug | Status: assigned
Component: GIS | Version: 1.8
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

* stage: Unreviewed => Accepted


Comment:

I think however you want to provide fixes will be fine. Perhaps multiple
commits referencing the same ticket would be fine.

--
Ticket URL: <https://code.djangoproject.com/ticket/27472#comment:2>

Django

unread,
Dec 2, 2016, 3:57:16 AM12/2/16
to django-...@googlegroups.com
#27472: GEOSGeometry('POINT EMPTY').ogr crashes
-------------------------------------+-------------------------------------
Reporter: Sergey Fedoseev | Owner: Sergey
| Fedoseev
Type: Bug | Status: assigned
Component: GIS | Version: 1.8

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Sergey Fedoseev):

* has_patch: 0 => 1


Comment:

[https://github.com/django/django/pull/7652 PR]

--
Ticket URL: <https://code.djangoproject.com/ticket/27472#comment:3>

Django

unread,
Dec 7, 2016, 3:10:02 PM12/7/16
to django-...@googlegroups.com
#27472: GEOSGeometry('POINT EMPTY').ogr crashes
-------------------------------------+-------------------------------------
Reporter: Sergey Fedoseev | Owner: Sergey
| Fedoseev
Type: Bug | Status: assigned
Component: GIS | Version: 1.8
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

* stage: Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/27472#comment:4>

Django

unread,
Dec 8, 2016, 10:50:50 AM12/8/16
to django-...@googlegroups.com
#27472: GEOSGeometry('POINT EMPTY').ogr crashes
-------------------------------------+-------------------------------------
Reporter: Sergey Fedoseev | Owner: Sergey
| Fedoseev
Type: Bug | Status: assigned
Component: GIS | Version: 1.8

Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"a413ef2155c4f3e5bf6954608d65a96631feb7e6" a413ef21]:
{{{
#!CommitTicketReference repository=""
revision="a413ef2155c4f3e5bf6954608d65a96631feb7e6"
Refs #27472 -- Fixed OGRGeometry('POINT EMPTY').geos crash.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/27472#comment:6>

Django

unread,
Dec 8, 2016, 10:50:51 AM12/8/16
to django-...@googlegroups.com
#27472: GEOSGeometry('POINT EMPTY').ogr crashes
-------------------------------------+-------------------------------------
Reporter: Sergey Fedoseev | Owner: Sergey
| Fedoseev
Type: Bug | Status: assigned
Component: GIS | Version: 1.8

Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"65a1f32319a0a58f8458060a61c7bab0fa12292e" 65a1f323]:
{{{
#!CommitTicketReference repository=""
revision="65a1f32319a0a58f8458060a61c7bab0fa12292e"
Refs #27472 -- Fixed GEOSGeometry('POINT EMPTY').ogr crash.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/27472#comment:5>

Django

unread,
Dec 8, 2016, 10:51:13 AM12/8/16
to django-...@googlegroups.com
#27472: GEOSGeometry('POINT EMPTY').ogr crashes
-------------------------------------+-------------------------------------
Reporter: Sergey Fedoseev | Owner: Sergey
| Fedoseev
Type: Bug | Status: closed
Component: GIS | Version: 1.8
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham <timograham@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"9b79281e315268bdbba2704b253eef23b46da023" 9b79281]:
{{{
#!CommitTicketReference repository=""
revision="9b79281e315268bdbba2704b253eef23b46da023"
Fixed #27472 -- Fixed GEOSGeometry('POINT EMPTY').transform crash.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/27472#comment:7>

Django

unread,
Jul 9, 2018, 11:02:30 AM7/9/18
to django-...@googlegroups.com
#27472: GEOSGeometry('POINT EMPTY').ogr crashes
-------------------------------------+-------------------------------------
Reporter: Sergey Fedoseev | Owner: Sergey
| Fedoseev
Type: Bug | Status: closed
Component: GIS | Version: 1.8

Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"3411c5551aa4ec141eb214f2928db4b077b41dd3" 3411c555]:
{{{
#!CommitTicketReference repository=""
revision="3411c5551aa4ec141eb214f2928db4b077b41dd3"
Refs #27472 -- Fixed crash during pickling of empty GEOS point.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/27472#comment:8>

Reply all
Reply to author
Forward
0 new messages