-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
Milestone
Description
Describe the bug
When using regex lookahead jq
freezes, eats up all system memory, prints an error message and eventually aborts
To Reproduce
$ jq -n '"qux" | gsub("(?<=u)"; "u")'
"quux"
$ free -g
total used free shared buff/cache available
Mem: 15 5 6 0 3 8
Swap: 1 0 1
$ jq -n '"qux" | gsub("(?=u)"; "u")'
error: cannot allocate memory
[1] 123456 abort (core dumped) jq -n '"qux" | gsub("(?=u)"; #"u")'
Expected behavior
jq
outputs the result and exit
Environment
- Ubuntu 20.04.2 LTS
- jq-1.6
Additional context
I'm aware that this may be an issue in Oniguruma but I wasn't able to reproduce it due to my lack of experience with C