w3wp.exe Crash IIS 8.5 Classic ASP Pages

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.
mysql
asp-classic
iis-8.5
asked on Stack Overflow Mar 8, 2018 by user459729 • edited Mar 9, 2018 by user459729

2 Answers

0

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.

answered on Stack Overflow Mar 22, 2018 by Parvez Mulla
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.

answered on Stack Overflow Apr 13, 2018 by user459729

User contributions licensed under CC BY-SA 3.0