[PATCH] odbc32: Hide SQL functions to avoid conflicts with certain drivers.

Daniel Lehman dlehman at esri.com
Fri Jul 20 09:07:08 CDT 2018


> All the functions that you hiding should be exported for linking.

it linked and ran for me with a simple winelib app.  the windows-facing functions are still exported - the intent was to hide at the linux-facing level (visibility("hidden")) 

I can send a version where wine's functions are prefixed with ODBC32_ or something, instead.  that also works for me

> Can you please explain what drivers are causing the issue?

https://urldefense.proofpoint.com/v2/url?u=https-3A__docs.microsoft.com_en-2Dus_sql_connect_odbc_linux-2Dmac_installing-2Dthe-2Dmicrosoft-2Dodbc-2Ddriver-2Dfor-2Dsql-2Dserver-3Fview-3Dsql-2Dserver-2D2017&d=DwIFAw&c=n6-cguzQvX_tUIrZOS_4Og&r=EXr1bYvvdlKz3u6E79q1vXBz_p8KQv3H_C0sTaSp5H8&m=Dkm-hqi3oBYkVeQ_liLDtGEX59SNjmIOAV3SQJZG8AE&s=IqpGfSXRDWbcXCxNho-UJg_MSrlehoytTH6qZImlxK0&e=

it causes a crash:
Backtrace:
=>0 0x00007fe48afbec89 in libodbc.so.2 (+0x6c89) (0x0000000000000001)
  1 0x00007fe48b908edf SQLAllocEnv+0x6e() in odbc32 (0x0000000000000001)  <----- Wine's SQLAllocEnv
  2 0x00007fe48a85fda5 _Z12GetDMversionv+0xf4() in libmsodbcsql-17.2.so.0.1 (0x000000000023cad0)
  3 0x00007fe48a861315 _ZN9ExportImp14SQLGetDiagRecWEsPvsPwPiS1_sPs+0xa4() in libmsodbcsql-17.2.so.0.1 (0x000000000023cad0)
  4 0x00007fe48afcbfa1 SQLDriverConnect+0x1540() in libodbc.so.2 (0x0000000000000000)
  5 0x00007fe48b912c4a SQLDriverConnect+0xb9() in odbc32 (0x000000007c8fd0e0)
  6 0x0000000140001132 in sample-crash17 (+0x1131) (0x00007ffc9a54c0b0)    <----- calls SQLAllocEnv
...

In frame 6, it calls into SQLDriverConnect.  the driver calls back into Wine's version of SQLAllocEnv in frame 1, which I'm sure was not intended

seems like they dynamically load odbc functions and they pick up wine's version of SQLAllocEnv first instead of libodbc.so.2

mssql 13.1 versions works and so do other drivers for other databases we support.  it's just the 17 version that fails 
 
thanks
daniel



More information about the wine-devel mailing list