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
{{ message }}
Repository navigation
JSON Parse error in internal/process/report? #43193
Just a shot in the dark. But it looks like the function WriteNodeReport from src/node_report.cc on line 184 is doing the report data collection. I'd compile v18.2.0 from the source and see if you can replicate this issue. If so it might be a good idea to start debugging from that function.
Big thanks to @JckXia for helping me track this down.
It seems that this error happens when the vertical tab byte ^K is somewhere in the environment. This causes PrintSystemInformation to die (src/node_report line 708).
Weird that other binary bytes seem to be escaped appropriately. That said, the problem is now reproducible. Being sure to use the binary byte (not characters ^ and K):
% FOO='^K'
% node
> process.report.getReport();Uncaught SyntaxError: Unexpected token v in JSON at position 10157
@wrynegade I have a maybe silly question, could you share how to type binary byte (not characters ^ and K)? I am on mac.
Of course! I don't have a macbook to test specifically, but this is the byte sent by pressing CTRL + K.
Typing this character as a byte literal will depend largely on your editor and system. In a terminal emulator you can type CTRL + V (to insert the next character sequence as a literal) then CTRL + K.
@wrynegade I have a maybe silly question, could you share how to type binary byte (not characters ^ and K)? I am on mac.
Of course! I don't have a macbook to test specifically, but this is the byte sent by pressing CTRL + K.
Typing this character as a byte literal will depend largely on your editor and system. In a terminal emulator you can type CTRL + V (to insert the next character sequence as a literal) then CTRL + K.
Thank you! I made it. I could reproduce this problem now.
Activity
JckXia commentedon May 24, 2022
Just a shot in the dark. But it looks like the function
WriteNodeReportfromsrc/node_report.ccon line 184 is doing the report data collection. I'd compilev18.2.0from the source and see if you can replicate this issue. If so it might be a good idea to start debugging from that function.Though this looks like an error thrown by JS. This function https://github.com/nodejs/node/blob/master/lib/internal/process/report.js#L32 seems to also deal with the report generation. What if you add a few console logs there to see if that's where it is happening?
wrynegade commentedon May 24, 2022
I'll give that a try and report back; thanks for the suggestion!
wrynegade commentedon May 25, 2022
Big thanks to @JckXia for helping me track this down.
It seems that this error happens when the vertical tab byte
^Kis somewhere in the environment. This causesPrintSystemInformationto die (src/node_reportline 708).Weird that other binary bytes seem to be escaped appropriately. That said, the problem is now reproducible. Being sure to use the binary byte (not characters
^andK):targos commentedon May 25, 2022
@nodejs/diagnostics
F3n67u commentedon May 27, 2022
@wrynegade I have a maybe silly question, could you share how to type binary byte (not characters ^ and K)? I am on mac.
wrynegade commentedon May 27, 2022
Of course! I don't have a macbook to test specifically, but this is the byte sent by pressing CTRL + K.
Typing this character as a byte literal will depend largely on your editor and system. In a terminal emulator you can type CTRL + V (to insert the next character sequence as a literal) then CTRL + K.
F3n67u commentedon May 27, 2022
Thank you! I made it. I could reproduce this problem now.
src: fix json utils escapes for U+000B
src: fix json utils escapes for U+000B
src: fix json utils escapes for U+000B
src: fix json utils escapes for U+000B
src: fix json utils escapes for U+000B