Repository navigation
JSON Parse error in internal/process/report? #43193
Description
Activity
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?
Reacted by Wryn (yage) WagnerI'll give that a try and report back; thanks for the suggestion!
Reacted by Benjamin Gruenbaum and JackBig 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):% FOO='^K' % node > process.report.getReport(); Uncaught SyntaxError: Unexpected token v in JSON at position 10157
Reacted by JackReacted by Jack- addedreportIssues and PRs related to Node.js diagnostic reports.Issues and PRs related to Node.js diagnostic reports.
on May 25, 2022 @nodejs/diagnostics
Reacted by Tony GorezBeing sure to use the binary byte (not characters ^ and K):
@wrynegade I have a maybe silly question, could you share how to type binary byte (not characters ^ and K)? I am on mac.
@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.
Reacted by Feng Yu@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.
Reacted by Wryn (yage) Wagner and Tony Gorez- added a commit that references this issue
on Jun 14, 2022 - added a commit that references this issue
on Jul 12, 2022 - added a commit that references this issue
on Jul 31, 2022 - added a commit that references this issue
on Oct 10, 2022 - added a commit that references this issue
on Mar 21, 2024
Version
Platform
Subsystem
process.report.getReport
What steps will reproduce the bug?
1 Step: Run
process.report.getReport()How often does it reproduce? Is there a required condition?
I can only reproduce this on the current machine. Two other machines on the same architecture and node version appear unaffected.
Full reinstall of
nodehad no effect.What is the expected behavior?
No response
What do you see instead?
Additional information
I looked through source and don't understand how this report is generated, so I don't know how to debug.
This prevents me from building a variety of node projects on this machine and only started after an upgrade from v17.