[Mono-bugs] [Bug 633490] New: Error while comparing string that uses the LikeString function.

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Sun Aug 22 09:59:47 EDT 2010


https://bugzilla.novell.com/show_bug.cgi?id=633490

https://bugzilla.novell.com/show_bug.cgi?id=633490#c0


           Summary: Error while comparing string that uses the LikeString
                    function.
    Classification: Mono
           Product: Mono: Class Libraries
           Version: 2.6.x
          Platform: x86
        OS/Version: Windows 7
            Status: NEW
          Severity: Major
          Priority: P5 - None
         Component: VB Runtime
        AssignedTo: rkvinge at novell.com
        ReportedBy: borgdylan at hotmail.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---


Created an attachment (id=384657)
 --> (http://bugzilla.novell.com/attachment.cgi?id=384657)
The new dylan.NET compiler (mentioned above)

User-Agent:       Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1;
Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729;
Media Center PC 6.0; .NET CLR 3.5.21022; InfoPath.2; Media Center PC 5.0;
SLCC1; .NET4.0C; .NET4.0E; OfficeLiveConnector.1.5; OfficeLivePatch.1.3; Tablet
PC 2.0; Creative AutoUpdate v1.40.01)

THe runtime is telling me that the quantifier is wrong. IN relaity I did not
check anything against the given pattern(checks for 4 numbers separated by
"."). I dod have somethin that conforms to it but the code was made not to
compare it with anything. I think this is an error with the Mono runtime.

Below please find the full content of my console displaying the error. The
source code printed out was the code I was trying to parse. If you need the
original sources of the program contact me on borgdylan at hotmail.com.

Mono version 2.6.7 Build 2
Prepending 'C:\PROGRA~1\MONO-2~1.7\bin' to PATH
C:\Windows\system32>E:

E:\>cd Code\dylannet\compiler

E:\Code\dylannet\compiler>mono dnc.exe E:\Code\dylannet\firstapp.txt
dylan.NET Compiler v. 11.1 for Microsoft (R) .NET Framework (R) v. 3.5 SP1
                           and Novell Mono v. 2.6.7
Copyright (C) Dylan Borg 2010
#refasm mscorlib.dll
#refasm System.dll
#refasm System.Core.dll
#refasm System.Data.dll
#refasm System.Data.DataSetExtensions.dll
#refasm System.Xml.dll
#refasm System.Xml.Linq.dll
#refasm Microsoft.VisualBasic.dll

import Microsoft.VisualBasic
import System
import System.Collections
import System.Collections.Generic
import System.Data
import System.Diagnostics
import System.Linq
import System.Xml
import System.Xml.Linq

assembly firstapp exe
ver 1.1.0.0

class public auto ansi Module1

method public static void main()

Console::WriteLine("Hello World")
var a as integer = 2
var b as integer = 3
var c as char = 'f'
var d as char = ' '
var e as string = "'"
var ans as integer = a + b
var anss as string = ans::ToString()
Console::WriteLine(anss)
//Console::ReadKey()

end method

end class
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

Unhandled Exception: System.ArgumentException: parsing "+^\d{1}.*.\d{1}.*$" -
Ba
d quantifier.
Parameter name: +^\d{1}.*.\d{1}.*$
  at System.Text.RegularExpressions.Syntax.Parser.ParseGroup
(System.Text.Regula
rExpressions.Syntax.Group group, RegexOptions options,
System.Text.RegularExpres
sions.Syntax.Assertion assertion) [0x00000] in <filename unknown>:0
  at System.Text.RegularExpressions.Syntax.Parser.ParseRegularExpression
(System
String pattern, RegexOptions options) [0x00000] in <filename unknown>:0
  at System.Text.RegularExpressions.Regex.CreateMachineFactory (System.String
pa
ttern, RegexOptions options) [0x00000] in <filename unknown>:0
  at System.Text.RegularExpressions.Regex.InitNewRegex () [0x00000] in
<filename
 unknown>:0
  at System.Text.RegularExpressions.Regex.Init () [0x00000] in <filename
unknown
>:0
  at System.Text.RegularExpressions.Regex..ctor (System.String pattern,
RegexOpt
ions options) [0x00000] in <filename unknown>:0
  at Microsoft.VisualBasic.CompilerServices.StringType.StrLike (System.String
So
urce, System.String Pattern, CompareMethod CompareOption) [0x00000] in
<filename
 unknown>:0
  at Microsoft.VisualBasic.CompilerServices.Operators.LikeString (System.String
Source, System.String Pattern, CompareMethod CompareOption) [0x00000] in
<filena
me unknown>:0
  at Microsoft.VisualBasic.CompilerServices.LikeOperator.LikeString
(System.Stri
ng Source, System.String Pattern, CompareMethod CompareOption) [0x00000] in
<fil
ename unknown>:0
  at dnu.ParseUtils.LikeOP (System.String str, System.String pattern) [0x00000]
