Skip to content

cmd/pprof: invokeVisualizer is racy #19020

@dsnet

Description

@dsnet

In invokeVisualizer, we defer deleting the temporary file when invoking the visualizer until the end of the pprof program. However, the invokeVisualizer does not wait for the viewer to finish when not running in interactive mode.

Thus, the following race occurs in non-interactive mode:

  • pprof generates some report
  • pprof invokes the browser to show report; Chrome starts running
  • Without waiting for browser to end, we return from invokeVisualizer and the pprof program begins terminations.
  • The DeferDelete is run, deleting the report file
  • Chrome has finished starting up, but cannot find the file. Oops.

The fix is probably to wait for the visualizer to end regardless of "interactivity".

Metadata

Metadata

Assignees

No one assigned

    Labels

    compiler/runtimeIssues related to the Go compiler and/or runtime.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions