flamegraph icon indicating copy to clipboard operation
flamegraph copied to clipboard

Error in generated SVG: invalid Char value 27 (<0x1b>) (macOS)

Open filippo-orru opened this issue 2 years ago • 7 comments

The generated svg cannot be opened. Firefox refuses to load the svg at all while Chrome shows this:

This page contains the following errors: error on line 414 at column 105864: PCDATA invalid Char value 27 Below is a rendering of the page up to the first error.

The problem is the char <0x1b> at the specified location in the file: <0x1b>

When I delete it from the file, it loads without errors.

filippo-orru avatar Nov 02 '21 11:11 filippo-orru

What OS are you on? I'm guessing this might be part of the perf or dtrace data.

djc avatar Nov 02 '21 11:11 djc

I'm on macOS 11.6 (as stated in the title).

filippo-orru avatar Nov 02 '21 11:11 filippo-orru

@jonhoo have you seen anything like this before? Seems like this might make more sense as an inferno issue?

djc avatar Nov 02 '21 12:11 djc

Happy to help if you have more questions. The project I benchmarked is https://github.com/ffactory-ofcl/fourinarow-server in case you want to try.

filippo-orru avatar Nov 02 '21 12:11 filippo-orru

Huh, no, haven't seen anything like it. It does suggest that there's a weird Unicode code point in a function name or something. The fact that you get a SVG suggests that Inferno is handling the code point just fine, but it needs to be escaped somehow in the output. It'd be helpful to know some more context here, like where this code point appears in the SVG, and what value it's a part of.

jonhoo avatar Nov 03 '21 02:11 jonhoo

The context would be my project, which I linked above. You can try building and running it for a few seconds, it'll most probably contain the code point - that is if the bug comes from my project and not from running on mac.

Sidenote @jonhoo: big fan of your videos :)

filippo-orru avatar Nov 03 '21 08:11 filippo-orru

Ah, sorry, what I meant was context in the sense of the surrounding context of the indicated file. That is, can you copy-paste the surrounding lines of the SVG, as well as (if you can) the lines of the generated trace file that's fed into inferno that contain the problematic code point?

jonhoo avatar Nov 06 '21 18:11 jonhoo

flamegraph

I am able to reproduce when using VSCode ritwickdey.LiveServer extension to serve the above SVG.

mosure avatar Mar 03 '23 07:03 mosure

I'm having the same issue, on macos as well.

yanns avatar Jan 25 '24 11:01 yanns

See earlier comments from @jonhoo. I will close this; please direct future issues to the inferno issue tracker.

djc avatar Jan 25 '24 11:01 djc

I've created https://github.com/jonhoo/inferno/issues/313 to track this issue upstream.

yanns avatar Jan 25 '24 11:01 yanns