Bug #104185 MySQL ODBC 8.0 Unicode Driver seg fault with pyarrow
Submitted: 1 Jul 2021 14:44 Modified: 4 Feb 2022 7:33
Reporter: Michael Chan Email Updates:
Status: Can't repeat Impact on me:
None 
Category:Connector / ODBC Severity:S3 (Non-critical)
Version:8.0.25-1.el7 OS:CentOS (3.10.0-1160.21.1.el7.x86_64 #1 SMP Mon Feb 22 18:03:13 EST 2021 x86_64 x86_64 x86_64 GNU/Linu)
Assigned to: CPU Architecture:x86

[1 Jul 2021 14:44] Michael Chan
Description:
In python, when using pyodbc with MySQL ODBC 8.0 Unicode Driver, it crashes with seg fault when the pyarrow module has been imported in the python program

Remarks: 

MySQL ODBC 5.3 Unicode Driver does not have the problem.  This problem only occurs in MySQL ODBC 8.0 Unicode Driver

Python package versions:
pyarrow                   4.0.1                    pypi_0    pypi
pyodbc                    4.0.27           py36he6710b0_0    defaults
python                    3.6.12               hcff3b4d_2    defaults

MYSQL versions:
mysql-connector-odbc.x86_64         8.0.25-1.el7               @mysql-connectors-community

Crash Stack Trace:
(gdb) where
#0  0x000000000006b946 in ?? ()
#1  0x00007f0eff8ec638 in ?? ()
#2  0x000055cb06dc9700 in ?? ()
#3  0x00007f0f0b6948df in __connect_part_one () from /lib64/libodbc.so.2
#4  0x00007f0f0b69a126 in SQLDriverConnect () from /lib64/libodbc.so.2
#5  0x00007f0f0b90d681 in Connection_New(_object*, bool, bool, long, bool, _object*, Object&) ()
   from /home/python3.6/site-packages/pyodbc.cpython-36m-x86_64-linux-gnu.so
#6  0x00007f0f0b916fa5 in mod_connect(_object*, _object*, _object*) () from /home/python3.6/site-packages/pyodbc.cpython-36m-x86_64-linux-gnu.so
#7  0x000055cb04fc6ca4 in _PyCFunction_FastCallDict (func_obj=<built-in method connect of module object at remote 0x7f0f0b93ff48>, args=<optimized out>, nargs=1, kwargs=0x0)

How to repeat:
Run the following python code to reproduce:

############################
import pyodbc

import pyarrow

conn_str = 'driver=MySQL ODBC 8.0 Unicode Driver;server=someserver'

with pyodbc.connect(conn_str) as conn:
    pass
#############################
[1 Jul 2021 14:45] Michael Chan
The python code will return:

Process finished with exit code 139 (interrupted by signal 11: SIGSEGV)
[4 Feb 2022 7:33] MySQL Verification Team
Hello Michael Chan,

Thank you for the bug report.
I tried to reproduce your issue using MySQL ODBC 8.0 Unicode Driver with Python 3.9, pyodbc 4.0.32 and pyarrow 6.0.1 but I am not seeing any issues at my end.

Regards,
Ashwini Patil