Bug #5477 Microsoft thinks there is a bug i ODBC driver.
Submitted: 8 Sep 2004 15:56 Modified: 31 May 2013 7:40
Reporter: Jonas Eriksson Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / ODBC Severity:S2 (Serious)
Version:3.51 OS:Windows (Windows 2003 web ed)
Assigned to: CPU Architecture:Any

[8 Sep 2004 15:56] Jonas Eriksson
Description:
Hi

I have some problems that crashes my Windows 2003 server.
I have talked to Microsoft and they have analyzed dump files from my server.

They think thar Mysql driver is causing HEAP corruption, Please see below
And get back to me that you think.

How to repeat:
Well It happes on almost daly matter. THe only thing to fix it is to reboot the server.

 have downloaded and analyzed the first chance access violations dump files from your site.

Typically when troubleshooting heap corruptions, the first chance AV indicates that a component misbehaved and that it is likely the one responsible for heap corruption.

In both dump file I have had a look at it appears that the component failing is C:\WINDOWS\system32\myodbc3.dll.

 

Details of the failing module:

 

0d590000 0d5f2000   myodbc3    (export symbols)       myodbc3.dll

    Loaded symbol image file: myodbc3.dll

    Image path: C:\WINDOWS\system32\myodbc3.dll

    Image name: myodbc3.dll

    Timestamp:        Tue Mar 04 09:22:30 2003 (3E646246)

    CheckSum:         0005B932

    ImageSize:        00062000

    File version:     3.51.6.0

    Product version:  3.51.0.0

    File flags:       0 (Mask 3)

    File OS:          40004 NT Win32

    File type:        2.0 Dll

    File date:        00000000.00000000

    Translations:     0409.04e4

    CompanyName:      MySQL AB

    ProductName:      Connector/ODBC 3.51

    InternalName:     myodbc3

    OriginalFilename: myodbc3.dll

    ProductVersion:   3.51

    FileVersion:      3.51.06 (stable)

    PrivateBuild:     Stable

    SpecialBuild:     Stable Public release  (Share version)

    FileDescription:  MySQL ODBC 3.51 Driver

    LegalCopyright:   Copyright © MySQL AB 1995-2003

    LegalTrademarks:  MySQL, MyODBC, Connector/ODBC are trademarks of MySQL AB

    Comments:         ODBC driver to access MySQL

 

1st_Chance_AV--5740_w3wp_DefaultAppPool_2004-06-14_15-44-43-656_166C.dmp

0:034> kv

ChildEBP RetAddr  Args to Child              

WARNING: Stack unwind information not available. Following frames may be wrong.

0cd34fe8 67656174 c0c07465 c0c0c0c0 c0c0c0c0 myodbc3!SQLTransact+0x2fcd

72617473 00000000 00000000 00000000 00000000 0x67656174

 

1st_Chance_AV--5752_w3wp_AppPool_7_2004-06-14_15-45-26-750_1678.dmp

0:024> kv

ChildEBP RetAddr  Args to Child              

WARNING: Stack unwind information not available. Following frames may be wrong.

0d256ff0 c0c06c65 c0c0c0c0 c0c0c0c0 00000000 myodbc3!SQLTransact+0x2fcd

736a656d 00000000 00000000 00000000 00000000 0xc0c06c65

 

Moreover in both cases the process entry block is missing which is then going to lead unpredictable results.

I have checked the latest version of this module on the third party provider web site mysql.com and it appears that you are running the latest production release.

As I cannot be sure that this component is really our culprit here but just suspect it would be nice if you could open a support request to them pointing uot these dump files, or asking them if they are aware of such problems when running on IIS 6.0.

 

On the other hand I think it would make sense to try the latest action plan I gave you which was:

 

Activate GFLAGS:

 

gflags -p /enable w3wp.exe /decommit /dlls "DIWhoIs.dll SMTPSVG.DLL race.dll ActiveFileFilter.dll dbodbc8.dll perl58.dll PerlSE.dll myodbc3.dll"

 

And then again you have to restart IIS and use this command line to attach the debugger:

 

iisdump.exe -d dbgcrash_FullOnFirst.def -i -n w3wp.exe    

 

 If this still eat too much memory and processor time turn off GFLAGS using:

 

            gflags -p /disable w3wp.exe

 

