SIGSEGV in SQLFetchScroll (libmsodbcsql.18) under concurrent threaded fetch on macOS arm64
Maintainer thường phản hồi trong vòng 1 ngày
@bewithgaurav đang làm issue này rồi.
Từ ngày 15/7/2026.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
Summary
mssql-python 1.10.0 crashes with a SIGSEGV during concurrent multi-threaded fetching on macOS arm64. The process is killed by the signal with no Python traceback (exit 139). The macOS crash report puts the faulting frame inside libmsodbcsql.18.dylib at SQLFetchScroll, reached through the driver's ddbc_bindings (FetchBatchData / FetchMany_wrap).
This looks like the same underlying problem as #668 (TLS stream corruption under concurrent threaded reads on macOS arm64), but here the failure is a hard crash instead of corrupted rows or a link error, so I am reporting it separately with the native stack. More on that connection at the end.
Environment
- macOS 26.5.2 (build 25F84), Apple Silicon (arm64)
- Python 3.12.11
- mssql-python 1.10.0 (bundled
libmsodbcsql.18.dylib,ddbc_bindings.cp312-universal2.so) - SQLAlchemy 2.1.0b3,
mssql+mssqlpythondialect - Connection:
Encrypt=yes,TrustServerCertificate=yes, built-in connection pooling on, transaction isolation SNAPSHOT - Remote SQL Server, reached over a VPN
How it shows up
The workload is a dlt sql_database extract on the pyarrow backend. Eight worker threads read different tables at the same time, each running a SELECT and pulling rows with fetchmany. The crash lands during the fetch phase, early in a schema that has many tables loading concurrently. It is intermittent and happens under sustained concurrent reads, not on one specific row. A short synthetic stress script did not force it, which is in line with what others noted on #668.
Fault
EXC_BAD_ACCESS (SIGSEGV),KERN_INVALID_ADDRESS at 0x0000000000000008(a dereference through a near-null pointer).- At crash time, 6 of 29 threads were executing inside
libmsodbcsql.18.dyliband 2 were in a fetch call. That points at a race in the driver's read path under concurrency, not at bad input.
Native stack (crashing thread)
The interpreter side is a plain SQLAlchemy result iteration (_manyrow_getter, i.e. fetchmany) calling into the driver:
libmsodbcsql.18.dylib SQLFetchScroll <-- faulting frame
ddbc_bindings.cp312-universal2.so FetchBatchData(...)
ddbc_bindings.cp312-universal2.so FetchMany_wrap(...)
ddbc_bindings.cp312-universal2.so pybind11 dispatcher
libpython3.12.dylib _PyEval_EvalFrameDefault
_result_cy.cpython-312-darwin.so sqlalchemy BaseResultInternal _manyrow_getter
libpython3.12.dylib builtin_next
Full frames from the .ips crash report:
crashing thread, all frames
0 libmsodbcsql.18.dylib + 1127984
1 libmsodbcsql.18.dylib + 1171428
2 libmsodbcsql.18.dylib + 1199848
3 libmsodbcsql.18.dylib + 1140492
4 libmsodbcsql.18.dylib + 943376
5 libmsodbcsql.18.dylib + 859712
6 libmsodbcsql.18.dylib + 867548
7 libmsodbcsql.18.dylib + 905332
8 libmsodbcsql.18.dylib + 164368
9 libmsodbcsql.18.dylib + 450000
10 libmsodbcsql.18.dylib + 462896
11 libmsodbcsql.18.dylib + 463820 SQLFetchScroll
12 ddbc_bindings.cp312-universal2.so + 111852 FetchBatchData(...)
13 ddbc_bindings.cp312-universal2.so + 123228 FetchMany_wrap(...)
14 ddbc_bindings.cp312-universal2.so + 373200 pybind11 argument_loader::call
15 ddbc_bindings.cp312-universal2.so + 186332 pybind11::cpp_function::dispatcher
16 libpython3.12.dylib + 677576 _PyEval_EvalFrameDefault
17 _result_cy.cpython-312-darwin.so + 92288 sqlalchemy BaseResultInternal _manyrow_getter
18 libpython3.12.dylib + 2721008 gen_iternext
19 libpython3.12.dylib + 2918080 builtin_next
20 libpython3.12.dylib + 1906720 thread_run
21 libsystem_pthread.dylib + 27736 _pthread_start
22 libsystem_pthread.dylib + 7196 thread_start
Likely relation to #668
#668 reports concurrent threaded reads on macOS arm64 with Encrypt=yes corrupting the TDS/TLS stream: single-character substitutions in returned strings, Communication link failure, Protocol error in TDS stream, and timeouts. It reproduces with pyodbc plus msodbcsql18 too, so it lives in the ODBC/TLS layer. A commenter there suspects the read path is corrupting adjacent heap memory. A near-null dereference in SQLFetchScroll fits that reading: the same corruption, landing on a pointer rather than a data byte. Same trigger (macOS arm64, mssql-python 1.10.0, Encrypt=yes, concurrent reads), heavier outcome.
- Ngôn ngữ chính
- Python
- Star
- 478
- Fork
- 62
- Merge trung bình
- 3 ngày 1 giờ
- Pull request đã merge (30 ngày)
- 27
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của microsoft/mssql-python
-
area: bulk-copy
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
microsoft/mssql-python#843 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
macOS: encrypted connections fail after Homebrew moved the `openssl` alias to `openssl@4`Có thể đã có người làm @bewithgaurav đã nhận 14 ngày trước. Đang mởarea: packaging-platform bug triage needed
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
microsoft/mssql-python#826 · 2 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bulkcopy PyCore login is closed by SQL Server 2019 while ODBC and Go clients succeed (1.14.0)Có thể làm lại được @bewithgaurav đã nhận 34 ngày trước và không có pull request nào đang mở. Đang mởarea: bulk-copy bug triage done
microsoft/mssql-python#750 · 4 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Announcement: mssql-python is coming to Django through mssql-django 2.0Có thể làm lại được @bewithgaurav đã nhận 41 ngày trước và không có pull request nào đang mở. Đang mởannouncement
microsoft/mssql-python#748 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Connection pool can briefly exceed max_size when pooling is disabled under loadCó thể đã có người làm @bewithgaurav đã nhận 23 ngày trước. Đang mởarea: connectivity-auth bug triage done under development
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 62/100
microsoft/mssql-python#746 · 1 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của microsoft/mssql-python
Issue tương tự
-
vis.image() reports "Unsupported number of image channels: 224" for an HxWxC imageCó thể đã có người làm @piyush182004 đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
fossasia/visdom#1997 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 6 ngày
-
Byse new domainĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
Gujal00/ResolveURL#1525 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Serialisation fails with pydantic 2.14: wrap serialisers pass SerializationInfo as index_keyCó thể đã có người làm @hugohills-regnosys đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
finos/rune-python-runtime#45 ·
-
[Bug]: LangGraph Store sync put bypasses namespace validationCó thể đã có người làm @ktz03 đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
volcengine/OpenViking#6050 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
hummingbot/condor#283 ·
Maintainer thường phản hồi trong vòng 1 ngày