Opened 3 years ago

Closed 3 years ago

#32293 closed Uncategorized (invalid)

import _scproxy and spatialite database backend segfaults

Reported by: Jon Janzen Owned by: nobody
Component: Uncategorized Version: 3.1
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

This bug started happening to me when I upgraded to macOS 11 Big Sur, but this may be coincidence as I upgraded all of my homebrew packages at the same time.

This bug was traced down from having the graphene_django module in INSTALLED_APPS. This module imports a lot of things but one of which is urllib.request, which in turn actually imports _scproxy.

Steps to reproduce:

  1. django-admin startproject crashdemo && cd crashdemo
  2. Edit crashdemo/settings.py to use the spatialite backend instead of sqlite3
  3. Add import _scproxy to settings.py (actual file doesn't matter, as long as it's imported during django startup)
  4. Run python3 manage.py runserver --noreload (--noreload not strictly necessary, but it causes the segfault to occur in the main thread)

Expected outcome:

Django starts up normally.

Actual outcome:

Performing system checks...

System check identified no issues (0 silenced).
Segmentation fault: 11

My Environment:

macOS Big Sur 11.1 (x86-64)
sqlite3 is from homebrew
libspatialite/gdal are from homebrew
python@3.8 from homebrew (issue still exists when building from latest source)
django is 3.1.4 from pip (issue still exists when installing from latest source)

I've set some debugging points inside the C source for the _scproxy module, and it seems like the functions provided by the module aren't even called leading up to the segfault. It seems like the shared object just needs to be loaded? I'm not sure how to debug this issue further.

I've attached a macOS crash report and a Python traceback produced by cpython-lldb's py-bt command that indicates that this segfault is triggered when attempting to load the libspatialite extension into sqlite. I've confirmed this by wrapping that call with print statements and running without a debugger attached. The macOS crash report seems to point to something within libsqlite as being the culprit, but I don't really understand what I'm talking about here.

Since I imagine this is a highly environment-specific bug report (perhaps just affecting my Mac), I'm happy to provide any additional information, run any tests, or try potential solutions to help solve this issue.

Attachments (2)

macos_report.txt (73.6 KB ) - added by Jon Janzen 3 years ago.
macOS Crash Report
py_bt.txt (6.6 KB ) - added by Jon Janzen 3 years ago.
Python Traceback

Download all attachments as: .zip

Change History (3)

by Jon Janzen, 3 years ago

Attachment: macos_report.txt added

macOS Crash Report

by Jon Janzen, 3 years ago

Attachment: py_bt.txt added

Python Traceback

comment:1 by Carlton Gibson, 3 years ago

Resolution: invalid
Status: newclosed

Hi Jon. Sorry to say, this isn’t really an issue with Django that we can address here.

It’s not clear exactly what the issue could is, but I’d suggest that you’ll need to review each installed component checking for that you have the latest versions and such. I’m afraid that’s probably a bit of a detective hunt. I’d guess a post to the spatialite forums might be your best way forwards...

Sorry that doesn’t get you moving.

Note: See TracTickets for help on using tickets.
Back to Top