Bug 17075 – ctRegex BacktrackingMatcher.prevStack: free(): invalid pointer

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2017-01-08T18:58:48Z
Last change time
2018-01-05T13:27:50Z
Keywords
pull
Assigned to
No Owner
Creator
JR

Attachments

IDFilenameSummaryContent-TypeSize
1633triggeringinputInput that triggers the crashtext/html176640

Comments

Comment #0 by zorael — 2017-01-08T18:58:48Z
Created attachment 1633 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.
Comment #1 by dmitry.olsh — 2017-03-08T16:17:48Z
Comment #2 by dmitry.olsh — 2017-03-08T16:25:07Z
*** Issue 15593 has been marked as a duplicate of this issue. ***
Comment #3 by github-bugzilla — 2017-03-15T00:34:01Z
Commits pushed to stable at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/d47c8859bcb2bffc684fc4d6b57e4f5ed0ec5441 Fix issue 17075 ctRegex BacktrackingMatcher.prevStack: free(): invalid pointer https://github.com/dlang/phobos/commit/091ff0f8bbd8383e81eddfca8e0299178825301f Merge pull request #5252 from DmitryOlshansky/issue-17075 Fix issue 17075 ctRegex BacktrackingMatcher.prevStack: free(): invali… merged-on-behalf-of: H. S. Teoh <[email protected]>
Comment #4 by github-bugzilla — 2017-03-22T12:05:28Z
Commits pushed to master at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/d47c8859bcb2bffc684fc4d6b57e4f5ed0ec5441 Fix issue 17075 ctRegex BacktrackingMatcher.prevStack: free(): invalid pointer https://github.com/dlang/phobos/commit/091ff0f8bbd8383e81eddfca8e0299178825301f Merge pull request #5252 from DmitryOlshansky/issue-17075
Comment #5 by github-bugzilla — 2017-08-07T12:26:28Z
Commits pushed to newCTFE at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/d47c8859bcb2bffc684fc4d6b57e4f5ed0ec5441 Fix issue 17075 ctRegex BacktrackingMatcher.prevStack: free(): invalid pointer https://github.com/dlang/phobos/commit/091ff0f8bbd8383e81eddfca8e0299178825301f Merge pull request #5252 from DmitryOlshansky/issue-17075
Comment #6 by github-bugzilla — 2018-01-05T13:27:50Z
Commits pushed to dmd-cxx at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/d47c8859bcb2bffc684fc4d6b57e4f5ed0ec5441 Fix issue 17075 ctRegex BacktrackingMatcher.prevStack: free(): invalid pointer https://github.com/dlang/phobos/commit/091ff0f8bbd8383e81eddfca8e0299178825301f Merge pull request #5252 from DmitryOlshansky/issue-17075