I have been experiencing an issue with my DNN site where the IIS worker process would peg out the CPU and get stuck there, causing the site to stop responding until I did an IISReset. I absolutely could not figure out what was going on so I had to use a support instance with Microsoft for them to analysis the File Dumps I was taking on the worker process while it was failing. This is what they found.
Here are the exact call stacks from each dump…
0:020> !clrstack
OS Thread Id: 0xc1c (20)
Child-SP RetAddr Call Site
00000000227ddaf0 000007fef4d8e3e4 DynamicClass.Go7(System.Text.RegularExpressions.RegexRunner)
00000000227ddb90 000007fef4d8e112 System.Text.RegularExpressions.RegexRunner.Scan(System.Text.RegularExpressions.Regex, System.String, Int32, Int32, Int32, Int32, Boolean)
00000000227ddbe0 000007fef4d5b174 System.Text.RegularExpressions.Regex.Run(Boolean, Int32, System.String, Int32, Int32, Int32)
00000000227ddc80 000007ff0130c495 System.Text.RegularExpressions.Regex.IsMatch(System.String)
00000000227ddce0 000007ff0130c0d9 DotNetNuke.Common.Utilities.HtmlUtils.IsHtml(System.String)
00000000227ddd10 000007ff0130bc6f DotNetNuke.Services.Mail.Mail.SendEmail(System.String, System.String, System.String, System.String, System.String)
00000000227dddc0 000007ff0130a9d7 DotNetNuke.Services.Mail.SendTokenizedBulkEmail.SendConfirmationMail(Int32, Int32, Int32, System.String, System.String, System.String, System.String)
00000000227dde60 000007ff01309fbc DotNetNuke.Services.Mail.SendTokenizedBulkEmail.SendMails()
00000000227de040 000007fef625c978 DotNetNuke.Services.Mail.SendTokenizedBulkEmail.Send()
00000000227de070 000007fef7fe1552 System.Threading.ExecutionContext.runTryCode(System.Object)
00000000227de920 000007fef62d95fd System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
00000000227de970 000007fef7fe1552 System.Threading.ThreadHelper.ThreadStart()
0:020> !clrstack
OS Thread Id: 0xcf0 (20)
Child-SP RetAddr Call Site
00000000224ddb30 000007fef4d8e85b System.Text.RegularExpressions.RegexCharClass.CharInClassInternal(Char, System.String, Int32, Int32, Int32)
00000000224ddb80 000007ff009a6894 System.Text.RegularExpressions.RegexCharClass.CharInClassRecursive(Char, System.String, Int32)
00000000224ddbf0 000007fef4d8e3e4 DynamicClass.Go20(System.Text.RegularExpressions.RegexRunner)
00000000224ddc90 000007fef4d8e112 System.Text.RegularExpressions.RegexRunner.Scan(System.Text.RegularExpressions.Regex, System.String, Int32, Int32, Int32, Int32, Boolean)
00000000224ddce0 000007fef4d5b174 System.Text.RegularExpressions.Regex.Run(Boolean, Int32, System.String, Int32, Int32, Int32)
00000000224ddd80 000007ff00f855a5 System.Text.RegularExpressions.Regex.IsMatch(System.String)
00000000224ddde0 000007ff00f851e9 DotNetNuke.Common.Utilities.HtmlUtils.IsHtml(System.String)
00000000224dde10 000007ff013a5aaf DotNetNuke.Services.Mail.Mail.SendEmail(System.String, System.String, System.String, System.String, System.String)
00000000224ddec0 000007ff013a4897 DotNetNuke.Services.Mail.SendTokenizedBulkEmail.SendConfirmationMail(Int32, Int32, Int32, System.String, System.String, System.String, System.String)
00000000224ddf60 000007ff013a3e7c DotNetNuke.Services.Mail.SendTokenizedBulkEmail.SendMails()
00000000224de140 000007fef625c978 DotNetNuke.Services.Mail.SendTokenizedBulkEmail.Send()
00000000224de170 000007fef7fe1552 System.Threading.ExecutionContext.runTryCode(System.Object)
00000000224dea20 000007fef62d95fd System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
00000000224dea70 000007fef7fe1552 System.Threading.ThreadHelper.ThreadStart()
0:020> !clrstack
OS Thread Id: 0x2c0 (20)
Child-SP RetAddr Call Site
000000002224d9a0 000007fef4d8e3e4 DynamicClass.Go20(System.Text.RegularExpressions.RegexRunner)
000000002224da40 000007fef4d8e112 System.Text.RegularExpressions.RegexRunner.Scan(System.Text.RegularExpressions.Regex, System.String, Int32, Int32, Int32, Int32, Boolean)
000000002224da90 000007fef4d5b174 System.Text.RegularExpressions.Regex.Run(Boolean, Int32, System.String, Int32, Int32, Int32)
000000002224db30 000007ff010a98f5 System.Text.RegularExpressions.Regex.IsMatch(System.String)
000000002224db90 000007ff010a9539 DotNetNuke.Common.Utilities.HtmlUtils.IsHtml(System.String)
000000002224dbc0 000007ff010a90cf DotNetNuke.Services.Mail.Mail.SendEmail(System.String, System.String, System.String, System.String, System.String)
000000002224dc70 000007ff010a7c77 DotNetNuke.Services.Mail.SendTokenizedBulkEmail.SendConfirmationMail(Int32, Int32, Int32, System.String, System.String, System.String, System.String)
000000002224dd10 000007ff010a725c DotNetNuke.Services.Mail.SendTokenizedBulkEmail.SendMails()
000000002224def0 000007fef625c978 DotNetNuke.Services.Mail.SendTokenizedBulkEmail.Send()
000000002224df20 000007fef7fe1552 System.Threading.ExecutionContext.runTryCode(System.Object)
000000002224e7d0 000007fef62d95fd System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
000000002224e820 000007fef7fe1552 System.Threading.ThreadHelper.ThreadStart()
0:020> !clrstack
OS Thread Id: 0x2c0 (20)
Child-SP RetAddr Call Site
000000002224d958 000007fef6262afe System.Globalization.CultureInfo.get_TextInfo()
000000002224d960 000007ff00a00be3 System.Char.ToLower(Char, System.Globalization.CultureInfo)
000000002224d9a0 000007fef4d8e3e4 DynamicClass.Go20(System.Text.RegularExpressions.RegexRunner)
000000002224da40 000007fef4d8e112 System.Text.RegularExpressions.RegexRunner.Scan(System.Text.RegularExpressions.Regex, System.String, Int32, Int32, Int32, Int32, Boolean)
000000002224da90 000007fef4d5b174 System.Text.RegularExpressions.Regex.Run(Boolean, Int32, System.String, Int32, Int32, Int32)
000000002224db30 000007ff010a98f5 System.Text.RegularExpressions.Regex.IsMatch(System.String)
000000002224db90 000007ff010a9539 DotNetNuke.Common.Utilities.HtmlUtils.IsHtml(System.String)
000000002224dbc0 000007ff010a90cf DotNetNuke.Services.Mail.Mail.SendEmail(System.String, System.String, System.String, System.String, System.String)
000000002224dc70 000007ff010a7c77 DotNetNuke.Services.Mail.SendTokenizedBulkEmail.SendConfirmationMail(Int32, Int32, Int32, System.String, System.String, System.String, System.String)
000000002224dd10 000007ff010a725c DotNetNuke.Services.Mail.SendTokenizedBulkEmail.SendMails()
000000002224def0 000007fef625c978 DotNetNuke.Services.Mail.SendTokenizedBulkEmail.Send()
000000002224df20 000007fef7fe1552 System.Threading.ExecutionContext.runTryCode(System.Object)
000000002224e7d0 000007fef62d95fd System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
000000002224e820 000007fef7fe1552 System.Threading.ThreadHelper.ThreadStart()
0:019> !clrstack
OS Thread Id: 0x2c0 (19)
Child-SP RetAddr Call Site
000000002224d880 000007fef4d8e9b9 System.Char.GetUnicodeCategory(Char)
000000002224d8c0 000007fef4d8e85b System.Text.RegularExpressions.RegexCharClass.CharInCategory(Char, System.String, Int32, Int32, Int32)
000000002224d930 000007ff00a00a94 System.Text.RegularExpressions.RegexCharClass.CharInClassRecursive(Char, System.String, Int32)
000000002224d9a0 000007fef4d8e3e4 DynamicClass.Go20(System.Text.RegularExpressions.RegexRunner)
000000002224da40 000007fef4d8e112 System.Text.RegularExpressions.RegexRunner.Scan(System.Text.RegularExpressions.Regex, System.String, Int32, Int32, Int32, Int32, Boolean)
000000002224da90 000007fef4d5b174 System.Text.RegularExpressions.Regex.Run(Boolean, Int32, System.String, Int32, Int32, Int32)
000000002224db30 000007ff010a98f5 System.Text.RegularExpressions.Regex.IsMatch(System.String)
000000002224db90 000007ff010a9539 DotNetNuke.Common.Utilities.HtmlUtils.IsHtml(System.String)
000000002224dbc0 000007ff010a90cf DotNetNuke.Services.Mail.Mail.SendEmail(System.String, System.String, System.String, System.String, System.String)
000000002224dc70 000007ff010a7c77 DotNetNuke.Services.Mail.SendTokenizedBulkEmail.SendConfirmationMail(Int32, Int32, Int32, System.String, System.String, System.String, System.String)
000000002224dd10 000007ff010a725c DotNetNuke.Services.Mail.SendTokenizedBulkEmail.SendMails()
000000002224def0 000007fef625c978 DotNetNuke.Services.Mail.SendTokenizedBulkEmail.Send()
000000002224df20 000007fef7fe1552 System.Threading.ExecutionContext.runTryCode(System.Object)
000000002224e7d0 000007fef62d95fd System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
000000002224e820 000007fef7fe1552 System.Threading.ThreadHelper.ThreadStart()
Here’s the string from the confirmation e-mail that caused the issue this time…
<h1>Bulkmail Report</h1>
Operation started at: 6/15/2010 9:44:10 AM<br>
EmailRecipients: 2<br>
EmailMessages: 2<br>
Operation completed: 6/15/2010 9:44:10 AM<br>
<br>
Status Report: <br>
<pre>No errors occured during sending.</pre>
<hr><b>Recipients:</B><br>Kristin.e.taylor@gmail.com<br />caleb@falkon.net<br />
Passing the above string to the function below is all it takes to reproduce the issue.
private static Regex HtmlDetectionRegex = new Regex(@"<([A-Z][A-Z0-9]*)(.*\s*)*</([A-Z][A-Z0-9]*)", RegexOptions.Compiled | RegexOptions.IgnoreCase);
public static bool IsHtml(string text)
{
if (string.IsNullOrEmpty(text))
{
return false;
}
return HtmlDetectionRegex.IsMatch(text);
}
I will no longer be using the newsletter module but I thought that this would be good information for you.