Skip to content

pyodbc 5.0.0 core dump on connecting with token to mssql #1289

@karoldob

Description

@karoldob

Environment

  • Python: 3.10.12
  • pyodbc: 5.0.0
  • sqlalchemy: 2.0.21
  • OS: Ubuntu 22.04 64bit
  • DB: MSSQL (AzureSQL)
  • driver: Microsoft ODBC Driver 18 for SQL Server (/opt/microsoft/msodbcsql18/lib64/libmsodbcsql-18.3.so.2.1)
  • login method: token

Issue

Trying to connect with token as described in:
https://docs.sqlalchemy.org/en/20/dialects/mssql.html#connecting-to-databases-with-access-tokens

How to reproduce:

  • login with az login on your machine (in MS way)
  • copy-paste sample code from the link and fill server/database
  • add engine.connect() at the end
  • observe segmentation fault (core dumped)

Observations:
pyodbc 4.0.38 is not affected - above samples works well
Just pip install --upgrade pyodbc==4.0.38 solves the issue, in the same environment
Login with user-password works well

Trace in attachment
odbctrace.log

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions