Describe the bug
segfault with jq on osx when using select(...test).
The exact same jq command works on linux.
To Reproduce
Sample input file test.json:
[
{
"key": "CertificateArn",
"value": "arn:aws:acm:eu-west-1:REDACTED:certificate/FOO"
},
{
"key": "DomainName",
"value": "pattern.example.com"
}
]
[
{
"key": "CertificateArn",
"value": "arn:aws:acm:eu-west-1:REDACTED:certificate/BAR"
},
{
"key": "DomainName",
"value": "baz.example.com"
}
]
$ cat test.json | jq '.[] | select(.value|test("pattern"))'
Segmentation fault: 11
````
**Expected behavior**
{
"key": "DomainName",
"value": "pattern.example.com"
}
```
Environment (please complete the following information):
Ahh.
I ran brew uninstall jq; brew install jq, and it worked.
Further digging revealed the problem:
https://github.com/kkos/oniguruma/issues/159#issuecomment-543341100
tl;dr: If you installed jq before upgrading to Catalina, any regexp will segfault.
I'm not sure how homebrew is supposed to handle OS upgrades, but seems to me that OS upgrades need to be factored in, especially if the desired version of an installed brew application remains the same but the dependency was bumped (in this case oniguruma)
I hope this helps someone!
Most helpful comment
Ahh.
I ran
brew uninstall jq; brew install jq, and it worked.Further digging revealed the problem:
https://github.com/kkos/oniguruma/issues/159#issuecomment-543341100
tl;dr: If you installed jq before upgrading to Catalina, any regexp will segfault.
I'm not sure how homebrew is supposed to handle OS upgrades, but seems to me that OS upgrades need to be factored in, especially if the desired version of an installed brew application remains the same but the dependency was bumped (in this case oniguruma)
I hope this helps someone!