[Django] #32544: django.contrib.gis.geos import MultiPolygon segmentation fault (Apple M1)

61 views
Skip to first unread message

Django

unread,
Mar 12, 2021, 9:20:42 AM3/12/21
to django-...@googlegroups.com
#32544: django.contrib.gis.geos import MultiPolygon segmentation fault (Apple M1)
---------------------------------------------+------------------------
Reporter: Sebastian Kapunkt | Owner: nobody
Type: Bug | Status: new
Component: GIS | Version: 3.1
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 |
---------------------------------------------+------------------------
Using `MultiPolygon` on Apple MacBook pro with the M1 chip causes
`segmentation fault`.


Here is what I did to produce the error:

{{{
python manage.py shell

>>>from django.contrib.gis.geos import MultiPolygon
>>>MultiPolygon()
[1] 34350 segmentation fault python manage.py shell
}}}

I have these relevant settings in my settings.py:
{{{
GDAL_LIBRARY_PATH = os.getenv("GDAL_LIBRARY_PATH")
GEOS_LIBRARY_PATH = os.getenv("GEOS_LIBRARY_PATH")
}}}
.env
{{{
export GDAL_LIBRARY_PATH=/opt/homebrew/lib/libgdal.dylib
export GEOS_LIBRARY_PATH=/opt/homebrew/lib/libgeos_c.dylib
}}}

uname -a:
{{{
Darwin Sebastians-MacBook-Pro.local 20.3.0 Darwin Kernel Version 20.3.0:
Thu Jan 21 00:06:51 PST 2021; root:xnu-7195.81.3~1/RELEASE_ARM64_T8101
arm64
}}}

geos-config --version `3.9.1`

gdalinfo --version `GDAL 3.2.1, released 2020/12/29`

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

Django

unread,
Mar 12, 2021, 12:06:29 PM3/12/21
to django-...@googlegroups.com
#32544: Add support for GDAL 3.2 and GEOS 3.9.
-----------------------------------+------------------------------------

Reporter: Sebastian Kapunkt | Owner: nobody
Type: New feature | Status: new
Component: GIS | Version: 4.0
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 Mariusz Felisiak):

* cc: Claude Paroz (added)
* type: Bug => New feature
* version: 3.1 => 4.0
* stage: Unreviewed => Accepted


Comment:

GDAL 3.2 and GEOS 3.9 are not supported by Django, see
[https://docs.djangoproject.com/en/dev/ref/contrib/gis/install/geolibs/
docs]. I've change this ticket to a new feature.

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

Django

unread,
Mar 27, 2021, 12:36:51 PM3/27/21
to django-...@googlegroups.com
#32544: Add support for GDAL 3.2 and GEOS 3.9.
-----------------------------------+------------------------------------
Reporter: Sebastian Kapunkt | Owner: nobody
Type: New feature | Status: new
Component: GIS | Version: 4.0
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
-----------------------------------+------------------------------------

Comment (by Aapo Rista):

I guess this is not related to GEOS or GDAL versions, but M1 CPU
architecture and the bug is in GEOS. See #32600.

I've in this Macbook Pro (13-inch, 2017, Intel Core i5) software listed
below and I've no problems with multi geometries.


{{{
$ python manage.py shell
Python 3.9.2 (default, Feb 24 2021, 13:26:09)
[Clang 12.0.0 (clang-1200.0.32.29)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)


>>> from django.contrib.gis.geos import MultiPolygon
>>> MultiPolygon()

<MultiPolygon object at 0x1057ab490>
}}}