And restart IIS.

Waiting for your feedback,

Regards,
Yann-Loïc Orgeval | support engineer | emea gtsc developer  support - internet team | +33 1 69 86 47 23 | yanno@microsoft.com | Microsoft
[10 Sep 2004 0:27] MySQL Verification Team
Could you please provide for us a repeatable test case
e.g: tables schema, application, etc.

I will appreciate your help.

Thanks in advance
[10 Sep 2004 8:17] Jonas Eriksson
Well i don't  know what is cousing this error. Its about 300 web sites
on this server and many is using asp, .NET to access databases.
[14 Feb 2005 22:54] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[25 May 2006 18:24] Oleg Mills
myodbc3.dll ver. 3.51.12.0
MySQL server ver. 5.0.16-nt is running on a separate machine
All tables use InnoDB. All tables involved have 3-6 columns and not more that 100 records each.

Same problem... occurs almost every day on our Windows 2003 Server.

Always occurs when the following query is executed (.NET ver. 1.1):
        Dim command As New OdbcCommand
        command.Connection = connection
        command.CommandText = "SELECT m.ModalityName, m.ModalityID,c.clinicmodalityid FROM modality m " & _
            " INNER JOIN clinicmodality c ON c.ModalityID = m.ModalityID " & _
            " INNER JOIN room r ON r.clinicmodalityid = c.clinicmodalityid " & _
            " WHERE c.FacilityNumber = ? AND deleted = 0 " & _
            " GROUP BY m.modalityid "
        command.Parameters.Add("FacilityNumber", strFacilityNumber)
        Dim drReader As OdbcDataReader = command.ExecuteReader

DebugDiag created a dump of what happened (145 MB). Tell me where to send it if you need it.

Here is output of DebugDiag analyzer:
---
Analysis Summary  
  Type Description Recommendation 
  Error In w3wp__PID__4156__Date__05_25_2006__Time_01_23_27PM__124__Second_Chance_Exception_C0000005.dmp the assembly instruction at ntdll!RtlAllocateHeap+58a in C:\WINDOWS\system32\ntdll.dll from Microsoft Corporation has caused an access violation exception (0xC0000005) when trying to read from memory location 0x49205452 on thread 47

Heap corruption was detected in heap 0x04550000, however pageheap was not enabled in this dump. Please follow the instructions in the recommendation section for troubleshooting heap corruption issues.

Current NTGlobalFlags value: 0x0 An access violation exception thrown by a heap memory manager function indicates heap corruption. Please follow the steps outlined in the following Knowledge Base article:

300966 Howto debug heap corruption issues in Internet Information Services (IIS)
  Information DebugDiag determined that this dump file (w3wp__PID__4156__Date__05_25_2006__Time_01_23_27PM__124__Second_Chance_Exception_C0000005.dmp) is a crash dump and did not perform any hang analysis. If you wish to enable combined crash and hang analysis for crash dumps, edit the IISAnalysis.asp script (located in the DebugDiag\Scripts folder) and set the g_DoCombinedAnalysis constant to True.

 Analysis Details
  Table Of Contents
w3wp__PID__4156__Date__05_25_2006__Time_01_23_27PM__124__Second_Chance_Exception_C0000005.dmp

   Faulting Thread

   Faulting Module Information

Report for w3wp__PID__4156__Date__05_25_2006__Time_01_23_27PM__124__Second_Chance_Exception_C0000005.dmp
Type of Analysis Performed   Crash Analysis
Machine Name   SERVER5296
Operating System   Windows Server 2003 Service Pack 1
Number Of Processors   4
Process ID   4156
Process Image   c:\WINDOWS\system32\inetsrv\w3wp.exe
System Up-Time   33 day(s) 10:57:43
Process Up-Time   0 day(s) 04:51:11

Thread 47 - System ID 2204
Entry point   ntdll!RtlpWorkerThread
Create time   5/25/2006 13:23:27
Time spent in user mode   0 Days 0:0:0.0
Time spent in kernel mode   0 Days 0:0:0.0

