none
Crash in 64-bit odbc32.dll in SQLSetStmtAttr

    Question

  • Hi I was debugging an issue communicating with a custom ODBC driver using a linked server in SQL Server 2008 R2. The problem was that SQL Server was reporting a catastrophic error. When I looked into this I discovered that in the dump file it showed things dying in odbc32.dll in a SQLSetStmtAttr call. I examined the SQL.log file and found SQL Server was making a call similar too:

    SQLSetStmtAttr(hstmt, SQL_ROWSET_SIZE, 2, 0)

    when it died.

    I then looked at our custom ODBC driver to figure out what it was doing in this case and it was returning SUCCESS_WITH_INFO as it only supports a rowset size of one. I then wrote a simple application to test the SQLSetStmtAttr(hstmt, SQL_ROWSET_SIZE, 2, 0) ODBC API call against my driver and found that it again crashed in odbc32.dll. I then compiled my test app and ODBC driver as 32-bits and I did not get the crash.

    Using my test app I tried a call like

    SQLSetStmtAttr(hstmt, SQL_ATTR_ROW_ARRAY_SIZE, 2, 0)

    to see if it had the same problem but it worked fine even though it's implemented the same way in our ODBC driver. I also am pointed away from it being our ODBC driver by the crash dumps not having calls to our ODBC driver in the stack trace. It seems like it dies after the SQLSetStmtAttr call to our ODBC driver finishes but before it returns to the calling application.

    Please look into this and tell me if it is a bug in the 64-bit odbc32.dll it should be easy to reproduce by using a ODBC driver that returns SUCCESS_WITH_INFO to SQLSetStmtAttr(hstmt, SQL_ATTR_ROW_ARRAY_SIZE, 2, 0) calls.

     

    Thank you,

    Devon Austen

    Friday, November 18, 2011 8:32 PM

Answers

  • That sounds like a different issue. We solved the issue above by changing our ODBC driver not to return SUCCESS_WITH_INFO in that case which got everything working. But the problem you describe sounds different. If you have tried the latest version and still have not resolved the issue please contact PVX Plus support.

    That being said or fix was only a workaround to what appears to be a problem in the 64-bit version of odbc32.dll. Can anyone confirm this?

    Thursday, January 17, 2013 3:16 PM

All replies

  • Hello,

    Please, could you explain what you mean with "if it is a bug in the 64-bit odbc32.dll " ? odbc32.dll is a dll for 32-bits and it is not working with 64-bits applications

    http://msdn.microsoft.com/en-us/site/ms709366

    Are you working on a X86 or X64 operating system ( 32-bits or 64-bits ) ?

    Have a nice day


    Mark Post as helpful if it provides any help.Otherwise,leave it as it is.
    Friday, November 18, 2011 11:03 PM
    Moderator
  • I am using Windows 7 x64, SQL Server 2008 R2 64-bit, and am using a 64-bit ODBC driver.

    Correct me if I am wrong but I believe in Windows 7 x64 there is both a 64-bit and 32-bit odbc32.dll.

    64-bit located at C:\Windows\System32\odbc32.dll and

    32-bit located at C:\Windows\SysWOW64\odbc32.dll

    The article you linked to seems to be for Windows 2000.

    Thanks.

    Friday, November 18, 2011 11:17 PM
  • Hello,

    you are exact but the 32-bits applications are executing in a sandbox.

    I am sorry to provide you an article about Windiws 2000 , but it is the only one article about odbc32.dll i found ( for the moment )

    Please, i have a question ( because i am curious ) : why are you using "with a custom ODBC driver " ?

    You are using a linked server but between SQL Server and what ?

    Have a nice day


    Mark Post as helpful if it provides any help.Otherwise,leave it as it is.
    Saturday, November 19, 2011 12:32 AM
    Moderator
  • We have a customer trying to use our ODBC driver (PxPlus ODBC driver) we develop with SQL Server 2008 through a linked server. Our ODBC driver provides access to a proprietary data file and our customers have a requirement to access this data within SQL Server.

    Our 32-bit ODBC driver works fine but our 64-bit ODBC driver only works if I hack it a little bit to always return true to a SQLSetStmtAttr for a SQL_ROWSET_SIZE attribute instead of returning SUCCESS_WITH_INFO if an application tries to set it to something other then 1. Based on what I can find returning SUCCESS_WITH_INFO is a valid response and the fact that the 32-bit driver works makes me think the problem is with the 64-bit version of odbc32.dll.

    This should be reproducible just pick a ODBC driver which only supports a rowset size of one then write a small 64-bit application that connects to that ODBC driver and allocates a statement and then calls SQLSetStmtAttr (hsmt, SQL_ROWSET_SIZE, 2, 0).

    Monday, November 21, 2011 1:53 PM
  • I am experiencing the same problem using PxPlux 5 64Bit, I am able to run queries using OpenQuery with no problems but when I run any query within a procedure referring to the exact same OpenQuery statement I am getting a "supplied inconsistent metadata for a column" error, would you mind expanding how can you force the driver to always return the failing parameter the way you want it?. Thanks in advance
    Thursday, November 01, 2012 10:15 PM
  • That sounds like a different issue. We solved the issue above by changing our ODBC driver not to return SUCCESS_WITH_INFO in that case which got everything working. But the problem you describe sounds different. If you have tried the latest version and still have not resolved the issue please contact PVX Plus support.

    That being said or fix was only a workaround to what appears to be a problem in the 64-bit version of odbc32.dll. Can anyone confirm this?

    Thursday, January 17, 2013 3:16 PM
  • We are seeing the same problem with our custom 64-bit ODBC driver.  The 64-bit Native SQL Server ODBC driver fails in the same way.  Your work around by not returning SUCCESS_WITH_INFO seems to fix it.  Thanks for posting that tid-bit!  Would be nice if Microsoft released a fix for this issue.

    Regards,

    Peter

    Tuesday, March 05, 2013 5:29 PM
  • Thanks for the reply. It is good to know I'm not the only one. I also agree it would be nice if Microsoft released a fix or at least confirmed it is a issue.
    Wednesday, March 06, 2013 5:10 PM
  • This is still an issue with SQL Server 2012.  This basically crashes SQL..

    OLE DB provider "MSDASQL" for linked server "FC64" returned message "[PxPlus][ODBC Driver][PXPIO]Network error".
    Msg 7330, Level 16, State 2, Line 1
    Cannot fetch a row from OLE DB provider "MSDASQL" for linked server "FC64".

    Faulting application name: sqlservr.exe, version: 2011.110.3000.0, time stamp: 0x5082086a
    Faulting module name: pxpio.dll, version: 5.10.2.0, time stamp: 0x5011971b
    Exception code: 0xc0000005
    Fault offset: 0x0000000000023eef
    Faulting process id: 0xad4
    Faulting application start time: 0x01cec2c93a129fd4
    Faulting application path: C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\Binn\sqlservr.exe
    Faulting module path: C:\PVX Plus Technologies\ODBC Driver (64-bit)\pxpio.dll
    Report Id: 57283d49-2ebe-11e3-93f5-000c29aa8f51
    Faulting package full name: 
    Faulting package-relative application ID: 


    Bradley

    Sunday, October 06, 2013 7:40 PM