I get "Segmentation fault: 11" when I'm trying to create any Multi* geometry on Macbook Air with M1 processor. I guess this related to some underlying library (GDAL, GEOS?), which is not working correctly on new CPU architecture. On Intel Macbook Pro and Ubuntu 20.40 all Multi* geometries work fine. Everything is installed using HomeBrew.
If someone could tell me how to try to reproduce this using lower level libraries, I could could point the bug report to the right party.
How to try this at home (assuming you have M1 Mac):
# Create virtualenv and open a Django shell
cd /tmp/ && python3 -m venv venv multisegfault && source multisegfault/bin/activate && pip install django && django-admin startproject segfaulttest && cd segfaulttest && python manage.py shell
# Copy and paste this one line to the shell:
from django.contrib.gis.geos import MultiLineString; MultiLineString()
Above should print something like this:
Python 3.9.2 (default, Mar 24 2021, 20:21:37)
[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 LineString, MultiLineString
>>> LineString()
<LineString object at 0x106a02708>
>>> MultiLineString()
Segmentation fault: 11
$ geos-config --version
3.9.1
$ gdal-config --version
3.2.2
$ brew info postgis
postgis: stable 3.1.1
--
Yours, Aapo Rista