Bug #117106 'Test' button on connection dialog crashes
Submitted: 5 Jan 10:07 Modified: 6 Jan 11:39
Reporter: Jon Bird Email Updates:
Status: Duplicate Impact on me:
None 
Category:Connector / ODBC Severity:S3 (Non-critical)
Version:9.1 OS:Windows (x64)
Assigned to: CPU Architecture:x86

[5 Jan 10:07] Jon Bird
Description:
Pressing the 'Test' button on the connection dialog invoked via SQLDriverConnect triggers an exception which then terminates the application. From a debug session:

Exception thrown at 0x00007FFA95CEB699 in playoutdb.exe: Microsoft C++ exception: MYERROR at memory location 0x0000002176965AE0.
Exception thrown at 0x00007FFA538D0D65 (myodbc9S.dll) in playoutdb.exe: 0xC0000005: Access violation reading location 0x0000000000000094.

How to repeat:
Crash is consistent, I'm calling:

  Status = SQLDriverConnect(hdbc1, hPar,
    (SQLTCHAR*)DrvConnectStr, SQL_NTS, (SQLTCHAR*)OutBuf,
          sizeof(OutBuf)/sizeof(TCHAR), &OutBufSz, DrvPrompt ) ;

DrvConnectStr is a valid connection string (ie. currently points to a working database)
OutBuf is a 2048 character buffer, OutBufSz is set to 2048 on entry.
DrvPrompt = SQL_DRIVER_PROMPT

This has worked fine with previous versions of the connector.
[6 Jan 4:40] MySQL Verification Team
Hello Jon Bird,

Thank you for the report and feedback.
IMHO this sounds like duplicate of Bug #116995, please see Bug #116995
Because of this, we hope you add your comments to the original bug instead.

Quoting the Dev's comment for your reference:

[18 Dec 2024 11:13] Bogdan Degtyariov
Recently we became aware of the ODBC Driver 9.1 crashes caused by runtime libraries inside Visual C++ Redistributable package 2015-2022 version 14.36. Updating the VC++ package to version 14.40 or newer should resolve the problem with the crashes. Make sure that the redistributable package for x64 architecture is updated.
Please try this and let us know if it worked.

Regards,
Umesh
[6 Jan 11:39] Jon Bird
Unfortunately installing the latest (14.42) VC Runtime has not fixed the problem. Debugging the release version shows that the application is loading the correct (ie. latest) runtime DLLs:

vcruntime140.dll	vcruntime140.dll	C:\Windows\System32\vcruntime140.dll	N/A	No	Cannot find or open the PDB file.		41	14.42.34433.0	<Unknown>	00007FFACEBE0000-00007FFACEBFE000	[14860] playoutdb.exe		
vcruntime140_1.dll	vcruntime140_1.dll	C:\Windows\System32\vcruntime140_1.dll	N/A	No	Cannot find or open the PDB file.		49	14.42.34433.0	<Unknown>	00007FFADB4B0000-00007FFADB4BC000	[14860] playoutdb.exe