Thread overview
[Issue 5072] New: Iterating an empty result returned by match() crashes the application
Oct 18, 2010
Dorel Pîslan
Feb 06, 2011
Brad Roberts
Feb 26, 2013
Dmitry Olshansky
October 18, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=5072

           Summary: Iterating an empty result returned by match() crashes
                    the application
           Product: D
           Version: D2
          Platform: x86_64
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody@puremagic.com
        ReportedBy: pislan@gmail.com


--- Comment #0 from Dorel Pîslan <pislan@gmail.com> 2010-10-18 11:50:17 PDT ---
Created an attachment (id=785)
Full D program that reproduces bug.

In this code:

try
{
 foreach( r; result.captures)
      writeln(r);
}
catch(Exception * exc)
{
  //we never get here
}

if result is empty the application exits. And no exception is caught.

Full program attached.

Tested with D2 compiler. Version: not specified. Size: 1.340.444 bytes

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


Andrei Alexandrescu <andrei@metalanguage.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
                 CC|                            |andrei@metalanguage.com
         AssignedTo|nobody@puremagic.com        |andrei@metalanguage.com


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
February 06, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=5072


Brad Roberts <braddr@puremagic.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Platform|x86_64                      |x86


--- Comment #1 from Brad Roberts <braddr@puremagic.com> 2011-02-06 15:38:53 PST ---
Mass migration of bugs marked as x86-64 to just x86.  The platform run on isn't what's relevant, it's if the app is a 32 or 64 bit app.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
February 26, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=5072



--- Comment #2 from Andrei Alexandrescu <andrei@erdani.com> 2013-02-26 08:55:17 PST ---
Passed on to Dmitry.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
February 26, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=5072


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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |WORKSFORME


--- Comment #3 from Dmitry Olshansky <dmitry.olsh@gmail.com> 2013-02-26 09:01:33 PST ---
2010 ... that was a year before the new std.regex.
Now it just works and empty result is, well, just an empty range. This is what
I see:

Running Test1()
Running Test2()

Press any key to continue...

The last line is printed by the app so no crashes here (Win32).

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