Subject: [BUG] Long line makes pattern matching (by //) hog Zsh
From: Sebastian Gniazdowski <[email-masked]>
To: Zsh hackers list <[email-masked]>
Date: Sun, 5 Jun 2016 16:36:12 +0200
List-Id: Zsh Workers List <zsh-workers.zsh.org>

Hello,
attached is a test program that in general blocks Zsh from ending.
Github user kapsh reported "fatal error: out of heap memory" and I
investigated that it's about long lines in his data. The pattern:

([^ /\\\\]##[^0-9/\\\\ ]##[^/\\\\]#(#e))

is:
1. not backslash nor slash nor space [^ /\\\\]##
2. not number, slash, backslash, space [^0-9/\\\\ ]##
3. not slash, backslash [^/\\\\]#
4. end of line (#e)

Removing first segment makes Zsh end after a couple of seconds (but
not on zsh-5.0.8). Tested on zsh-5.0.2, 5.0.8, 5.2

Best regards,
Sebastian Gniazdowski