[ODBC-321] Driver crash in MultiByteToWideChar Created: 2021-06-08  Updated: 2021-10-18  Resolved: 2021-10-11

Status: Closed
Project: MariaDB Connector/ODBC
Component/s: General
Affects Version/s: 3.1.9
Fix Version/s: 3.1.14

Type: Bug Priority: Critical
Reporter: Zoey Huang Assignee: Lawrin Novitsky
Resolution: Fixed Votes: 0
Labels: crash
Environment:

Windows


Attachments: File DE204805.dmp    

 Description   

Here is a driver crash reporting by our customer, which eventually caused out child process crash.
Could you please help to take a look?

[0] C:\Windows\System32\ntdll.dll!RtlUTF8ToUnicodeN + 0x1e0
sp=0xda880fef50 bp=0x2881ea78cf6
[1] C:\Windows\System32\KERNELBASE.dll!MultiByteToWideChar + 0x2b5
[2] C:\Program Files\MariaDB\MariaDB ODBC Driver 64-bit\maodbc.dll + 0x14e120
[3] C:\Windows\System32\ntdll.dll!RtlpLowFragHeapAllocFromContext + 0x650
[4] 0x288468b0ff8
sp=0xda880ff0c0
[5] C:\Program Files\MariaDB\MariaDB ODBC Driver 64-bit\maodbc.dll + 0x3445c
[6] C:\Program Files\MariaDB\MariaDB ODBC Driver 64-bit\maodbc.dll + 0x2b229
[7] C:\Program Files\MariaDB\MariaDB ODBC Driver 64-bit\maodbc.dll + 0x151640
[8] C:\Program Files\MariaDB\MariaDB ODBC Driver 64-bit\maodbc.dll + 0x355c0
[9] C:\Program Files\MariaDB\MariaDB ODBC Driver 64-bit\maodbc.dll + 0x2b9fd
[10] C:\Program Files\MariaDB\MariaDB ODBC Driver 64-bit\maodbc.dll + 0x24931
[11] C:\Program Files\MariaDB\MariaDB ODBC Driver 64-bit\maodbc.dll + 0x2a107
[12] C:\Program Files\MariaDB\MariaDB ODBC Driver 64-bit\maodbc.dll + 0x10f4e
[13] C:\Windows\System32\odbc32.dll!SetStmtAttr + 0x269
[14] C:\Windows\System32\odbc32.dll!bStmtSequenceError + 0x36
[15] C:\Windows\System32\odbc32.dll!EnterStmtCS + 0x6d
[16] C:\Windows\System32\odbc32.dll!SQLFetchScroll + 0x2f7
[17] C:\Program Files (x86)\Common Files\MicroStrategy\MJDbOd35_64.dll!MDb::Odbc35::Odbc::SQLFetchScroll(MDb::Error &,MDb::DATABASE_TYPE,MDb::ODBCDriverVendor,void *,void *,void *,unsigned short,long,unsigned __int64 *,unsigned short *,unsigned short const *,unsigned short const *,unsigned short const *) [Z:\Server\Common\Database\Odbc35\PrivateSource\Odbc.cpp : 630 + 0x20]
[18] C:\Program Files (x86)\Common Files\MicroStrategy\MJDbOd35_64.dll!MDb::Odbc35::OdbcResult::FetchRowsetExtendedFetch(MDb::Rowset *) [Z:\Server\Common\Database\Odbc35\PrivateSource\OdbcResult.cpp : 1360 + 0xa0]
[19] C:\Program Files (x86)\Common Files\MicroStrategy\MJDbOd35_64.dll!MDb::Odbc35::OdbcResult::FetchRowset(MDb::TableImpl *,unsigned int) [Z:\Server\Common\Database\Odbc35\PrivateSource\OdbcResult.cpp : 1232 + 0xb]
[20] C:\Program Files (x86)\Common Files\MicroStrategy\MJDbOd35_64.dll!MDb::Odbc35::OdbcResult::InternalFetch(unsigned int) [Z:\Server\Common\Database\Odbc35\PrivateSource\OdbcResult.cpp : 841 + 0x11d]
[21] C:\Program Files (x86)\Common Files\MicroStrategy\MJDbOd35_64.dll!MDb::Odbc35::OdbcResult::Fetch(unsigned int) [Z:\Server\Common\Database\Odbc35\PrivateSource\OdbcResult.cpp : 725 + 0xa]
[22] C:\Program Files (x86)\Common Files\MicroStrategy\MJPrcCo2_64.dll!MMultiProcess::MultithreadedExecutor::Run() [Z:\Server\Common\MultiProcess\ProcessCommunicator\PrivateSource\MultithreadedExecutor.cpp : 323 + 0xd]
[23] C:\Program Files (x86)\Common Files\MicroStrategy\M8Synch4_64.dll!MSynch::ThreadImpl::ThreadFunction(void *) [Z:\Server\Common\Synch\Synch\PrivateSource\ThreadImpl.cpp : 185 + 0x9]
[24] C:\Windows\System32\kernel32.dll!BaseThreadInitThunk + 0x14
[25] C:\Windows\System32\ntdll.dll!RtlUserThreadStart + 0x21

Regards,
Zoey



 Comments   
Comment by Lawrin Novitsky [ 2021-06-08 ]

Thank you for your report. Did that happened with latest 3.1.13 release? And if yes, then I assume it's started with it, and before everything was ok for your application with our driver

Comment by Zoey Huang [ 2021-07-12 ]

Hi @lawrin

I will check with customer about the driver version and get back to you.

Comment by Zoey Huang [ 2021-07-12 ]

HI @lawrin

The driver version shall be 3.1.9.0..

Regards,

Comment by Lawrin Novitsky [ 2021-08-02 ]

Is it possible to try with latest release?
Also, the ODBC trace for the crash? That could be quite useful to recreate the issue. Thanks.

Comment by Lawrin Novitsky [ 2021-08-02 ]

I cannot get enough info from your dump file to proceed. I apparently need something more.

Comment by Lawrin Novitsky [ 2021-08-02 ]

What charsets are involved? Is charset set in DSN or connection string options? Or does application use ansi or Unicode API? If ansi - what is system ansi charset?
Is it known what field and what data causes the problem? Or if field is unknown - what table and its structure?

Comment by Lawrin Novitsky [ 2021-08-09 ]

Zoey I have just pushed the fix, which I think can be for your problem. At least it was inspired by one of your dumps. However, I've also just realized, that I could have mixed the issues up, and it's more for ODBC-327, while I put ODBC-321 in the commit message. This has been caused by the fact, that the backtrace I get from the dump attached to this issue is similar to the one you posted in ODBC-327, and has nothing valuable at all. While dump from ODBC-327 has some information and meaningful stacktrace, that gave me some hints that allowed to find one serious issue. Thus, the fix is maybe more for ODBC-327. But I have some reasons to think, that it can actually nail both issues.
Since I have no means to verify, if your actual problem is fixed, I am asking you to test that. You can take latest commit from the repository and build connector library containing the fix, and use it for your testing. If you have problems building the connector from the source, tell me, and I'll attach the binaries at this page.
Thank you in advance!

Comment by Lawrin Novitsky [ 2021-10-11 ]

Based my best judgement, I think this has been fixed. But since the reporter never came back to confirm that, that cannot be guaranteed.

Generated at Thu Feb 08 03:27:51 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.