[Mono-bugs] [Bug 60550][Nor] New - System.Text.RegularExpressions triggers stack overflow

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Tue, 22 Jun 2004 09:20:25 -0400 (EDT)


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by alp@atoker.com.

http://bugzilla.ximian.com/show_bug.cgi?id=60550

--- shadow/60550	2004-06-22 09:20:25.000000000 -0400
+++ shadow/60550.tmp.20446	2004-06-22 09:20:25.000000000 -0400
@@ -0,0 +1,43 @@
+Bug#: 60550
+Product: Mono: Class Libraries
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: System
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: alp@atoker.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: System.Text.RegularExpressions triggers stack overflow
+
+This runs fine on the MS runtime but causes the Mono runtime (seen with
+0.95 and earlier) to segfault due to a stack overflow (Bug triggered by the
+regex string provided in the attached string.txt file):
+
+using System;
+using System.IO;
+using System.Text.RegularExpressions;
+                                                                          
+     
+public class test
+{
+  public static void Main ()
+  {
+    StreamReader sr = new StreamReader ("string.txt");
+    string re_string = sr.ReadToEnd ();
+                                                                          
+     
+    string re_comment = @"/\*(.|\s)*?\*/";
+                                                                          
+     
+    foreach (Match m in Regex.Matches (re_string, @"typedef
+(enum|struct)\{(" + re_comment + @")?(({[^}]+}|[^}])+)\}(DFB\w+);"))
+      Console.WriteLine ("foo");
+  }
+}