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

Workaround #32 - fails parsing invalid utf8 dtrace output (macos only?) #101

Merged
merged 1 commit into from
Dec 7, 2020

Commits on Oct 2, 2020

  1. Workaround flamegraph-rs#32 - fails parsing invalid utf8 dtrace output

    Intermittently, invalid utf-8 is found in cargo-flamegraph.stacks, which
    causes parsing to blow up with the error:
    
    > unable to collapse generated profile data: Custom { kind: InvalidData, error: StringError("stream did not contain valid UTF-8") }
    
    This commit doesn't fix the underlying problem, but simply works around
    it by lossily re-encoding to valid utf8.
    
    Anecdotally it seems to be macos symbol names at the end of the line that
    contain the invalid utf-8 - I don't know if this is due to some error in dtrace
    or if somehow the symbols actually contain non utf-8 encodings.
    
    Note I did try explicitly specifying utf8 output, by adding to the
    dtrace command invocation:
    
        command.arg("-x");
        command.arg("encoding=utf8");
    
    But I ran into the same error seemingly just as often.
    michaelkirk committed Oct 2, 2020
    Configuration menu
    Copy the full SHA
    6da5ff7 View commit details
    Browse the repository at this point in the history