Closed xexyl closed 2 hours ago
It is this code:
if (CONVERTED_PARSED_JSON_NODE(item)) {
/*
* print string preamble
*/
fprint(stream, "\tlen{%s%s%s%s%s%s%s%s%s%s}: %ju\tvalue:\t",
PARSED_JSON_NODE(item)?"p":"",
CONVERTED_PARSED_JSON_NODE(item)?",":":",
CONVERTED_PARSED_JSON_NODE(item)?"c:":"",
item->quote ? "q" : "",
item->same ? "=" : "",
item->slash ? "/" : "",
item->posix_safe ? "P" : "",
item->first_alphanum ? "a" : "",
item->upper ? "U" : "",
(uintmax_t)item->str_len);
(void) fprint_line_buf(stream, item->str, item->str_len, '"', '"');
and in particular fprint()
.
I've isolated the problem. It was the removal of has_nul
.
Oh how simple! I forgot to update the format string ...
This has been fixed. It means too that the mkiocccentry needs that fix, maybe, though that means the major changes of today.
Is there an existing issue for this?
Describe the bug
An interesting problem is that when using
-J level
withjparse
is it segfaults when printing strings. I guess a NULL pointer but I can barely see right now which is why I'm opening this instead - to remind me. Examples below of where it works fine and where it does not work fine.What you expect
That
jparse -J 3
should work fine.Environment
jparse_bug_report.sh output
n/a as the tool does not even use the -J option.
Anything else?
This works fine:
as does this:
But this does not:
Stack trace:
Unfortunately it's optimising it out even though
-O0
.This should obviously not happen. It even happens with version:
The output should be:
which is from:
... which is some time ago, though it probably was not the last one that that worked in. Nonetheless it might help isolate the problem when I am more alert.