0

I am struggling with the following for some time now and have tried many suggestions from various google searches.

We have one Website running in Classic ASP on a windows server 2012 R2 using IIS 8.5

We use the website with MySQL

We get this happening during the day but at different times and I suspect this to be when the site gets busy or many queries. ( Not sure )

In The Event Viewer ( Applications ) we get Active Server Pages Errors.

When this happen the pages that tries to make queries to MySQL will just respond with Error 500 ( Internal Error ).

There are a few types of the errors and below are some:

The below error can happen for many different pages and this is just example of the last one.

Error: File /update-project.asp  CreateObject Exception. The CreateObject of '(null)' caused exception C0000005..

The there are also this type of Application errors. This is a example of the last one:

Faulting application name: w3wp.exe, version: 8.5.9600.16384, time stamp: 0x52157ba0

Faulting module name: ntdll.dll, version: 6.3.9600.18895, time stamp: 0x5a4b127e

Exception code: 0xc0000374

Fault offset: 0x000e6214

Faulting process id: 0x2cd0

Faulting application start time: 0x01d3b5ffb8b88f62

Faulting application path: C:\Windows\SysWOW64\inetsrv\w3wp.exe

Faulting module path: C:\Windows\SYSTEM32\ntdll.dll

Report Id: c17383f3-21f4-11e8-80f1-0cc47adae555

Faulting package full name:

Faulting package-relative application ID:

I have tried changing quite a few things as suggested by other posts from the applicationpool settings, increasing the MySQL buffer size, and more.

As soon as this happens, I do a ApplicationPool Recycle and the problem goes away.

I have download DebugDiag 2 and created a rule for the w3wp.exe process and when this happens recorded a few dump files.

I then open the analyzer and analyze them but I do not seem to see how figure out how to read or interpret them to what could be the problem.

Is there a way I can post or provide these dump files for someone to try and help me because I am at the point pulling my hair out.

I look forward to any response from anyone that can help me or guide me in the right direction or even point me to try other things.

Thanks in advance

Below are 3 examples of connecting to MySQL and using the FileSystemObject as well as getting data from external API. Does anything from these eamples look incorrect that could cause this because it does not happen all the time, is random and can be on any of my pages and not always the same one.

sConnection = "DRIVER={MySQL ODBC 5.3 ANSI Driver}; SERVER=localhost; PORT=3306;" &_
"DATABASE=accufilemain; USER=myuser; PASSWORD=mypassword; OPTION=3;"
Set con = Server.CreateObject("ADODB.Connection")
con.Open(sConnection)

sql_check = "Select * From clients Where id = " & ClientID
Set RS = con.Execute(sql_check)
If Not RS.EOF Then

'''Get my field values
   ValABC = RS("CustomerID")

End If
State = RS.State
If State <> 0 Then
    RS.Close
    Set RS = Nothing
End If

con.Close
Set con = Nothing

sFolder1 = "C:\inetpub\wwwroot\mywebsite\files\" & ClientID

Set fs=CreateObject("Scripting.FileSystemObject") 
If Not fs.FolderExists(sFolder1) Then 
fs.CreateFolder(sFolder1) 
End If

Set fs = nothing



GetURL = ""
set objHttp = Server.CreateObject("Msxml2.ServerXMLHTTP") 
objHttp.open "GET", "otherwebsite/api/1.1.2/Customer/Get?$skip=" & MyVAL4 & "&$top=100&apikey=" & Myapikey & "&CompanyId=" & MyCompanyId, false
objHttp.setRequestHeader "Authorization", "Basic " & MyBase64AuthDetails 
objHttp.setRequestHeader "Content-Type", "application/json" 
objHttp.Send
GetURL = objHttp.ResponseText

Set objHttp = Nothing

'''' Then I can search GetURL for what I need as a string.
  • We need to see some code - specifically where you're calling `CreateObject`. – Dai Mar 08 '18 at 20:26
  • Possible duplicate of [Classic ASP : C0000005 Error on execution](https://stackoverflow.com/questions/4649487/classic-asp-c0000005-error-on-execution) – Dai Mar 08 '18 at 20:26
  • I have edited my post and included 3 code samples that I use to connect to MYSQL and FileSystemObject and XMLRequest from externat API – user459729 Mar 09 '18 at 10:10
  • Is there no code required to CLOSE the connection when done to release resources on MySQL? – Wilson Hauck Mar 09 '18 at 13:23
  • In the example above I close the Recordset as well as the connection State = RS.State If State <> 0 Then RS.Close Set RS = Nothing End If con.Close Set con = Nothing – user459729 Mar 12 '18 at 05:55
  • The error code looks like a heap corruption issue. I would love to help you in analyzing the dump that you have captured. Before we get started, could you please share the steps you took to capture this dump. I just want to ensure that you have captured the correct data here. – Parvez Mulla Mar 13 '18 at 02:57
  • Thanks Parvez. This is so much appreciated. I have the tried it 2 different ways. I have set up a rule in the DebugDiag 2 to create the dump files and as soon as the errors started to happen in the event viewer I reactivated it so that it captures 10 files. Then I went to the IIS Worker Process 32 bit in the Task Manager and as soon as the errors started to happen I then right clicked on it and selected create dump file. I am not sure if this is the correct way or not but I then loaded the dump files in the debugdiag 2 analyzer, selected all the tick boxes and analyzed it. – user459729 Mar 13 '18 at 05:39
  • Wilson Hauck, You asked if there is no code to CLOSE the connection in my code samples above. They are there with con.Close Set con = Nothing Can you point out to me what else should be there that I am doing wrong or not including ? Thanks – user459729 Mar 14 '18 at 05:21
  • Parvez, not heard back from you. Did you manage to look at my dump results ? Do you want me to send you the dump files ? – user459729 Mar 15 '18 at 05:31
  • @user459729 Hey ! I am sorry I did not receive any notification about this thread. Ran across it just now. Regarding your rule, a manual hang dump will not help in analyzing an application crash. Please use the following to set up the rule - https://blogs.msdn.microsoft.com/parvez/2016/08/06/iis-application-pool-crash-and-debug-diag/ Its a one time rule. Share this dump file when the issue occurs again. Meanwhile, I will go through your current dumps and see if i can find anything for you – Parvez Mulla Mar 20 '18 at 15:13
  • Thanks Parvez. I have followed the instructions and created the rule and it is now active. Once issue occurs, I will upload to my server and provide url here again. I am not sure, should I just comment here or is there another way on how I should comment here or reach you ? Or should I edit the post above instead of comments ? Not sure. – user459729 Mar 22 '18 at 06:47
  • OK great ! Looking into it. – Parvez Mulla Mar 22 '18 at 16:02

2 Answers2

1

I had a chance to analyze the dumps and this is what i found.

The callstack of the crashing thread 31 is as follows.

0:031> kL
# ChildEBP RetAddr  
00 026ce798 778c8d78 ntdll!RtlReportCriticalFailure+0x83
01 026ce7a8 778c9629 ntdll!RtlpHeapHandleError+0x1c
02 026ce7d8 77866035 ntdll!RtlpLogHeapFailure+0xa1
03 026ce830 7174ecfa ntdll!RtlFreeHeap+0x44485
04 026ce844 717a0100 msvcr120!free+0x1a
05 026ce890 7184bab0 msvcr120!setlocale+0x186
06 026ce8bc 7184a8c3 myodbc5a!SQLFreeHandle+0x1a362
07 026ce8dc 71df704a myodbc5a!SQLFreeHandle+0x19175
.
.
.

As suspected earlier, this is a clear case of Heap Corruption issue. More specifically, it occurred by calling "double free" operation in which you are trying to free a memory block that is already free.

Looking closely at the call stack I can see that this was caused by the "myodbc5a" module. This is an Oracle module.

0:031> lmvm myodbc5a
Browse full module list
start    end        module name
71830000 71d6b000   myodbc5a C (export symbols)       myodbc5a.dll
Loaded symbol image file: myodbc5a.dll
Image path: C:\Program Files (x86)\MySQL\Connector.ODBC 5.3\myodbc5a.dll
Image name: myodbc5a.dll
Browse all global symbols  functions  data
Timestamp:        Mon Jul 17 23:53:56 2017 (596D9464)
CheckSum:         00000000
ImageSize:        0053B000
File version:     5.3.9.0
Product version:  5.3.9.0
File flags:       0 (Mask 3)
File OS:          40004 NT Win32
File type:        2.0 Dll
File date:        00000000.00000000
Translations:     0409.04e4
CompanyName:      Oracle Corporation
ProductName:      Connector/ODBC 5.3
InternalName:     myodbc5a
OriginalFilename: myodbc5a.dll
ProductVersion:   5, 3, 9, 0
FileVersion:      5, 3, 9, 0
PrivateBuild:     Production
SpecialBuild:     GA release
FileDescription:  MySQL ODBC 5.3 ANSI Driver
LegalCopyright:   Copyright (c) 1995, 2013, Oracle and/or its affiliates.
LegalTrademarks:  MySQL, MyODBC, Connector/ODBC are trademarks of Oracle Corporation
Comments:         provides core driver functionality

You have 2 options to resolve the issue now.

  1. Reach out to Oracle support and state the issue that you are running into with respect to "myodbc5a" dll and check if they have this issue resolved in the latest version

  2. Downgrade the connector "myodbc5a" to 5.3.4 as per - https://forums.mysql.com/read.php?37,661803,661993#msg-661993

Let me know if you have any further questions.

Parvez Mulla
  • 526
  • 4
  • 7
  • Parvez, I have upgraded to the latest of all the relevant MySQL updates. Then I degraded the connector to the one 5.3.4 and left it for a few weeks to see and the problem has gone away. I have not had one problem since. Thank you so much for the time helping me out. I will keep an eye on it and if needed, I will report back. Thanks again ! – user459729 Apr 09 '18 at 11:30
  • That's awesome ! Glad it helped :) Could you please mark it down as the answer – Parvez Mulla Apr 10 '18 at 00:57
0

I have upgraded to the latest of all the relevant MySQL updates. Then I degraded the connector to the one 5.3.4 and left it for a few weeks to see and the problem has gone away. I have not had one problem since.

  • I tried 5.3.4 but I am getting lots of "_The CreateObject of '(null)' caused exception C0000005_" errors. I alsot tried 8.00.27 and got same errors. I changed connections from `Server.CreateObject` to `CreateObject` and now I am getting more useful errors but application pool is still crashing. – MeSo2 Dec 29 '21 at 16:14