in <filename unknown>:0
  at tokenizer.Parser.TokenOptimizer.Optimize (tokenizer.AST.Tokens.Token tok)
[
0x00000] in <filename unknown>:0
  at tokenizer.Parser.StmtOptimizer.Optimize (tokenizer.AST.Stmts.Stmt stm)
[0x0
0000] in <filename unknown>:0
  at tokenizer.Parser.Parser.Parse (tokenizer.AST.Stmts.StmtSet stms) [0x00000]
in <filename unknown>:0
  at dylan.NET.Compiler.Module1.main (System.String[] args) [0x00000] in
<filena
me unknown>:0

E:\Code\dylannet\compiler>


Reproducible: Always

Steps to Reproduce:
As shown in the details parsing a file with the contents:
#refasm mscorlib.dll
#refasm System.dll
#refasm System.Core.dll
#refasm System.Data.dll
#refasm System.Data.DataSetExtensions.dll
#refasm System.Xml.dll
#refasm System.Xml.Linq.dll
#refasm Microsoft.VisualBasic.dll

import Microsoft.VisualBasic
import System
import System.Collections
import System.Collections.Generic
import System.Data
import System.Diagnostics
import System.Linq
import System.Xml
import System.Xml.Linq

assembly firstapp exe
ver 1.1.0.0

class public auto ansi Module1

method public static void main()

Console::WriteLine("Hello World")
var a as integer = 2
var b as integer = 3
var c as char = 'f'
var d as char = ' '
var e as string = "'"
var ans as integer = a + b
var anss as string = ans::ToString()
Console::WriteLine(anss)
//Console::ReadKey()

end method

end class

by using the new dylan.NET compiler. Sources available from me. 
Beforehand a built version of the new dylan.NET compiler is required together
with the Mono runtime 2.6.7. On .NET 3.5 this error is not reproducible as all
works fine.
Actual Results:  
Mono said the followinmg exception happened:
Unhandled Exception: System.ArgumentException: parsing "+^\d{1}.*.\d{1}.*$" -
Ba
d quantifier.
Parameter name: +^\d{1}.*.\d{1}.*$
  at System.Text.RegularExpressions.Syntax.Parser.ParseGroup
(System.Text.Regula
rExpressions.Syntax.Group group, RegexOptions options,
System.Text.RegularExpres
sions.Syntax.Assertion assertion) [0x00000] in <filename unknown>:0
  at System.Text.RegularExpressions.Syntax.Parser.ParseRegularExpression
(System
String pattern, RegexOptions options) [0x00000] in <filename unknown>:0
  at System.Text.RegularExpressions.Regex.CreateMachineFactory (System.String
pa
ttern, RegexOptions options) [0x00000] in <filename unknown>:0
  at System.Text.RegularExpressions.Regex.InitNewRegex () [0x00000] in
<filename
 unknown>:0
  at System.Text.RegularExpressions.Regex.Init () [0x00000] in <filename
unknown
>:0
  at System.Text.RegularExpressions.Regex..ctor (System.String pattern,
RegexOpt
ions options) [0x00000] in <filename unknown>:0
  at Microsoft.VisualBasic.CompilerServices.StringType.StrLike (System.String
So
urce, System.String Pattern, CompareMethod CompareOption) [0x00000] in
<filename
 unknown>:0
  at Microsoft.VisualBasic.CompilerServices.Operators.LikeString (System.String
Source, System.String Pattern, CompareMethod CompareOption) [0x00000] in
<filena
me unknown>:0
  at Microsoft.VisualBasic.CompilerServices.LikeOperator.LikeString
(System.Stri
ng Source, System.String Pattern, CompareMethod CompareOption) [0x00000] in
<fil
ename unknown>:0
  at dnu.ParseUtils.LikeOP (System.String str, System.String pattern) [0x00000]
in <filename unknown>:0
  at tokenizer.Parser.TokenOptimizer.Optimize (tokenizer.AST.Tokens.Token tok)
[
0x00000] in <filename unknown>:0
  at tokenizer.Parser.StmtOptimizer.Optimize (tokenizer.AST.Stmts.Stmt stm)
[0x0
0000] in <filename unknown>:0
  at tokenizer.Parser.Parser.Parse (tokenizer.AST.Stmts.StmtSet stms) [0x00000]
in <filename unknown>:0
  at dylan.NET.Compiler.Module1.main (System.String[] args) [0x00000] in
<filena
me unknown>:0

In .NET 3.5 it does not happen.

Expected Results:  
The exception should not have appeared and the software should have terminated
normally after parsing the whole source file given.

OS: Windows 7 Home Premium
Runtime: Mono 2.6.7 for Windows (did not build myself)
Context: The program that stops is a compiler(attached) designed to run on Mono

-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the mono-bugs mailing list