My new Macbook Air (M1, 2020) throws Segmentation fault 11 (as seen in
#32600).

$ geos-config --version
3.9.1

$ gdalinfo --version
GDAL 3.2.2, released 2021/03/05

$ python -V
Python 3.9.2

$ uname -a
Darwin mymac.local 20.3.0 Darwin Kernel Version 20.3.0: Thu Jan 21
00:07:06 PST 2021; root:xnu-7195.81.3~1/RELEASE_X86_64 x86_64

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

Django

unread,
Mar 27, 2021, 1:16:42 PM3/27/21
to django-...@googlegroups.com
#32544: Add support for GDAL 3.2 and GEOS 3.9.
-----------------------------------+------------------------------------
Reporter: Sebastian Kapunkt | Owner: nobody
Type: New feature | Status: new
Component: GIS | Version: 4.0
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
-----------------------------------+------------------------------------

Comment (by Mariusz Felisiak):

Aapo, thanks for details. Even if the crash is not related to GEOS or GDAL
versions, this ticket is still valid as we have some tests failures with
these versions.

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

Django

unread,
Apr 3, 2021, 8:39:39 AM4/3/21
to django-...@googlegroups.com
#32544: Add support for GDAL 3.2 and GEOS 3.9.
-------------------------------------+-------------------------------------
Reporter: Sebastian Kapunkt | Owner: Claude
| Paroz
Type: New feature | Status: assigned

Component: GIS | Version: 4.0
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 Claude Paroz):

* owner: nobody => Claude Paroz
* status: new => assigned


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

Django

unread,
Apr 3, 2021, 9:03:04 AM4/3/21
to django-...@googlegroups.com
#32544: Add support for GDAL 3.2 and GEOS 3.9.
-------------------------------------+-------------------------------------
Reporter: Sebastian Kapunkt | Owner: Claude
| Paroz
Type: New feature | Status: assigned
Component: GIS | Version: 4.0
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 Claude Paroz):

* has_patch: 0 => 1


Comment:

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

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

Django

unread,
Apr 7, 2021, 2:48:32 AM4/7/21
to django-...@googlegroups.com
#32544: Add support for GDAL 3.2 and GEOS 3.9.
-------------------------------------+-------------------------------------
Reporter: Sebastian Kapunkt | Owner: Claude
| Paroz
Type: New feature | Status: assigned
Component: GIS | Version: 4.0
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* needs_better_patch: 0 => 1


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

Django

unread,
Apr 7, 2021, 7:47:34 AM4/7/21
to django-...@googlegroups.com
#32544: Confirm support for GDAL 3.2 and GEOS 3.9.

-------------------------------------+-------------------------------------
Reporter: Sebastian Kapunkt | Owner: Claude
Type: | Paroz
Cleanup/optimization | Status: assigned

Component: GIS | Version: 4.0
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 Mariusz Felisiak):

* needs_better_patch: 1 => 0
* type: New feature => Cleanup/optimization
* stage: Accepted => Ready for checkin


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

Django

unread,
Apr 7, 2021, 11:02:57 AM4/7/21
to django-...@googlegroups.com
#32544: Confirm support for GDAL 3.2 and GEOS 3.9.
-------------------------------------+-------------------------------------
Reporter: Sebastian Kapunkt | Owner: Claude
Type: | Paroz
Cleanup/optimization | Status: closed
Component: GIS | Version: 4.0
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 Mariusz Felisiak <felisiak.mariusz@…>):

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


Comment:

In [changeset:"e3cfba0029516aafe40f963378e234df2c0d33bb" e3cfba00]:
{{{
#!CommitTicketReference repository=""
revision="e3cfba0029516aafe40f963378e234df2c0d33bb"
Fixed #32544 -- Confirmed support for GDAL 3.2 and GEOS 3.9.
}}}

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

Django

unread,
Apr 7, 2021, 11:06:15 AM4/7/21
to django-...@googlegroups.com
#32544: Confirm support for GDAL 3.2 and GEOS 3.9.
-------------------------------------+-------------------------------------
Reporter: Sebastian Kapunkt | Owner: Claude
Type: | Paroz
Cleanup/optimization | Status: closed
Component: GIS | Version: 4.0
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 Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"5eb17d31c365a58e77d32eea19b83ee5bae52f0c" 5eb17d31]:
{{{
#!CommitTicketReference repository=""
revision="5eb17d31c365a58e77d32eea19b83ee5bae52f0c"
[3.2.x] Fixed #32544 -- Confirmed support for GDAL 3.2 and GEOS 3.9.

Backport of e3cfba0029516aafe40f963378e234df2c0d33bb from main.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/32544#comment:9>

Reply all
Reply to author
Forward
0 new messages