Function     Arg 1     Arg 2     Arg 3   Source
ntdll!RtlAllocateHeap+58a     04550000     00000008     0000008c
myodbc3!LoadByOrdinal+1a14     00000001     0000008c     00000002
myodbc3!LoadByOrdinal+7e1     043d0000     00000002     00000000
myodbc3!LoadByOrdinal+88e     043d0000     00000002     00000000
ntdll!LdrpCallInitRoutine+14     0441de2e     043d0000     00000002
ntdll!LdrpInitializeThread+10d     06fffd28     06fffd28     00000000
ntdll!_LdrpInitialize+16f     06fffd28     7c800000     00000000
ntdll!KiUserApcDispatcher+25     00000000     00000000     00000000

NTDLL!RTLALLOCATEHEAP+58A

Detailed Info For Corrupt Heap
Heap 115 - 0x04550000
Heap Name   myodbc3!LoadByOrdinal+1179751
Heap Description   This heap is used by myodbc3
Reserved memory   3.13 MBytes
Committed memory   1.50 MBytes (48.00% of reserved)
Uncommitted memory   1.63 MBytes (52.00% of reserved)
Number of heap segments   3 segments
Number of uncommitted ranges   27 range(s)
Size of largest uncommitted range   1.51 MBytes
Calculated heap fragmentation   6.97%

Segment Information
Base Address Reserved Size Committed Size Uncommitted Size Number of uncommitted ranges Largest uncommitted block Calculated heap fragmentation
0x04550640 64.00 KBytes 64.00 KBytes 0 Bytes 0 0 Bytes 0.00%
0x045e0000 1,024.00 KBytes 1,024.00 KBytes 0 Bytes 12 240.00 KBytes 0.00%
0x08f80000 2.00 MBytes 444.00 KBytes 1.57 MBytes 15 1.51 MBytes 3.49%

Top 5 allocations by size

Allocation Size - 16384
Allocation Size - 8199
Allocation Size - 4088
Allocation Size - 8164
Allocation Size - 8192

 256.00 KBytes
136.12 KBytes
23.95 KBytes
15.95 KBytes
8.00 KBytes

Top 5 allocations by count

Allocation Size - 8199
Allocation Size - 16384
Allocation Size - 11
Allocation Size - 3
Allocation Size - 6

 17 allocation(s)
16 allocation(s)
15 allocation(s)
13 allocation(s)
9 allocation(s)

Back to Top

In w3wp__PID__4156__Date__05_25_2006__Time_01_23_27PM__124__Second_Chance_Exception_C0000005.dmp the assembly instruction at ntdll!RtlAllocateHeap+58a in C:\WINDOWS\system32\ntdll.dll from Microsoft Corporation has caused an access violation exception (0xC0000005) when trying to read from memory location 0x49205452 on thread 47

Heap corruption was detected in heap 0x04550000, however pageheap was not enabled in this dump. Please follow the instructions in the recommendation section for troubleshooting heap corruption issues.

Current NTGlobalFlags value: 0x0 Module Information
Image Name: C:\WINDOWS\system32\ntdll.dll   Symbol Type:  PDB
Base address: 0x7c800000   Time Stamp:  Thu Mar 24 21:30:42 2005
Checksum: 0x000c90bf   Comments:
COM DLL: False   Company Name:  Microsoft Corporation
ISAPIExtension: False   File Description:  NT Layer DLL
ISAPIFilter: False   File Version:  5.2.3790.1830 (srv03_sp1_rtm.050324-1447)
Managed DLL: False   Internal Name:  ntdll.dll
VB DLL: False   Legal Copyright:  © Microsoft Corporation. All rights reserved.
Loaded Image Name:  ntdll.dll   Legal Trademarks:
Mapped Image Name:     Original filename:  ntdll.dll
Module name:  ntdll   Private Build:
Single Threaded:  False   Product Name:  Microsoft® Windows® Operating System
Module Size:  768.00 KBytes   Product Version:  5.2.3790.1830
Symbol File Name:  c:\symcache\ntdll.pdb\DCE823FCF71A4BF5AA489994520EA18F2\ntdll.pdb   Special Build:  &

 Script Summary
  Script Name Status Error Code Error Source Error Description Source Line
IISAnalysis.asp Completed
---
[31 May 2013 7:40] Bogdan Degtyariov
Thank you for your bug report. This issue has already been fixed in the release version of that product, which you can download at

  http://www.mysql.com/downloads/connector/odbc