Bug #95498 | Access violation exception (0xC0000005) using Connector/ODBC | ||
---|---|---|---|
Submitted: | 23 May 2019 15:26 | Modified: | 15 Nov 2019 15:20 |
Reporter: | Stefano Gozzi | Email Updates: | |
Status: | Won't fix | Impact on me: | |
Category: | Connector / ODBC | Severity: | S2 (Serious) |
Version: | 8.0.16.0, 8.0.17 | OS: | Windows (Win7 & Win10) |
Assigned to: | CPU Architecture: | Any |
[23 May 2019 15:26]
Stefano Gozzi
[23 May 2019 15:48]
Stefano Gozzi
Example project to reproduce the problem
Attachment: mysql-bug-example-95498.zip (application/zip, text), 2.30 MiB.
[30 Jul 2019 11:23]
Rakesh M
I am facing similar issue, first time I connect to my local instance of MYSQL DB through my C++ code it works fine. In same flow I disconnect and then later try to reconnect using same credentials. It gives same error as above. On my windows console message is : "ORA-24550: signal received: Unhandled exception: Code=c0000005 Flags=0" I am using ODBC driver version is : MYODBC8W.DLL . MY Visual Studio Debugger throws error pop up stating "First-chance exception at 0x00007ff8882c6dc1 (myodbc8w.dll) in ****.exe: 0xC0000005: Access violation reading location 0x0000000000000190."
[19 Sep 2019 7:33]
MySQL Verification Team
Hello Stefano Gozzi, Thank you for the report and test case. Verified as described using VS 2019, Connector/ODBC 8.0.17 on Windows 10. Regards Ashwini Patil
[15 Nov 2019 15:20]
Rafal Somla
Posted by developer: This issue is most probably due to a mismatch between version of OpenSSL library that was used to build Con/ODBC and the version that was used at runtime. As such, there is little we can do about it. The only way to fix it is to use for your application exact the same version of OpenSSL that was used to build the connector. This information can be found in INFO_BIN file distributed in the binary package. For example, in case of Con/ODBC 8.0.17 it is OpenSSL 1.0.2s. The situation we have here is that user code links to OpenSSL library so that the resulting executable loads OpenSSL DLLs into its image at startup. These DLLs are provided in the project. Later, when application opens ODBC connection, the ODBC driver manager loads MySQL ODBC drvier, which also depends on ssleay32.dll and will use the version already loaded into the image. But it was most likely built with a different version of OpenSSL which can easily lead to a crash (since OpenSSL does not guarantee that their DLLs coming from different versions are all compatible with each other). In my tests I was able to reproduce the crash. If I re-built test app with the same version of OpenSSL that was used to build Con/ODBC, the crash is gone. I will close this bug because there is nothing we can do about it. Hopefully the situation will improve with OpenSSL 1.1.1 where more care is taken about ABI compatibility of different OpenSSL versions.