Skip to content

Bus error when an extension is loaded into sqlite3 #101974

@jackbeagley

Description

@jackbeagley

Bug report

A clear and concise description of what the bug is.
Include a minimal, reproducible example (https://stackoverflow.com/help/minimal-reproducible-example), if possible.

Your environment

  • CPython versions tested on: 3.11.0, 3.10.9
  • Operating system and architecture: MacOS 13.2.1 arm64 (Macbook Pro M1 Pro 16")

When loading the mod_spatialite library into sqlite3 everything works as expected until I close the connection, at which point i get a bus error:

50000 bus error /opt/homebrew/Caskroom/miniforge/base/envs/main/bin/python

I am unsure if the bug is related to spatialite or python itself but I don't get the bus error if I comment out the line conn.load_extension(shared_lib). Example database from MWE: https://www.sqlitetutorial.net/wp-content/uploads/2018/03/chinook.zip

import sqlite3
import pandas as pd

shared_lib = '/opt/homebrew/lib/mod_spatialite.dylib'

conn = sqlite3.connect('chinook.db')

conn.enable_load_extension(True)
conn.load_extension(shared_lib)
sql = 'SELECT * FROM artists'

df = pd.read_sql(sql, conn)

conn.close()

Metadata

Metadata

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions