[Issue 17075] New: ctRegex BacktrackingMatcher.prevStack: free(): invalid pointer

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sun Jan 8 10:58:48 PST 2017


https://issues.dlang.org/show_bug.cgi?id=17075

          Issue ID: 17075
           Summary: ctRegex BacktrackingMatcher.prevStack: free(): invalid
                    pointer
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P1
         Component: phobos
          Assignee: nobody at puremagic.com
          Reporter: zorael at gmail.com

Created attachment 1633
  --> https://issues.dlang.org/attachment.cgi?id=1633&action=edit
Input that triggers the crash

Download http://pastebin.com/raw/UVF41mPf and pipe it into the following:

import std.stdio;
import std.regex;
import std.conv;

enum titlePattern = `<title>(.+)</title>`;
static titleRegex = ctRegex!titlePattern;

void main()
{
    auto content = stdin.byLineCopy.to!string;
    auto hits = content.matchAll(titleRegex);
}

----------

*** Error in `./test': free(): invalid pointer: 0x0000000000f42148 ***
======= Backtrace: =========
/usr/lib/libc.so.6(+0x70c4b)[0x7fef85a22c4b]
/usr/lib/libc.so.6(+0x76fe6)[0x7fef85a28fe6]
/usr/lib/libc.so.6(+0x777de)[0x7fef85a297de]
./test(nothrow @nogc @trusted bool
std.regex.internal.backtracking.BacktrackingMatcher!(true).BacktrackingMatcher!(char,
std.regex.internal.ir.Input!(char).Input).BacktrackingMatcher.prevStack()+0x90)[0x4
cd2b8]
[...]

Tested on two machines, both running linux.

--


More information about the Digitalmars-d-bugs mailing list