-
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
Core dumped on implode #1160
Comments
@bendem wrote:
For the record, |
Ah I see, |
Yeah, these are definitely for codepoints. That said, we should never On Sun, Jun 5, 2016 at 1:08 PM bendem [email protected] wrote:
|
Reproduced a variation of this on OSX jq while code golfing
|
The issue still exists in the latest git version:
|
@nyuszika7h - You are right, but just to make sure everyone knows, both these examples should raise an error condition anyway. |
I know those inputs are invalid, but I think it would still be preferable to raise an error rather than a core dump. |
The issue is still present (jq-1.6-129-g80052e5). @wtlangford, may I ask you, are you still interested in making a fix? There is one more assertion that may be violated as a result of calling $ jq -n '[-2] | implode'
jq: src/jv_unicode.c:101: jvp_utf8_encode: Assertion `codepoint >= 0 && codepoint <= 0x10FFFF' failed.
Aborted (core dumped) |
I hit another assertion with this:
And my terminal's text became green. |
A reduced version of what @bottle2 posted above:
Any value representing a surrogate code point (between 55296 and 57343) will produce this result. String literals for comparison:
|
Error on non-array input, non-number codepoint and negative codepoint (asserted before) TODO: Handle surrogate range 0xd800-0xdfff Fixes jqlang#1160
Error on non-number codepoint and negative codepoint (asserted before) TODO: Handle surrogate range 0xd800-0xdfff Fixes jqlang#1160
Error on non-number codepoint, asserted before Replace negative codepoint with uncode replacement character, asserted before TODO: Handle surrogate range 0xd800-0xdfff Fixes jqlang#1160
Error on non-number codepoint, asserted before Replace negative codepoint and surrogate range with unicode replacement character, asserted before Fixes jqlang#1160
Error on non-number codepoint, asserted before Replace negative codepoint and surrogate range with unicode replacement character, asserted before Fixes jqlang#1160
Error on non-number codepoint, asserted before Replace negative codepoint and surrogate range with unicode replacement character, asserted before Fixes jqlang#1160
Error on non-number codepoint, asserted before Replace negative codepoint and surrogate range with unicode replacement character, asserted before Fixes jqlang#1160
Error on non-number and nan codepoint, would asserd before Replace negative codepoint and surrogate range with unicode replacement character, would assert before Fixes jqlang#1160
Error on non-number and nan codepoint, would asserd before Replace negative codepoint and surrogate range with unicode replacement character, would assert before Fixes jqlang#1160
Error on non-number and nan codepoint, would asserd before Replace negative codepoint and surrogate range with unicode replacement character, would assert before Fixes jqlang#1160
Error on non-number and nan codepoint, would asserd before Replace negative codepoint and surrogate range with unicode replacement character, would assert before Fixes jqlang#1160
Error on non-number and nan codepoint, would asserd before Replace negative codepoint and surrogate range with unicode replacement character, would assert before Fixes jqlang#1160
Error on non-number and nan codepoint, would asserd before Replace negative codepoint and surrogate range with unicode replacement character, would assert before Fixes jqlang#1160
Error on non-number and nan codepoint, would asserd before Replace negative codepoint and surrogate range with unicode replacement character, would assert before Fixes jqlang#1160
Error on non-number and nan codepoint, would asserd before Replace negative codepoint and surrogate range with unicode replacement character, would assert before Fixes #1160
Was experimenting with jq and came up accross this crash. I have no idea if
implode
is supposed to work like that, but I think the crash is worth fixing.Reproduction steps
output
version
backtrace
The text was updated successfully, but these errors were encountered: