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

SpeedScopeStackSource fails to escape new-lines in json #1057

Closed
josalem opened this issue Nov 18, 2019 · 2 comments
Closed

SpeedScopeStackSource fails to escape new-lines in json #1057

josalem opened this issue Nov 18, 2019 · 2 comments

Comments

@josalem
Copy link
Contributor

josalem commented Nov 18, 2019

Original issue in dotnet/diagnostics:

Steps to reproduce:

                    using var httpClient = new HttpClient();
                    string response = await httpClient.GetStringAsync("http://redhatloves.net/");

Log with --providers Microsoft-System-Net-Http --format speedscope

The resulting json file is invalid because newlines are not escaped in json strings.

For example:

{ "name": "EventData: parameters=(Method: GET, RequestUri: 'http://redhatloves.net/', Version: 1.1, Content: <null>, Headers:
{
})" }

Original comment by: @tmds

dotnet/diagnostics#623

Should just be a matter of adding encoding logic to the JSON writing logic. Could use the new System.Text.Json API which is available as a nuget package to older versions of the runtime.

CC - @adamsitnik

@adamsitnik
Copy link
Member

It was possible to fix the problem in dotnet trace: dotnet/diagnostics#661

IMHO this issue can be closed. Or I can add a very defensive condition to SpeedScopeStackSourceWriter (I would prefer not to do it)

@josalem
Copy link
Contributor Author

josalem commented Dec 5, 2019

I think the fix is dotnet/diagnostics is sufficient. Thanks for finding the issue 😃

@josalem josalem closed this as completed Dec 5, 2019
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

2 participants