DHI/terracotta

Segmentation fault in TerracottaDriver.insert with Shapely > 1.8.0

Closed this issue · 6 comments

Python: 3.9
OS / Architecture: macOS arm64

I encountered a segmentation fault whenever I tried inserting any raster with TerracottaDriver.insert. This was in an ingestion script that was previously working fine, with images that had once been successfully ingested.

After stepping through the code with PDB, I identified this line as the one causing the segfaults
https://github.com/DHI-GRAS/terracotta/blob/5cbe5412a7caf566a1bee0fcddad7d1d9e3ab8ca/terracotta/raster.py#L157

I was on Shapely 1.8.2, the newest release of Shapely, at the time of writing.
The latest version of Shapely that was found not to cause segfaults is 1.8.0.

I'm reporting this upstream with Shapely but leaving this here in case others have the same issue. Tagging as wontfix, as there's not much we can do about it.

@dionhaefner it might make sense for us to pin Shapely to 1.8.0 if we get more reports of people having this problem. This is most likely a problem with GEOS and might only be an issue on macOS arm64.

I should add that I'm on Terracotta 0.7.6.dev143+g5cbe541

Do you have a reference for the upstream issue?

I just created the upstream issue here shapely/shapely#1449

Wanted to produce a minimal example before posting.

Confirmed on my Mac. Let's see what comes out of it.

Seems to be fixed in the new 2.0 alpha 1 release, but that's a new major version, so hopefully the fix gets back-ported to 1.8.x

This turned out to be an issue in GEOS for Apple Silicon chips. It is now fixed.