Skip to content

SIGSEGV on querying using multiple connections #435

Description

@dhe128

What happens?

Concurrently querying select 1 for 8 DuckDBPyConnections, one in each thread, segfaults.

To Reproduce

Minimal reproduction:

import concurrent.futures
import faulthandler
import duckdb

faulthandler.enable()

conns = [duckdb.connect() for _ in range(8)]

def run(i):
    conns[i % 8].execute('SELECT 1').fetchall()

with concurrent.futures.ThreadPoolExecutor(8) as ex:
    for f in [ex.submit(run, i) for i in range(200)]:
        try: f.result()
        except Exception as e: print(f'{type(e).__name__}: {e}')

Expected output:
Empty, exit code 0

Actual output

RuntimeError: Could not allocate tuple object!
Fatal Python error: Segmentation fault

System: mac arm64, python3.12, duckdb 1.5.2
Also reproducible on a railway env with python 3.13, linux x86-64, duckdb 1.5.2

OS:

aarch64

DuckDB Version:

1.5.2

DuckDB Client:

1.5.2

Hardware:

No response

Full Name:

David He

Affiliation:

Intercept

Did you include all relevant configuration (e.g., CPU architecture, Linux distribution) to reproduce the issue?

  • Yes, I have

Did you include all code required to reproduce the issue?

  • Yes, I have

Did you include all relevant data sets for reproducing the issue?

Not applicable - the reproduction does not require a data set

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions