-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
jq hangs with 100% CPU #1033
Comments
The local function |
It also doesn't look like the group replacement tags like "\1" ever work. |
@yurivict - See https://github.com/stedolan/jq/wiki/FAQ#support-for-regular-expressions regarding "named captures". It was never the intention to support "\1" (which as you note would have to be |
@pkoppstein Please review this diff:
The first hunk is clear: without this fix The second hunk adds a termination condition to the recursion in |
@yurivict What @pkoppstein is saying is that you need to use named capture groups. |
Ok, thanks, I got it. |
@wtlangford How hard would it be to support numbered backrefs? |
I think backrefs are more common and familiar. |
@nicowilliams wrote:
Yes, but your version will zap the result. The following passes the test:
(amongst others):
@yurivict - Regarding |
@yurivict - In case you're not aware that one can easily override jq-defined builtins by simply using 'def', here is a version which addresses the problems:
|
Thanks! I wasn't aware. |
Right, this stays open till we fix it. |
Fixed by @pkoppstein with ad8d1a8. |
This script hangs
when run on this package1.json
Since jq is supposed to work in a stream fashion, I don't think it should ever enter the endless cycle.
jq-1.5 on FreeBSD-10.2
The text was updated successfully, but these errors were encountered: