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

trace-profile.json is not a valid json #437

Open
RainNapper opened this issue Apr 17, 2020 · 2 comments
Open

trace-profile.json is not a valid json #437

RainNapper opened this issue Apr 17, 2020 · 2 comments
Assignees

Comments

@RainNapper
Copy link
Contributor

RainNapper commented Apr 17, 2020

The trace-profile.json uses "nan" in some entries. I do not know exactly under what circumstances "nan" is used, but when this file is loaded by chrome://tracing, it will throw an error for an invalid character.
Error:

While importing:
SyntaxError: Unexpected token a in JSON at position 6502
    at JSON.parse (<anonymous>)
    at new TraceEventImporter (chrome://tracing/tracing.js:5498:19)
    at Import.createImporter_ (chrome://tracing/tracing.js:1332:8)
    at chrome://tracing/tracing.js:1326:167
    at Task.run (chrome://tracing/tracing.js:2553:95)
    at runAnother (chrome://tracing/tracing.js:2556:371)
    at runTask (chrome://tracing/tracing.js:2321:57)
    at processIdleWork (chrome://tracing/tracing.js:2326:116)
    at window.requestIdleCallback.timeout (chrome://tracing/tracing.js:2319:81)

Example line:

{"name":"CPU", "ph": "C", "ts": "1587074269993629", "pid": 1, "args": {"sys": nan, "usr": nan, "idle": nan}},

In the meantime, I've been able to work around this issue using:

cat trace-profile.json | sed "s/nan/0/g" > trace-profile-fixed.json
@ravimandala
Copy link
Contributor

Thanks for the temporary fix. I guess some missing entries are breaking the trace profile json. Bluepill should be outputting 0 or something appropriate. I will take a look.

@ravimandala ravimandala self-assigned this Jul 28, 2020
@chenxiao0228
Copy link
Collaborator

@RainNapper nan means NotANumber.

This looks like a bad exception handling. Will look into it. Thanks for reporting!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants