Skip to content
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

-Yprofile-trace doesn't correctly escape output #21858

Closed
mrdziuban opened this issue Oct 29, 2024 · 0 comments · Fixed by #21872
Closed

-Yprofile-trace doesn't correctly escape output #21858

mrdziuban opened this issue Oct 29, 2024 · 0 comments · Fixed by #21872
Assignees
Labels
area:private options Issues tied to -Y private/internal compiler settings. area:tooling itype:bug
Milestone

Comments

@mrdziuban
Copy link

Compiler version

3.6.2-RC1-bin-20241028-a3786a5-NIGHTLY

Minimized code

Compiling this code with -Yprofile-enabled -Yprofile-trace test.trace

class /\

Output

Results in a test.trace file that contains invalid JSON since the backslash in class /\ is not escaped:

{"cat":"typecheck","name":"class /\","ph":"E","pid":"22181-00129","tid":"00129","ts":2132512955562}

Expectation

The backslash should be escaped with another backslash, i.e.

{"cat":"typecheck","name":"class /\\","ph":"E","pid":"22181-00129","tid":"00129","ts":2132512955562}
@mrdziuban mrdziuban added itype:bug stat:needs triage Every issue needs to have an "area" and "itype" label labels Oct 29, 2024
@WojciechMazur WojciechMazur self-assigned this Oct 30, 2024
@WojciechMazur WojciechMazur added area:tooling and removed stat:needs triage Every issue needs to have an "area" and "itype" label labels Oct 30, 2024
@Gedochao Gedochao added the area:private options Issues tied to -Y private/internal compiler settings. label Oct 30, 2024
WojciechMazur added a commit that referenced this issue Nov 12, 2024
…21872)

Fixes #21858 by setting up special escapes for characters that might
corrupt the output JSON file produced by `-Yprofile-trace`
@WojciechMazur WojciechMazur added this to the 3.6.3 milestone Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:private options Issues tied to -Y private/internal compiler settings. area:tooling itype:bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants