www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 7045] New: AssertError in std.regex on line 1573

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7045

           Summary: AssertError in std.regex on line 1573
           Product: D
           Version: unspecified
          Platform: All
        OS/Version: Linux
            Status: NEW
          Severity: critical
          Priority: P2
         Component: Phobos
        AssignedTo: nobody puremagic.com
        ReportedBy: jmdavisProg gmx.com



PST ---
Created an attachment (id=1049)
D program which fails

Running the attached program with the attached file (using the latest dmd,
druntime, and Phobos), results in this Assertion failure:

core.exception.AssertError std.regex(1573): Assertion failure
----------------
./relayhosts_orig(_d_assertm+0x2a) [0x4d27aa]
./relayhosts_orig() [0x4d698d]
./relayhosts_orig( safe std.typecons.Tuple!(std.internal.uni.CodepointSet,
std.regex.Parser!(immutable(char)[]).Parser.Operator).Tuple
std.regex.Parser!(immutable(char)[]).Parser.parseCharTerm()+0x60a) [0x4a04ae]
./relayhosts_orig( safe void
std.regex.Parser!(immutable(char)[]).Parser.parseCharset()+0x1f1) [0x4a0ac1]
./relayhosts_orig( safe void
std.regex.Parser!(immutable(char)[]).Parser.parseAtom()+0xf4) [0x49fa18]
./relayhosts_orig( trusted void
std.regex.Parser!(immutable(char)[]).Parser.parseRegex()+0xb59) [0x49eb91]
./relayhosts_orig( trusted std.regex.Parser!(immutable(char)[]).Parser
std.regex.Parser!(immutable(char)[]).Parser.__ctor!(const(char)[]).__ctor(immutable(char)[],
const(char)[])+0x6a) [0x4aeee2]
./relayhosts_orig( safe std.regex.Regex!(char).Regex
std.regex.regex!(immutable(char)[]).regex(immutable(char)[],
const(char)[])+0x40) [0x49d8a8]
./relayhosts_orig(_Dmain+0x3b) [0x49d517]
./relayhosts_orig(extern (C) int rt.dmain2.main(int, char**).void
runMain()+0x17) [0x4d2ddf]
./relayhosts_orig(extern (C) int rt.dmain2.main(int, char**).void tryExec(scope
void delegate())+0x2a) [0x4d2986]
./relayhosts_orig(extern (C) int rt.dmain2.main(int, char**).void
runAll()+0x42) [0x4d2e32]
./relayhosts_orig(extern (C) int rt.dmain2.main(int, char**).void tryExec(scope
void delegate())+0x2a) [0x4d2986]
./relayhosts_orig(main+0xd3) [0x4d2917]
/lib/libc.so.6(__libc_start_main+0xed) [0x7f3dc4bc317d]


It happens on both 32-bit and 64-bit Linux. I don't know if it happens on other
OSes (though I assume that it does). I was trying to run an example from the
newsgroup to benchmark the old std.regex vs the new one, and while the old one
worked, the new one failed with the AssertError.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Dec 01 2011
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7045




PST ---
Created an attachment (id=1050)
Test file that I passed to the D program.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Dec 01 2011
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7045


Trass3r <mrmocool gmx.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mrmocool gmx.de



Why so complicated?

import std.regex;
void main()
{
    auto pattern =
regex(r"^(import|file|binary|config)\s+([^\(]+)\(?([^\)]*)\)?\s*$");
}

Taken from rdmd.

It fails cause it rejects \(
I suggest to turn line 1573 of regex.d (after case State.Escape:
switch(current))
into 'assert(0, "Unsupported escape character \\"~cast(char)current);' so one
gets a proper error message.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Dec 01 2011
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7045




PST ---
It was someone else's program, and I was in a hurry, so I didn't have time to
reduce it properly.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Dec 01 2011
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7045




btw, isn't this a regression?

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Dec 06 2011
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7045




Seems like it was fixed in the meantime.
http://www.mail-archive.com/digitalmars-d puremagic.com/msg70809.html

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Dec 06 2011
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7045


Dmitry Olshansky <dmitry.olsh gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |dmitry.olsh gmail.com
         Resolution|                            |FIXED


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Dec 09 2011