You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all, this problem is reproduced when using jq as a library inside your program. I am executing an expression with tonumber or fromjson and if input is not valid, then the next call to jq_compile fails with this dump:
jq: error: Invalid numeric literal at EOF at line 1, column 1 (while parsing '5') at <builtin>, line 1:
def halt_error: halt_error(5);
jq: error: Invalid numeric literal at EOF at line 1, column 1 (while parsing '0') at <builtin>, line 7:
def unique: group_by(.) | map(.[0]);
jq: error: Invalid numeric literal at EOF at line 1, column 1 (while parsing '0') at <builtin>, line 8:
def unique_by(f): group_by(f) | map(.[0]);
... more lines related to parsing builtins.inc ...
jq: error: Invalid numeric literal at EOF at line 1, column 1 (while parsing '0') at <builtin>, line 248:
else (-1 -.[0])
jq: error: Invalid numeric literal at EOF at line 1, column 1 (while parsing '2') at <builtin>, line 250:
else .[2]
jq: src/builtin.c:1806: builtins_bind: Assertion `!nerrors' failed.
You can reproduce this bug with make check and this test at the start of tests/jq.test:
As you can see, the output is not for the last commit in the master branch, but for jq 1.6-99-gcf4b48c-dirty (cf4b48c). That's the first commit with this problem. The previous commit, b6be13d works great.
I see changes related to try/catch and find this issue #1859, but I don't know if this is related.
@nicowilliams can you help with this? I can make more tests if needed.
The text was updated successfully, but these errors were encountered:
Any updates on this issue?
I am experiencing a similar issue while using jq as a library. I have . as my query, and an intentionally invalid json something (no quotes, just some text).
On the first execution, it fails with a parse error, and on the second execution, I see the same failure on jq_parse_library.
I am sticking to the 1.6 release for now. I haven't experience any performance issues for my use case. I would have liked to fix the issue, but I have next to no experience in c. 😕
First of all, this problem is reproduced when using
jq
as a library inside your program. I am executing an expression withtonumber
orfromjson
and if input is not valid, then the next call tojq_compile
fails with this dump:You can reproduce this bug with
make check
and this test at the start oftests/jq.test
:Or with
fromjson
:The test is passed, but next test fails to compile with the described problem.
I've put
jq.test
andtest-suite.log
here: https://gist.github.com/diafour/3b3d8f123b642ff095c41c16d6f32d0eAs you can see, the output is not for the last commit in the master branch, but for
jq 1.6-99-gcf4b48c-dirty
(cf4b48c). That's the first commit with this problem. The previous commit, b6be13d works great.I see changes related to try/catch and find this issue #1859, but I don't know if this is related.
@nicowilliams can you help with this? I can make more tests if needed.
The text was updated successfully, but these errors were encountered: