-
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 dumps core when performing join on non-existent elements (cygwin) #1588
Comments
I'm getting this error a lot too, from various operations. I'm using the Cygwin version as well. I do not get this error when running the Windows native version of jq, even in Cygwin's bash prompt. |
Same with me on cygwin whereas in Linux (also jq-1.5) the exact same expression I made works perfectly. For me a workaround was filtering out null values in the jq pipe with this construct: I'm trying to reproduce it with above example, but I cannot get it to work immediately (maybe because there is no single match): However I do get a different error on Linux (no core dump):
|
I believe that this type of problem was fixed long ago in "master", but AFTER the release of jq 1.5. Using a recent version of jq:
|
Didn't mention core dump, but I did get a stack dump as this is still happening in Cygwin with 1.6:
....abort https://github.com/stedolan/jq/blob/master/src/util.c#L372 Looking at the code this seems to be a problem with a routine running in this environment when trying to find the filename in the jq_state (of the filter expression?) to display in an error. It's helpful to note generically that the program can still function correctly when a filter expression is more robust or at least syntactically correct so that it does not generate an error throughout data processing, something I thought was more completely broken. Developing on a different machine to get the correct filter expression helped get around this, but still annoying. |
I reproduced it with :
|
Still seeing this on Cygwin using jq 1.6.1
The ".stackdump" file is how core dumps appear under Cygwin without a lot of additional debugging tools installed. In this case I can at least get away with the equivalent of |
@Farmbuyer do you know exact version+patches the asserting jq is? 1.6 + a few patches? i failed to reproduce with master $ jq --version
jq-1.6-159-gcff5336
$ echo '{}' > test.json
$ jq '.missing[]' test.json
jq: error (at test.json:1): Cannot iterate over null (null) |
The reported assertion error is exactly same as #2116, and this is confirmed to be fixed in the master version by a Cygwin user there. |
@wader I didn't see your comment until now because github doesn't notify me for those kinds of tags, apparently. $ jq --version
jq-1.6
$ jq '.missing[]' <<<'{}'
assertion "cb == jq_util_input_next_input_cb" failed: file "/usr/src/ports/jq/jq-1.6-1.x86_64/src/jq-1.6/src/util.c", line 371, function: jq_util_input_get_position
Aborted (core dumped)
That's good to hear, the 1.6 release is now five years old and this crash-instead-of-error-message is getting really f*king old! |
You might have noticed that we just published jq 1.7rc2. We're very close to a 1.7. Please give 1.7rc2 a try! |
Cygwin maintainers don't typically package anything until it's released, so trying to get a prerelease running from scratch is quite honestly more effort than I can afford to volunteer on an employer computer. Glad that a new release is in the pipe though! |
When looking for a list of elements and attempting to join them, jq crashes rather than producing a sensible error.
I haven't confirmed if this is cygwin specific but will at some point.
The text was updated successfully, but these errors were encountered: